Skip to content

A Spring Boot web application that collects and processes job offers for Junior Java Developers from multiple external sources. It features REST APIs, MongoDB, Redis, Docker, and a full testing setup with JUnit, Mockito, and Testcontainers.

Notifications You must be signed in to change notification settings

Senegalion/JobOffers

Repository files navigation

JobOffers for Junior Java Developers

License: MIT

JobOffers is a web application designed to aggregate job offers specifically for Junior Java Developers from various online sources. The primary goal is to provide a centralized platform with up-to-date job listings from diverse websites and applications, simplifying the job search process.

Video Demo: https://www.youtube.com/watch?v=odNjBvRsTFs

Project Description

This application automates the collection of job offers, ensuring that Junior Java Developers have access to the latest opportunities in their field. It features robust backend services for data retrieval, storage, and management, along with API endpoints for seamless integration.

This project uses a modular monolithic application architecture with elements of hexagonal principles.

🔗 Live Demo: live-demo

Hosted on AWS (EC2 + ECR) with full Docker-based deployment.

Features

  • Automated Job Offer Aggregation: Fetches job listings from multiple websites and applications.
  • Junior Java Developer Focus: Tailored job offers relevant to entry-level Java developers.
  • RESTful API: Provides endpoints for accessing and managing job offer data.
  • Data Storage: Utilizes MongoDB for efficient data storage and retrieval.
  • Filtering and Search: Enables users to filter and search job offers based on various criteria.
  • Security: Implements JWT authentication for secure access to API endpoints.
  • Scheduling: Uses Spring Scheduler for periodic job offer updates.
  • Caching: Redis integration for improved performance and reduced database load.
  • Containerization: Docker and Docker Compose for easy deployment and scalability.
  • Live Demo: Deployed on AWS EC2 with Dockerized setup. Publicly accessible demo for showcasing features.
  • React Frontend (WIP): Frontend integration in progress using React to enhance user experience.

Architecture

Architecture Diagram

  • The C3 diagram above presents main application components and module dependencies.

Tech

JobOffers is developed using the following technologies:

Core:

Backend Spring Boot Java
Spring Boot (REST Controllers, Test, Data MongoDB, Validation, Security, JWT, Spring Scheduler)
Database MongoDB MongoExpress
MongoDB, MongoExpress
Containerization Docker Docker Compose Docker Desktop
Docker, Docker Compose, Docker Desktop
Testing JUnit5 Mockito AssertJ
Wiremock, Testcontainers, MockMvc, Awaitility, JUnit5, Mockito, AssertJ, SpringBootTest, SpringSecurityTest
Logging Log4j2
Log4j2
Networking RestTemplate JSON HTTP
RestTemplate, JSON, HTTP
Utilities Lombok Redis Jedis
Lombok, Redis (Jedis, Redis-Commander)
Build Tool Maven
Maven
Version Control Git GitHub / GitLab
Git, GitHub/GitLab
IDE IntelliJ Ultimate
API Documentation Swagger
Swagger
CI/CD Jenkins
Jenkins
Project Management SCRUM Jira
SCRUM, Jira
Dev. Practices Code Review, Pair Programming
Frontend React
React (basic UI integration – WIP)
Hosting AWS EC2 AWS ECR Security Groups
AWS EC2, Amazon ECR, IAM Roles, Security Groups configuration

