An intelligent job recommendation system that provides location-based job search with personalized recommendations, built with Java, MySQL, Redis, and modern web technologies.
- Features
- Architecture
- Prerequisites
- Installation
- Configuration
- Usage
- API Documentation
- Development
- Testing
- Deployment
- Contributing
- License
- π Location-Based Search: Find jobs near any geographic location
- β Smart Favorites: Save and manage favorite job listings
- π Keyword Extraction: Automatic job keyword extraction using AI
- π Personalized Recommendations: AI-powered job recommendations
- β‘ Redis Caching: High-performance caching for improved response times
- π Secure Authentication: MD5-hashed passwords with session management
- π‘οΈ Input Validation: Comprehensive input sanitization and validation
- π Structured Logging: Centralized logging with multiple levels
- βοΈ Environment Configuration: Flexible configuration management
- π¦ Error Handling: Structured exception handling with user-friendly messages
- π» Responsive Web Interface: Modern, mobile-friendly UI
- π Real-time Updates: Dynamic content loading with AJAX
- π± Cross-platform Compatibility: Works on desktop, tablet, and mobile
- π¨ Professional Design: Clean, intuitive user interface
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β Frontend β β Backend β β External APIs β
β β β β β β
β β’ HTML/CSS/JS βββββΊβ β’ Java Servlets βββββΊβ β’ SerpAPI β
β β’ Bootstrap β β β’ REST APIs β β β’ EdenAI β
β β’ AJAX β β β’ Business Logicβ β β’ GeoConverter β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β
βΌ
βββββββββββββββββββ βββββββββββββββββββ
β Data Layer β β Cache β
β β β β
β β’ MySQL DB βββββΊβ β’ Redis β
β β’ Connection β β β’ Session Store β
β Pooling β β β’ Search Cache β
βββββββββββββββββββ βββββββββββββββββββ
Backend:
- Java 11+ with Servlet API
- Maven for dependency management
- MySQL 8.0+ for data persistence
- Redis for caching and session management
Frontend:
- HTML5, CSS3, JavaScript (ES6+)
- Bootstrap for responsive design
- AJAX for asynchronous communication
External Services:
- SerpAPI: Google Jobs search integration
- EdenAI: AI-powered keyword extraction
- GeoConverter: Coordinate to location code conversion
Development & Deployment:
- JUnit 5 for unit testing
- Apache Tomcat 9+ as servlet container
- Environment-based configuration
- Comprehensive logging system
Before you begin, ensure you have the following installed:
- Java Development Kit (JDK) 11 or higher
- Apache Maven 3.6+
- MySQL 8.0+
- Redis 6.0+
- Apache Tomcat 9.0+
- SerpAPI Key: Get your key here
- EdenAI Key: Get your key here
git clone https://github.com/your-username/job-recommendation-system.git
cd job-recommendation-system# Start MySQL server
# Create database and user
mysql -u root -p
# Run the initialization script
mysql -u root -p < scripts/init-database.sql# Start Redis server
redis-server
# Test Redis connection
redis-cli pingRun the setup script to configure environment variables:
# Windows
scripts\setup-env.bat
# Or manually set environment variables:
set DB_HOST=localhost
set DB_PORT=3306
set DB_NAME=jobrec
set DB_USERNAME=admin
set DB_PASSWORD=your_password
set REDIS_HOST=localhost
set REDIS_PORT=6379
set REDIS_PASSWORD=your_redis_password
set SERPAPI_KEY=your_serpapi_key
set EDENAI_KEY=your_edenai_key
set APP_ENVIRONMENT=devmvn clean compile package# Copy WAR file to Tomcat webapps directory
cp target/JobSearch-1.0-SNAPSHOT.war $TOMCAT_HOME/webapps/jobrec.war
# Start Tomcat
$TOMCAT_HOME/bin/startup.sh # Linux/Mac
# or
%TOMCAT_HOME%\bin\startup.bat # WindowsThe application supports environment-specific configuration:
application.properties- Default configurationapplication-dev.properties- Development environmentapplication-prod.properties- Production environment
# Database Configuration
db.host=localhost
db.port=3306
db.name=jobrec
db.username=admin
# Redis Configuration
redis.host=localhost
redis.port=6379
redis.ttl=60
# Search Configuration
search.default.keyword=engineer
search.results.limit=20
search.cache.enabled=true
# Logging Configuration
logging.level=INFO
logging.file.enabled=true
logging.console.enabled=true-
Access the Application: Navigate to
http://localhost:8080/jobrec -
User Registration:
- Click "New User? Register"
- Fill in username, password, first name, and last name
- Click "Register"
-
Login:
- Enter your username and password
- Click "Login"
-
Search for Jobs:
- The system will use your browser's geolocation
- Browse nearby job listings
- Use the search functionality for specific keywords
-
Manage Favorites:
- Click the heart icon to favorite/unfavorite jobs
- View your favorites in the "My Favorites" section
-
Get Recommendations:
- Click "Recommendation" to see personalized job suggestions
- Recommendations are based on your favorite jobs and keywords
The database comes with pre-configured test users:
| Username | Password | Description |
|---|---|---|
admin |
password123 |
Administrator account |
john_doe |
password123 |
Sample user with favorites |
jane_smith |
password123 |
Sample user with applications |
test_user |
password123 |
Basic test user |
Authenticate user and create session.
Request:
{
"user_id": "john_doe",
"password": "password123"
}Response:
{
"result": "SUCCESS",
"name": "John Doe"
}Register a new user account.
Request:
{
"user_id": "new_user",
"password": "secure_password",
"first_name": "John",
"last_name": "Doe"
}Response:
{
"result": "Registration successful"
}Logout user and invalidate session.
Response:
{
"result": "Logout successful"
}Search for jobs based on location and keywords.
Parameters:
user_id(required): User identifierlat(required): Latitude coordinatelon(required): Longitude coordinatekeyword(optional): Search keyword
Example:
GET /search?user_id=john_doe&lat=37.7749&lon=-122.4194&keyword=software engineer
Response:
[
{
"id": "job_12345",
"title": "Senior Software Engineer",
"company_name": "TechCorp Inc.",
"location": "San Francisco, CA",
"description": "Develop and maintain web applications...",
"url": "https://example.com/job/12345",
"keywords": ["Java", "Spring Boot", "REST API"],
"favorite": false
}
]Add or remove job from favorites.
Request:
{
"user_id": "john_doe",
"favorite": [
{
"item_id": "job_12345",
"favorite": true
}
]
}Response:
{
"result": "SUCCESS"
}Get user's favorite jobs.
Parameters:
user_id(required): User identifier
Response:
[
{
"id": "job_12345",
"title": "Senior Software Engineer",
"company_name": "TechCorp Inc.",
"location": "San Francisco, CA",
"url": "https://example.com/job/12345",
"keywords": ["Java", "Spring Boot"],
"favorite": true
}
]Get personalized job recommendations.
Parameters:
user_id(required): User identifierlat(required): Latitude coordinatelon(required): Longitude coordinate
Response:
[
{
"id": "job_67890",
"title": "Java Developer",
"company_name": "DevCorp",
"location": "San Francisco, CA",
"description": "Work with Java and Spring framework...",
"url": "https://example.com/job/67890",
"keywords": ["Java", "Spring"],
"favorite": false
}
]job-recommendation-system/
βββ Source Code/
β βββ Backend/
β β βββ config/ # Configuration management
β β βββ db/ # Database connections
β β βββ entity/ # Data models
β β βββ exception/ # Custom exceptions
β β βββ external/ # External API clients
β β βββ recommendation/ # Recommendation algorithms
β β βββ servlet/ # HTTP request handlers
β β βββ test/ # Unit tests
β β βββ util/ # Utility classes
β βββ Frontend/
β β βββ scripts/ # JavaScript files
β β βββ styles/ # CSS files
β β βββ WEB-INF/ # Web configuration
β β βββ index.jsp # Main page
β βββ resources/ # Configuration files
βββ scripts/ # Setup and deployment scripts
βββ pom.xml # Maven configuration
βββ README.md # This file
- Java: Follow Oracle Java Code Conventions
- Comments: Use English for all code comments and documentation
- Naming: Use descriptive names for classes, methods, and variables
- Error Handling: Use structured exception handling with proper logging
- Security: Validate and sanitize all user inputs
-
Create Feature Branch:
git checkout -b feature/new-feature-name
-
Implement Feature:
- Add necessary classes in appropriate packages
- Include comprehensive error handling
- Add logging statements
- Write unit tests
-
Test Thoroughly:
mvn test -
Submit Pull Request:
- Include description of changes
- Reference any related issues
- Ensure all tests pass
# Run all tests
mvn test
# Run specific test class
mvn test -Dtest=ValidationUtilTest
# Run tests with coverage
mvn test jacoco:report- Unit Tests: Test individual components in isolation
- Integration Tests: Test component interactions
- API Tests: Test HTTP endpoints
- Database Tests: Test database operations
The application includes comprehensive test data:
- Sample users with different roles
- Mock job listings with various attributes
- Test scenarios for edge cases
-
Configure Environment:
export APP_ENVIRONMENT=dev -
Start Services:
# Start MySQL sudo systemctl start mysql # Start Redis sudo systemctl start redis # Deploy to Tomcat mvn clean package cp target/*.war $TOMCAT_HOME/webapps/
-
Environment Setup:
export APP_ENVIRONMENT=prod export DB_HOST=your-production-db-host export REDIS_HOST=your-production-redis-host # Set other production environment variables
-
Security Configuration:
- Use strong passwords for all accounts
- Configure SSL/TLS certificates
- Set up firewall rules
- Enable database encryption
-
Performance Optimization:
- Configure connection pooling
- Set appropriate cache TTL values
- Monitor system resources
- Set up load balancing if needed
-
Monitoring:
- Configure application logs
- Set up health checks
- Monitor database performance
- Track API response times
# Dockerfile example
FROM tomcat:9.0-jdk11-openjdk
# Copy WAR file
COPY target/JobSearch-1.0-SNAPSHOT.war /usr/local/tomcat/webapps/jobrec.war
# Set environment variables
ENV DB_HOST=localhost
ENV REDIS_HOST=localhost
# Expose port
EXPOSE 8080
# Start Tomcat
CMD ["catalina.sh", "run"]We welcome contributions! Please follow these guidelines:
- Fork the Repository
- Create Feature Branch:
git checkout -b feature/amazing-feature - Commit Changes:
git commit -m 'Add amazing feature' - Push to Branch:
git push origin feature/amazing-feature - Open Pull Request
- Follow existing code style and conventions
- Add tests for new functionality
- Update documentation as needed
- Ensure all tests pass
- Write clear commit messages
When reporting bugs, please include:
- Detailed description of the issue
- Steps to reproduce
- Expected vs actual behavior
- Environment information
- Error logs if applicable
This project is licensed under the MIT License - see the LICENSE file for details.
- SerpAPI for providing job search data
- EdenAI for AI-powered keyword extraction
- Bootstrap for responsive UI components
- Apache Tomcat for servlet container
- MySQL for reliable data storage
- Redis for high-performance caching
Made with β€οΈ by Leo Ji
Last updated: December 2024