A full-stack web application for connecting employers with employees. Employers can post job opportunities, and employees can browse and apply for jobs.
- Java 17 with Javalin (lightweight web framework)
- Hibernate ORM for database operations
- MySQL database
- JWT (JSON Web Tokens) for authentication
- BCrypt for password hashing
- Maven for dependency management
- React 18 with functional components and hooks
- React Router for navigation
- Axios for API calls
- CSS for styling
job-platform/
βββ backend/
β βββ src/
β β βββ main/
β β β βββ java/com/jobplatform/
β β β β βββ controller/ # API controllers
β β β β βββ dao/ # Data Access Objects
β β β β βββ dto/ # Data Transfer Objects
β β β β βββ model/ # Entity models
β β β β βββ util/ # Utility classes
β β β β βββ App.java # Main application
β β β βββ resources/
β β β βββ hibernate.cfg.xml
β β β βββ schema.sql
β βββ pom.xml
βββ frontend/
βββ public/
βββ src/
β βββ components/ # Reusable components
β βββ context/ # React context
β βββ pages/ # Page components
β βββ services/ # API services
β βββ App.js
β βββ index.js
βββ package.json
- Java 17 or higher
- Maven 3.6+
- MySQL 8.0+
- Node.js 16+ and npm
-
Start your MySQL server
-
Create the database:
CREATE DATABASE job_platform_db;-
Run the schema script located at
backend/src/main/resources/schema.sqlor let Hibernate create the tables automatically. -
Update database credentials in
backend/src/main/resources/hibernate.cfg.xml:
<property name="hibernate.connection.username">your_username</property>
<property name="hibernate.connection.password">your_password</property>- Navigate to the backend directory:
cd backend- Install dependencies and build:
mvn clean install- Run the application:
mvn exec:java -Dexec.mainClass="com.jobplatform.App"The backend server will start on http://localhost:7070
- Navigate to the frontend directory:
cd frontend- Install dependencies:
npm install- Start the development server:
npm startThe frontend will start on http://localhost:3000
POST /api/auth/register
Content-Type: application/json
{
"name": "John Doe",
"email": "john@example.com",
"password": "password123",
"role": "EMPLOYEE" // or "EMPLOYER"
}
Response: 201 Created
{
"token": "jwt-token",
"userId": 1,
"name": "John Doe",
"email": "john@example.com",
"role": "EMPLOYEE"
}POST /api/auth/login
Content-Type: application/json
{
"email": "john@example.com",
"password": "password123"
}
Response: 200 OK
{
"token": "jwt-token",
"userId": 1,
"name": "John Doe",
"email": "john@example.com",
"role": "EMPLOYEE"
}GET /api/jobs
Response: 200 OK
[
{
"id": 1,
"title": "Software Developer",
"description": "Looking for a skilled developer...",
"pay": 75000.00,
"location": "New York, NY",
"category": "Technology",
"status": "OPEN",
"employerId": 2,
"employerName": "Tech Company",
"employerEmail": "company@example.com",
"createdAt": "2025-10-05T10:00:00"
}
]GET /api/jobs/{id}
Response: 200 OK
{
"id": 1,
"title": "Software Developer",
...
}POST /api/jobs
Authorization: Bearer {token}
Content-Type: application/json
{
"title": "Software Developer",
"description": "Looking for a skilled developer...",
"pay": 75000.00,
"location": "New York, NY",
"category": "Technology"
}
Response: 201 Created
{
"id": 1,
"title": "Software Developer",
...
}PUT /api/jobs/{id}/assign
Authorization: Bearer {token}
Response: 200 OK
{
"id": 1,
"status": "ASSIGNED",
...
}GET /api/users/{id}/jobs
Authorization: Bearer {token}
Response: 200 OK
[
// For employers: jobs they posted
// For employees: jobs they applied to
]- β Register and login as an employer
- β Post new job opportunities with details
- β View all posted jobs
- β Track job status (Open, Assigned, Completed)
- β Register and login as an employee
- β Browse all available jobs
- β View detailed job information
- β Apply for jobs
- β View applied jobs in dashboard
- β JWT-based authentication
- β Password hashing with BCrypt
- β Protected API routes
- β Role-based access control
id(BIGINT, PK, AUTO_INCREMENT)name(VARCHAR(100))email(VARCHAR(100), UNIQUE)password(VARCHAR(255))role(ENUM: 'EMPLOYER', 'EMPLOYEE')created_at(TIMESTAMP)
id(BIGINT, PK, AUTO_INCREMENT)title(VARCHAR(200))description(TEXT)pay(DECIMAL(10,2))location(VARCHAR(200))category(VARCHAR(100))employer_id(BIGINT, FK β users.id)status(ENUM: 'OPEN', 'ASSIGNED', 'COMPLETED')created_at(TIMESTAMP)
id(BIGINT, PK, AUTO_INCREMENT)job_id(BIGINT, FK β jobs.id)employee_id(BIGINT, FK β users.id)status(ENUM: 'PENDING', 'ACCEPTED', 'COMPLETED')applied_at(TIMESTAMP)
- Port: 7070 (can be changed in
App.java) - JWT Secret: Change in
JWTUtil.javafor production - Database: Configure in
hibernate.cfg.xml
- API Base URL: Set in
src/services/api.js - Port: 3000 (default React port)
- Start both backend and frontend servers
- Navigate to
http://localhost:3000 - Register as an employer and post some jobs
- Register as an employee and apply for jobs
- Check the dashboards to see posted/applied jobs
- Register with role "EMPLOYER"
- Login to your account
- Go to Dashboard
- Click "Post New Job"
- Fill in job details and submit
- View your posted jobs in the dashboard
- Register with role "EMPLOYEE"
- Login to your account
- Browse jobs from the Jobs page
- Click on a job to view details
- Click "Apply Now" to apply
- View applied jobs in your dashboard
- Change the JWT secret key in
JWTUtil.java - Use environment variables for sensitive data
- Enable HTTPS
- Implement rate limiting
- Add input validation and sanitization
- Use proper error handling
- Implement refresh tokens
- Add CSRF protection
- Port already in use: Change the port in
App.java - Database connection failed: Check MySQL credentials in
hibernate.cfg.xml - Hibernate errors: Ensure database tables are created
- API calls failing: Check if backend is running on port 7070
- CORS errors: Ensure CORS is enabled in Javalin configuration
- Login not working: Check JWT token is being stored in localStorage
This project is open source and available for educational purposes.
Built as a demonstration of a full-stack Java + React application.