Installation and Setup

  1. Clone the Repository:

    git clone [https://github.com/Senegalion/JobOffers.git](https://github.com/Senegalion/JobOffers.git)
  2. Navigate to the Project Directory:

    cd JobOffers
  3. Build and Run with Docker Compose:

    docker-compose up --build

    This will start the application, MongoDB, MongoExpress, and Redis using Docker containers.

  4. Configuration:

    • Environment variables are managed within the docker-compose.yml file.
    • Adjust configurations for MongoDB, Redis, and other services as needed.
  5. Access the Application:

    • The application will be accessible at http://localhost:8082.
    • MongoExpress will be accessible at http://localhost:8081.
      • Note: MongoExpress requires login. Use admin as username and pass as password.
    • Redis commander is accessible at http://localhost:8083
    • Swagger UI will be accessible at http://localhost:8082/swagger-ui/index.html

Usage

  • Use the provided REST API endpoints to access and manage job offer data.
  • Utilize Swagger UI for API documentation and testing.
  • Monitor the application and database using MongoExpress and Redis Commander.

API Endpoints

Registration

POST /register

Registers a new user.

Request Body Example:

{
  "username": "newuser",
  "password": "password123"
}

Response:

{
  "userId": "user-id",
  "wasCreated": true,
  "username": "newuser"
}

Authentication (Login)

POST /token

Authenticates a user and generates a JWT token.

Request Body Example:

{
  "username": "newuser",
  "password": "password123"
}

Response:

{
  "username": "newuser",
  "token": "generated-jwt-token"
}

Job Offer Endpoints (Requires Authentication)

Note: The following endpoints require a valid JWT token in the Authorization header.

Get All Job Offers

GET /offers

Retrieves all available job offers.

Response:

[
  {
    "offerId": "offer-id",
    "title": "Junior Java Developer",
    "company": "Company Name",
    "location": "Location",
    "description": "Job description here...",
    "url": "[http://job-offer-link.com](http://job-offer-link.com)"
  }
]

Get Job Offer by ID

GET /offers/{offerId}

Retrieves details of a job offer by its ID.

Response:

[
  {
    "offerId": "offer-id",
    "title": "Junior Java Developer",
    "company": "Company Name",
    "location": "Location",
    "description": "Job description here...",
    "url": "[http://job-offer-link.com](http://job-offer-link.com)"
  }
]

Add a New Job Offer

POST /offers

Retrieves details of a job offer by its ID.

Request Body Example:

[
  {
    "title": "Junior Java Developer",
    "company": "Company Name",
    "location": "Location",
    "description": "Job description here...",
    "url": "[http://job-offer-link.com](http://job-offer-link.com)"
  }
]

Response:

[
  {
    "offerId": "new-offer-id",
    "title": "Junior Java Developer",
    "company": "Company Name",
    "location": "Location",
    "description": "Job description here...",
    "url": "[http://job-offer-link.com](http://job-offer-link.com)"
  }
]

Error Handling

The API returns the following error codes:

  • 400 Bad Request: Invalid input data (e.g., missing required fields in the request).
  • 404 Not Found: The job offer was not found.
  • 500 Internal Server Error: A server error occurred.

Swagger UI (API Testing)

You can easily explore and test the API using Swagger UI.

  1. Access Swagger UI: After running the application, navigate to the following URL in your web browser:

    http://localhost:8082/swagger-ui/index.html
    
  2. Interactive Interface: You will be presented with an interactive interface where you can:

    • View all available API endpoints.
    • Test each endpoint by sending requests and inspecting the responses.
    • Interact with the API in a user-friendly way without manually crafting HTTP requests.
  3. Example: Here's an example of what the Swagger UI interface might look like:

    Swagger UI Screenshot

Integration Testing

The application includes integration tests to validate the functionality of the endpoints.

To run the tests, use:

./mvnw test

Tests include:

  • verifying the correctness of retrieving job offers.
  • handling errors for invalid input data.

Contribution

Contributions are welcome! Please follow these steps:

  1. Fork the repository.
  2. Create a new branch for your feature or bug fix.
  3. Commit your changes.
  4. Push your changes to your fork.
  5. Submit a pull request.

License

This project is licensed under the MIT License.

Author

Senegalion

Contact

For questions or feedback, please contact me via email.

Acknowledgments

  • Shields.io
  • Badges 4 README.md

About

A Spring Boot web application that collects and processes job offers for Junior Java Developers from multiple external sources. It features REST APIs, MongoDB, Redis, Docker, and a full testing setup with JUnit, Mockito, and Testcontainers.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages