The Job Founder Microservices Backend Project is a comprehensive, production-ready backend application designed to manage job listings, user profiles, job applications, and educational blog content. Built with a modern microservices architecture, this system ensures high scalability, maintainability, and fault tolerance.
- π User Authentication & Authorization - JWT-based secure authentication
- πΌ Job Management - Complete CRUD operations for job listings
- π Application Tracking - End-to-end job application management
- π Educational Blog Platform - Tech blog management for career development
- πΌοΈ File Upload Support - Resume and image uploads via Cloudinary
- π‘οΈ Role-Based Access Control - Employer and Job Seeker roles
- π RESTful APIs - Well-structured API endpoints
- π³ Containerized Deployment - Docker & Docker Compose ready
This project implements a microservices architecture with the following components:
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β Frontend β β Nginx Proxy β β Load Balancer β
β (Port 5173) βββββΊβ (Port 4000) βββββΊβ β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β
ββββββββββββΌβββββββββββ
β β β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β User Service β β Job Service β β Application β
β (Port 4002) β β (Port 4001) β β Service β
βββββββββββββββββββ βββββββββββββββββββ β--(Port 4003)----β
β β βββββββββββββββββββ
βββββββββββββββββββ βββββββββββββββββββ
β Blog Service β β MongoDB β
β (Port 4004) β β Database β
βββββββββββββββββββ βββββββββββββββββββ
- API Gateway Pattern: Nginx reverse proxy routes requests to appropriate services
- Database per Service: Each service maintains its own data store
- Stateless Services: JWT tokens for maintaining user state
- File Storage: Cloudinary integration for media uploads
- Node.js - JavaScript runtime environment
- Express.js - Web application framework
- MongoDB - NoSQL database with Mongoose ODM
- JWT - JSON Web Tokens for authentication
- bcryptjs - Password hashing
- Cloudinary - Cloud-based image and video management
- Docker - Application containerization
- Docker Compose - Multi-container orchestration
- Nginx - Reverse proxy and load balancer
- GitHub Actions - CI/CD pipeline
- Jest - Testing framework
- Nodemon - Development auto-restart
- CORS - Cross-origin resource sharing
- dotenv - Environment variable management
git clone https://github.com/Chanuth-silva10/job-founder-microservices-backend-project-app.git
cd job-founder-microservices-backend-project-app
Create .env
files in each service directory or update the existing config.env
files:
# Example configuration (update with your values)
PORT=4002
MONGO_URI=mongodb://localhost:27017/job-founder
JWT_SECRET_KEY=your-super-secret-jwt-key
JWT_EXPIRES=7d
COOKIE_EXPIRE=7
CLOUDINARY_CLIENT_NAME=your-cloudinary-name
CLOUDINARY_CLIENT_API=your-cloudinary-api-key
CLOUDINARY_CLIENT_SECRET=your-cloudinary-secret
FRONTEND_URL=http://localhost:5173
# Build and start all services
docker-compose up --build
# Run in detached mode
docker-compose up -d --build
# Install dependencies for each service
cd user && npm install && cd ..
cd job && npm install && cd ..
cd application && npm install && cd ..
cd blog && npm install && cd ..
# Start each service (in separate terminals)
cd user && npm start
cd job && npm start
cd application && npm start
cd blog && npm start
The application uses Docker Compose for orchestration. The setup includes:
- user: User management service (Port 4002)
- job: Job listing service (Port 4001)
- application: Job application service (Port 4003)
- blog: Blog management service (Port 4004)
- nginx-proxy: Reverse proxy (Port 4000)
# Build all services
docker-compose build
# Start services
docker-compose up
# View logs
docker-compose logs -f [service-name]
# Stop services
docker-compose down
# Remove volumes (careful - deletes data)
docker-compose down -v
Method | Endpoint | Description | Auth Required |
---|---|---|---|
POST | /register |
Register new user | β |
POST | /login |
User login | β |
GET | /logout |
User logout | β |
GET | /getuser |
Get user profile | β |
Method | Endpoint | Description | Auth Required | Role |
---|---|---|---|---|
GET | /getall |
Get all jobs | β | All |
POST | /post |
Create new job | β | Employer |
GET | /getmyjobs |
Get employer's jobs | β | Employer |
PUT | /update/:id |
Update job | β | Employer |
DELETE | /delete/:id |
Delete job | β | Employer |
GET | /:id |
Get single job | β | All |
Method | Endpoint | Description | Auth Required | Role |
---|---|---|---|---|
POST | /post |
Submit application | β | Job Seeker |
GET | /employer/getall |
Get received applications | β | Employer |
GET | /jobseeker/getall |
Get submitted applications | β | Job Seeker |
DELETE | /delete/:id |
Delete application | β | Job Seeker |
Method | Endpoint | Description | Auth Required | Role |
---|---|---|---|---|
GET | /getall |
Get all blogs | β | All |
POST | /post |
Create blog post | β | Employer |
PUT | /update/:id |
Update blog post | β | Employer |
DELETE | /delete/:id |
Delete blog post | β | Employer |
GET | /:id |
Get single blog | β | All |
- Purpose: Authentication, authorization, and user profile management
- Features:
- User registration with email validation
- Secure password hashing with bcrypt
- JWT token generation and validation
- Role-based access (Employer/Job Seeker)
- Database: User profiles, credentials
- Purpose: Job listing management
- Features:
- CRUD operations for job postings
- Job categorization and filtering
- Salary range or fixed salary options
- Job expiration handling
- Database: Job listings, categories, employer references
- Purpose: Job application processing
- Features:
- Resume upload via Cloudinary
- Application submission and tracking
- Employer-applicant matching
- Application status management
- Database: Applications, resumes, applicant-employer relationships
- Purpose: Educational content management
- Features:
- Tech blog creation and management
- Content categorization
- Author attribution
- Rich text support
- Database: Blog posts, authors, categories
- Purpose: API Gateway and load balancing
- Features:
- Request routing to appropriate services
- CORS handling
- Static file serving
- SSL termination ready
Each service requires the following environment variables:
# Server Configuration
PORT=4001 # Service port number
# Database Configuration
MONGO_URI=mongodb://localhost:27017/job-founder # MongoDB connection string
# JWT Configuration
JWT_SECRET_KEY=your-super-secret-key # JWT signing secret
JWT_EXPIRES=7d # Token expiration time
COOKIE_EXPIRE=7 # Cookie expiration (days)
# Cloudinary Configuration (for file uploads)
CLOUDINARY_CLIENT_NAME=your-cloud-name # Cloudinary cloud name
CLOUDINARY_CLIENT_API=your-api-key # Cloudinary API key
CLOUDINARY_CLIENT_SECRET=your-api-secret # Cloudinary API secret
# Frontend Configuration
FRONTEND_URL=http://localhost:5173 # Frontend application URL
- User Service: 4002
- Job Service: 4001
- Application Service: 4003
- Blog Service: 4004
- Nginx Proxy: 4000
- Frontend: 5173 (typical Vite/React setup)
# Run tests for all services
docker-compose exec user npm test
docker-compose exec job npm test
docker-compose exec application npm test
docker-compose exec blog npm test
# Run tests locally
cd user && npm test
cd job && npm test
cd application && npm test
cd blog && npm test
The project includes Jest test suites for:
- β Controller functions
- β Middleware validation
- β Database operations
- β API endpoint testing
job-founder-microservices-backend-project-app/
βββ π user/ # User Service
β βββ π controllers/ # Request handlers
β βββ π models/ # Database schemas
β βββ π routes/ # API routes
β βββ π middlewares/ # Custom middleware
β βββ π database/ # DB connection
β βββ π utils/ # Utility functions
β βββ π config/ # Environment config
β βββ π app.js # Express app setup
β βββ π server.js # Server entry point
β βββ π package.json # Dependencies
β βββ π Dockerfile # Container config
β
βββ π job/ # Job Service
β βββ [Similar structure to user/]
β
βββ π application/ # Application Service
β βββ [Similar structure to user/]
β
βββ π blog/ # Blog Service
β βββ [Similar structure to user/]
β
βββ π proxy/ # Nginx Proxy
β βββ π nginx.conf # Nginx configuration
β βββ π Dockerfile # Nginx container
β
βββ π db/ # MongoDB data (local)
βββ π docker-compose.yml # Multi-container setup
βββ π README.md # Project documentation
Built with β€οΈ by Chanuth Silva
β Star this repo if you find it helpful!