HireGo is a scalable, production-ready REST API for a modern job portal. Built with Node.js, Express, TypeScript, and PostgreSQL, it supports robust role-based workflows for Candidates, Hiring Managers, and Admins.
- Backend: Node.js, Express.js, TypeScript
- Database: PostgreSQL + Prisma ORM
- Authentication: JWT (JSON Web Tokens)
- Validation: Zod
- File Uploads: Multer (PDF resume handling)
- Testing: Jest & Supertest
- Docs: Swagger/OpenAPI
- DevOps: Docker, Docker Compose, GitHub Actions (with DockerHub integration)
| Role | Capabilities |
|---|---|
| Candidate | Register/login, view/filter jobs, apply with resume (PDF), manage favorites |
| Hiring Manager | Post/edit/delete own jobs, view applicants, update job status |
| Admin | Manage all users (block, soft-delete, promote/demote roles), view all data |
- 🔐 Secure JWT-based authentication
- 🛡️ Role-Based Access Control (RBAC)
- 📄 Resume uploads with PDF validation
- ⭐ Favorite jobs support
- 🔍 Filtering, sorting & pagination on jobs
- 🗂️ Modular MVC structure
- 🧪 Automated testing (Jest + Supertest)
- 📦 Dockerized for easy deployment
- 🚀 GitHub Actions CI/CD with DockerHub integration
- 📜 Swagger API documentation
src/
├── controllers/ # Business logic
├── routes/ # Express routes
├── services/ # Service layer
├── middlewares/ # Auth, error handling, etc.
├── validators/ # Zod schemas and request validation
├── utils/ # Helper functions and utilities
├── types/ # TypeScript type definitions and interfaces
├── docs/ # Swagger/OpenAPI documentation and specs
├── lib/ # Prisma client
├── app.ts # Express config
└── server.ts # Entrypoint
- Node.js ≥ 18
- PostgreSQL
- Docker & Docker Compose (optional, for easy setup)
.envfile configured (see below)
git clone https://github.com/your-username/hirego-api.git
cd hirego-api
npm installCreate a .env file in the root:
DATABASE_URL="postgresql://<user>:<password>@localhost:5432/hirego"
JWT_SECRET="your_secret_here"For Docker Compose, use:
DATABASE_URL="postgresql://<user>:<password>@db:5432/hirego"
JWT_SECRET="your_secret_here"(Replace <user> and <password> with your actual DB credentials.)
npx prisma migrate dev --name init
npx prisma generatenpm run dev
# Server starts at: http://localhost:5000docker compose up --build
# Or to remove old volumes/data:
docker compose down -v && docker compose up --buildAll endpoints return JSON.
For full interactive docs, see /api-docs (Swagger UI) when the server is running.
| Method | Endpoint | Description | Auth | Roles |
|---|---|---|---|---|
| POST | /signup |
Register a new user | ❌ | — |
| POST | /login |
Login and get a JWT | ❌ | — |
| GET | /me |
Get current user profile | ✅ | All |
| Method | Endpoint | Description |
|---|---|---|
| GET | /admin/users |
Get all users |
| PATCH | /admin/users/:id/role |
Promote/demote user role |
| PATCH | /admin/users/:id/block |
Block/unblock a user |
| DELETE | /admin/users/:id |
Soft delete a user |
| GET | /admin/jobs |
Get all jobs |
| GET | /admin/applications |
Get all job applications |
| PATCH | /admin/applications/:id/status |
Update application status (also manager) |
| Method | Endpoint | Description |
|---|---|---|
| POST | /create |
Create a new job |
| GET | /manager/myjobs |
View own jobs |
| PATCH | /updatejob/:id |
Update a job you created |
| DELETE | /deletejob/:id |
Delete a job you created |
| PATCH | /admin/applications/:id/status |
Update application status |
| Method | Endpoint | Description |
|---|---|---|
| GET | /getalls |
List all jobs (with filtering, sorting, paging) |
| GET | /jobs/:id |
View job details |
| POST | /jobs/:id/apply |
Apply to a job (attach resume PDF) |
| GET | /user/applications |
Get your applications |
| DELETE | /user/applications/:id |
Delete your application |
| GET | /user/applications/:id/resume |
Download your submitted resume |
| POST | /jobs/:id/favorite |
Add job to favorites |
| DELETE | /jobs/:id/favorite |
Remove job from favorites |
| GET | /user/favorites |
List your favorited jobs |
GET /getalls?page=1&limit=10&sortBy=createdAt&order=desc&jobType=Full-Time&location=NYC&companyName=Acme
npm run testRuns unit & integration tests using Jest & Supertest.
docker build -t hirego-api .
docker run -p 5000:5000 --env-file .env hirego-apidocker compose up --build- Lint, test, and build Docker image on every push to
main - Automatic Docker image push to DockerHub (
DOCKERHUB_USERNAME/DOCKERHUB_TOKENsecrets required) - See
.github/workflows/ci-cd.ymlfor the full pipeline
To set up DockerHub deployment:
- Create an access token on DockerHub
- Add
DOCKERHUB_USERNAMEandDOCKERHUB_TOKENas GitHub repository secrets - Push to
mainand your image will be built & published!
MIT
- Asmare – Developer
Coming soon...
Or see Swagger API docs if deployed.
Tip: PRs and contributions are welcome!