This is the backend for OFFER-HUB, a freelance platform powered by Supabase and Node.js. It handles user management, services, project workflows, reviews, and more — using Express and PostgreSQL.
- Node.js
- Express
- TypeScript
- Supabase (PostgreSQL)
- ts-node
- dotenv
- CORS
backend/
├── src/
│ ├── controller/ # Route handlers
│ ├── routes/ # API route definitions
│ ├── services/ # Business logic
│ └── index.ts # App entry point
├── supabase/
│ └── migrations/ # One .sql file per DB table
├── .env.example
├── README.md
- Duplicate the
.env.examplefile and rename it to.env - Add your Supabase credentials:
# =================================
# PORT
# ================================
PORT=4000
# =================================
# SUPABASE
# ================================
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_SERVICE_ROLE_KEY=your-service-role-key
You can find these keys in your Supabase dashboard, under Project Settings → API.
- Go to https://supabase.com
- Create a new project
- Save the project ref and password
npx supabase login
npx supabase link --project-ref YOUR_PROJECT_REFYou’ll be asked to enter your database password.
Once linked, push your SQL migrations:
npx supabase db pushThis will create all tables defined in supabase/migrations/ in your Supabase project.
npm install
npm run devnpm run start- Do not commit your real
.envfile — it’s ignored via.gitignore. - Each migration is in its own file and auto-applies via
supabase db push. - You must test each endpoint with the Supabase DB and provide screenshots before any pull request is approved.