A RESTful API for job applications where companies can post jobs and applicants can browse and apply for positions.
- User Authentication: JWT-based authentication with role-based access control
- Company Features: Create, update, delete job postings; view applications
- Applicant Features: Browse jobs, apply with resume upload, track applications
- File Upload: Resume upload to Cloudinary
- Pagination: All list endpoints support pagination
- Search & Filtering: Job search with title, location, and company filters
- Backend: Go with Gin framework
- Database: PostgreSQL with GORM
- Authentication: JWT tokens
- File Storage: Cloudinary
- Cache: Redis
- Deployment: AWS Lambda support
- Go 1.23+
- PostgreSQL database
- Redis (optional, for caching)
- Cloudinary account for file uploads
Create a .env file with the following variables:
# Database
DATABASE_URL=postgresql://username:password@host:port/database?sslmode=require
# JWT
JWT_SECRETE_KEY=your_jwt_secret_key
# Cloudinary
Cloud_api_key=your_cloudinary_api_key
Cloud_api_secret=your_cloudinary_api_secret
Cloud_api_name=your_cloudinary_cloud_name
# Redis (optional)
REDIS_ADDR=localhost:6379
REDIS_PASSWORD=your_redis_password
# Email (for password reset)
Mail_TRAP_API_KEY=your_mailtrap_api_key
# Google OAuth (optional)
GOOGLE_KEY=your_google_client_id
GOOGLE_SECRET=your_google_client_secret
Google_Callback=your_google_callback_url
# AI Integration (optional)
GROQ_API_KEY=your_groq_api_key- Clone the repository:
git clone <repository-url>
cd job-application-api- Install dependencies:
go mod download-
Set up your environment variables in
.envfile -
Run the application:
go run cmd/main.goThe server will start on port 8080 by default.
POST /auth/register- User registration (company or applicant)POST /auth/login- User loginGET /auth/logout- User logoutPOST /auth/forget-password- Request password resetPOST /auth/forget-password/:token- Reset password
POST /jobs- Create job (Company only)GET /jobs/:id- Get job details (All authenticated users)PUT /jobs/:id- Update job (Company only, own jobs)DELETE /jobs/:id- Delete job (Company only, own jobs)GET /jobs/company/my-jobs- Get company's jobs (Company only)GET /jobs/browse- Browse jobs with filters (Applicant only)
POST /applications- Apply for job with resume upload (Applicant only)GET /applications/my-applications- Get applicant's applications (Applicant only)GET /applications/job/:jobId- Get job applications (Company only, own jobs)PUT /applications/:id/status- Update application status (Company only)
GET /users- Get all users (Admin only)GET /users/:id- Get user by ID (Admin only)POST /users- Create user (Admin only)PUT /users/:id- Update user (Admin only)DELETE /users/:id- Delete user (Admin only)
GET /me- Get current user profilePATCH /me- Update current user profileDELETE /me- Delete current user profile
{
"success": boolean,
"message": "string",
"object": object,
"errors": ["string"] | null
}{
"success": boolean,
"message": "string",
"object": [objects],
"pageNumber": number,
"pageSize": number,
"totalSize": number,
"errors": ["string"] | null
}- APPLICANT: Can browse jobs, apply for positions, track applications
- COMPANY: Can create/manage job postings, view applications, update application status
- ADMIN: Full system access (user management)
- Name: Required, alphabets only
- Email: Required, valid email format, unique
- Password: Required, minimum 8 characters, must contain uppercase, lowercase, number, and special character
- Role: Required, must be "APPLICANT" or "COMPANY"
- Title: Required, 1-100 characters
- Description: Required, 20-2000 characters
- Location: Optional
- Resume: Required PDF file
- Cover Letter: Optional, maximum 200 characters
- One application per job per applicant
Resume files are uploaded to Cloudinary and must be in PDF format. The API returns a secure URL for the uploaded file.
- JWT-based authentication
- Role-based access control
- Password hashing with bcrypt
- Input validation and sanitization
- CORS protection
- XSS protection middleware
- ID (UUID, Primary Key)
- Name (String)
- Email (String, Unique)
- Password (String, Hashed)
- Role (Enum: APPLICANT, COMPANY, ADMIN)
- CreatedAt, UpdatedAt (Timestamps)
- ID (UUID, Primary Key)
- Title (String)
- Description (String)
- Location (String)
- CreatedBy (UUID, Foreign Key to Users)
- CreatedAt, UpdatedAt (Timestamps)
- ID (UUID, Primary Key)
- ApplicantId (UUID, Foreign Key to Users)
- JobId (UUID, Foreign Key to Jobs)
- ResumeLink (String, Cloudinary URL)
- CoverLetter (String, Optional)
- Status (Enum: Applied, Reviewed, Interview, Rejected, Hired)
- AppliedAt (Timestamp)
The project includes comprehensive unit tests for controllers, use cases, and repositories. Run tests with:
go test ./...The application supports deployment to AWS Lambda. Build and deploy using the provided Dockerfile or deploy directly to Lambda using the AWS CLI.
- Go with Gin: High performance, excellent for REST APIs
- GORM: Powerful ORM with good PostgreSQL support
- JWT: Stateless authentication, scalable
- Cloudinary: Reliable file storage with CDN
- PostgreSQL: Robust relational database with UUID support
- Redis: Fast caching for session management
- Clean Architecture: Separation of concerns, testable, maintainable
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Ensure all tests pass
- Submit a pull request
This project is licensed under the MIT License.