Earnily is a robust API for building job-seeking and employment platforms. It provides endpoints for user authentication, job postings, applications, company management, reviews, and more. Built with Node.js, Express, and MongoDB, it supports modern workflows for both employers and jobseekers.
- Features
- Getting Started
- Environment Variables
- API Endpoints
- Technologies Used
- Testing
- API Documentation
- Contributing
- Author
- License
- User registration, login, and authentication (JWT)
- Email verification and password reset via OTP
- Employer and jobseeker roles
- Company creation and management
- Job posting, updating, and deletion (employers)
- Job search and filtering
- Job application with resume and attachments (jobseekers)
- Application status updates (employers)
- Skill and category management
- Company, job, and user reviews
- File uploads to Azure Blob Storage
- Rate limiting and security best practices
-
Clone the repository:
git clone https://github.com/ezeisraeljohn/earnily.git cd earnily
-
Install dependencies:
npm install
-
Set up environment variables:
Create a.env
file in the root directory and add the required variables (see Environment Variables). -
Start the server:
npm start
The server will run on
http://localhost:3000
by default.
Create a .env
file in the root directory and configure the following:
SECRET=your_jwt_secret
PORT=3000
Test_MONGO_URI=mongodb://localhost:27017/earnily
T_Mongo_URI=mongodb://localhost:27017/test_earnily
AZURE_STORAGE_CONNECTION_STRING=your_azure_blob_connection_string
IPINFO_URL=https://ipinfo.io
IPINFO_TOKEN=your_ipinfo_token
EARNILY_LOGO_URL=https://yourdomain.com/logo.png
Below is a summary of the main endpoints. For full details, see API Documentation.
POST /api/v1/register
— Register a new userPOST /api/v1/login
— Login and receive a JWTPOST /api/v1/verify-email
— Verify user email with OTPPOST /api/v1/resend-otp
— Resend email verification OTPPOST /api/v1/password-reset
— Request password reset OTPPOST /api/v1/password-reset/verify
— Verify password reset OTPPOST /api/v1/password-reset/complete
— Complete password reset
GET /api/v1/user/:userId
— Get user profilePUT /api/v1/user/:userId
— Update user profileDELETE /api/v1/user/:userId
— Delete user
POST /api/v1/company
— Create a company (employer only)GET /api/v1/company/:companyId
— Get company detailsPUT /api/v1/company/:companyId
— Update companyDELETE /api/v1/company/:companyId
— Delete company
POST /api/v1/jobs
— Create a job (employer only)GET /api/v1/jobs
— List all jobs (with filters)GET /api/v1/jobs/:id
— Get job by IDPUT /api/v1/jobs/:id
— Update a job (employer only)DELETE /api/v1/jobs/:id
— Delete a job (employer only)GET /api/v1/jobs/me
— List jobs posted by the authenticated employer
POST /api/v1/job/:jobId/apply
— Apply for a job (jobseeker only)GET /api/v1/job/:jobId/applications
— Get applications for a job (employer only)GET /api/v1/applications
— Get applications submitted by the user (jobseeker only)PUT /api/v1/applications/:id
— Update application status (employer only)
POST /api/v1/jobs/:jobId/reviews
— Review a job (jobseeker only)GET /api/v1/jobs/:jobId/reviews
— Get all reviews for a jobPOST /api/v1/company/:companyId/reviews
— Review a company (jobseeker only)GET /api/v1/company/:companyId/reviews
— Get all reviews for a companyPOST /api/v1/user/:userId/reviews
— Review a user (employer only)
GET /api/v1/skills
— List all skillsGET /api/v1/job-categories
— List all job categories
- Node.js & Express.js
- MongoDB & Mongoose
- Azure Blob Storage (file uploads)
- JWT Authentication
- bcrypt (password hashing)
- CORS, rate limiting, and security middleware
- Jest & Supertest (testing)
To run the test suite:
npm test
Tests cover authentication, job posting, applications, and more.
Interactive API documentation is available via Postman:
Or view the full API documentation here.
Contributions are welcome! Please fork the repository and submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.