Career Navigator is a web application that helps users navigate their career paths through mentorship, job recommendations, and skill development resources.
- Java 17
- Spring Boot 4.0.0
- Spring Security with JWT authentication
- Spring Data JPA with PostgreSQL
- Spring Mail for email notifications
- Maven for dependency management
- Lombok for reducing boilerplate code
- User registration and authentication with JWT
- Email verification system
- Role-based access control (USER, ADMIN)
- Mentor management and reviews
- Job listings and recommendations
- User profile management
- CORS support for frontend integration
Before running the application, ensure you have:
- Java 17 or higher
- Maven 3.6+
- PostgreSQL 12+
- Gmail account (for email functionality)
backend/
├── src/
│ ├── main/
│ │ ├── java/dev/mathalama/careernavigator/
│ │ │ ├── config/ # Security and application configuration
│ │ │ ├── controller/ # REST API endpoints
│ │ │ ├── dto/ # Data Transfer Objects
│ │ │ ├── entity/ # JPA entities
│ │ │ ├── exception/ # Global exception handling
│ │ │ ├── repository/ # Database repositories
│ │ │ └── service/ # Business logic
│ │ └── resources/
│ │ └── application.properties
│ └── test/ # Test files
├── .env # Environment variables (not in repo)
├── pom.xml # Maven dependencies
└── README.md
git clone https://github.com/mathalama/career-navigator-api.git
cd career-navigator/backendCreate a new database:
CREATE DATABASE career_navigator_db;Or use Docker:
docker run --name career-nav-postgres -e POSTGRES_PASSWORD=postgres -e POSTGRES_DB=career_navigator_db -p 5432:5432 -d postgres:15Create a .env file in the backend root directory:
# Database Configuration
DATABASE_URL=jdbc:postgresql://localhost:5432/your_database
DATABASE_USERNAME=username
DATABASE_PASSWORD=password
# JWT Configuration
JWT_TOKEN=your-secret-key-here-minimum-32-characters-long
# Mail Configuration (Gmail)
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_EMAIL=your-email@gmail.com
MAIL_PASSWORD=your-app-password
# Application URLs
APP_BASE_URL=http://localhost:8080
FRONTEND_URL=http://localhost:5173
# CORS Configuration
CORS_ALLOWED_ORIGINS=http://localhost:5173,http://localhost:3000Note: For Gmail, you need to create an App Password instead of using your regular password.
mvnw clean installOr on Unix/Mac:
./mvnw clean installUsing Maven:
mvnw spring-boot:runOr on Unix/Mac:
./mvnw spring-boot:runThe application will start on http://localhost:8080
Check if the server is running:
curl http://localhost:8080/api/auth/verify-email?token=testYou should receive a response indicating the token is invalid (which is expected).
POST /api/auth/register- Register new userPOST /api/auth/login- Login userGET /api/auth/verify-email?token=- Verify emailPOST /api/auth/resend-verification- Resend verification email
GET /api/profile/me- Get current user profilePUT /api/profile/me- Update user profile
GET /api/jobs- Get all jobsGET /api/jobs/{id}- Get job by ID
GET /api/mentors- Get all mentorsGET /api/mentors/{id}- Get mentor by ID
GET /api/reviews/mentor/{mentorId}- Get reviews for mentorPOST /api/reviews- Create review (authenticated)PUT /api/reviews/{id}- Update review (authenticated)DELETE /api/reviews/{id}- Delete review (authenticated)
GET /api/admin/users- Get all usersDELETE /api/admin/users/{id}- Delete user
mvnw testmvnw clean packageThe JAR file will be created in the target/ directory.
java -jar target/career-navigator-0.0.1-SNAPSHOT.jarKey configuration properties in application.properties:
- Database: JPA with Hibernate auto-update enabled
- JWT: Token expiration set to 24 hours
- Mail: SMTP with TLS enabled
- CORS: Configurable allowed origins
- Security: Public endpoints for auth and mentor reviews
- Passwords are encrypted using BCrypt
- JWT tokens for stateless authentication
- CSRF protection disabled (JWT-based API)
- Role-based authorization (USER, ADMIN)
- Email verification required for new accounts
- Check PostgreSQL is running:
psql -U postgres - Verify database exists:
\lin psql - Check connection string in
.env
- Verify Gmail App Password is correct
- Check SMTP settings in
.env - Ensure "Less secure app access" or App Passwords enabled
- Ensure JWT_TOKEN in
.envis at least 32 characters - Token expires after 24 hours
| Variable | Description | Example |
|---|---|---|
| DATABASE_URL | PostgreSQL JDBC URL | jdbc:postgresql://localhost:5432/your_database |
| DATABASE_USERNAME | Database username | postgres |
| DATABASE_PASSWORD | Database password | postgres |
| JWT_TOKEN | Secret key for JWT signing (min 32 chars) | your-secure-secret-key-here |
| MAIL_HOST | SMTP server host | smtp.gmail.com |
| MAIL_PORT | SMTP server port | 587 |
| MAIL_EMAIL | Sender email address | your-email@gmail.com |
| MAIL_PASSWORD | Email password or app password | your-app-password |
| APP_BASE_URL | Backend base URL | http://localhost:8080 |
| FRONTEND_URL | Frontend application URL | http://localhost:5173 |
| CORS_ALLOWED_ORIGINS | Allowed CORS origins (comma-separated) | http://localhost:5173,http://localhost:3000 |
This is an educational project.
For questions or issues, please contact the development team.