README
CSE Tech Recruitment Server
A Node.js Express server for managing technical recruitment processes with MongoDB database.
Quick Start with Docker
Prerequisites
- Docker and Docker Compose installed on your system
Running the Application
-
Clone and navigate to the project:
git clone <repository-url> cd cse-tech-recruitemnt-server -
Start the services:
docker-compose up -d -
Check the status:
docker-compose ps -
View logs:
docker-compose logs -f -
Stop the services:
docker-compose down
Services
- Application Server:
http://localhost:13001 - MongoDB:
localhost:27017
API Endpoints
GET /- Health checkGET /api/candidates- Get all candidatesPOST /api/candidates- Create new candidateGET /api/candidates/:id- Get candidate by IDPUT /api/candidates/:id- Update candidateDELETE /api/candidates/:id- Delete candidate
Development without Docker
-
Install dependencies:
npm install -
Set up environment:
cp env.example .env # Edit .env with your configuration -
Start MongoDB (required):
# Make sure MongoDB is running on localhost:27017 -
Run the server:
npm start
Environment Variables
PORT- Server port (default: 3000)NODE_ENV- Environment (development/production)MONGODB_URI- MongoDB connection string
Docker Volumes
mongo_data- Persistent MongoDB data./public:/app/public- Shared public files directory
Health Checks
The application includes a health check that runs every 30 seconds to ensure the service is responsive.
Database Schema
The MongoDB database includes a candidates collection with validation for:
name(required)email(required, unique)phone(optional)skills(optional array)experience(optional number)status(optional enum)createdAt/updatedAttimestamps