Skip to content

Amr-HAlahla/SpringMicroHub

Repository files navigation

SpringMicroHub


Project Overview

A Modern Microservices Architecture Built with Spring Boot

SpringMicroHub is a robust, scalable, and production-ready microservices ecosystem built using Spring Boot and Spring Cloud. This project demonstrates my expertise in designing distributed systems, integrating cutting-edge backend technologies, and deploying cloud-native applications. It serves as a showcase of my skills in microservices architecture, containerization, and event-driven design.

Key Features

  • API Gateway: Centralized routing and load balancing with Spring Cloud Gateway.
  • Service Discovery: Dynamic service registration and discovery using Netflix Eureka.
  • Event-Driven Messaging: Asynchronous communication powered by Apache Kafka.
  • Centralized Configuration: Managed via Spring Cloud Config Server.
  • Containerization: Fully Dockerized services with Docker Compose support.
  • Authentication: Secure JWT-based authentication for all services.
  • Scalability: Designed with horizontal scaling in mind.

Explore Rest APIs

Method Url Description Valid Request Body Valid Request Params
POST /v1/auth/register Register for User Info
POST /v1/auth/login Login for User and Admin Info
GET /v1/user/getAll Get all user
GET /v1/user/getUserById/{id} Get user by id Info
GET /v1/user/getUserByEmail/{email} Get user by email Info
PUT /v1/user/update Update user Info
DELETE /v1/user/deleteUserById/{id} Delete user by id Info
POST /v1/job-service/category/create Category create Info
GET /v1/job-service/category/getAll Get all categories
GET /v1/job-service/category/getCategoryById/{id} Get category by id Info
PUT /v1/job-service/category/update Update category Info
DELETE /v1/job-service/category/deleteCategoryById/{id} Delete category Info
POST /v1/job-service/job/create Job create Info
POST /v1/job-service/job/getJobsThatFitYourNeeds Get jobs that fit your needs Info
GET /v1/job-service/job/getAll Get all jobs
GET /v1/job-service/job/getJobById/{id} Get job by id Info
PUT /v1/job-service/job/update Update job Info
DELETE /v1/job-service/job/deleteJobById/{id} Delete job Info
POST /v1/job-service/advert/create Adver create Info
GET /v1/job-service/advert/getAll Get all adverts
GET /v1/job-service/advert/getAdvertById/{id} Get advert by id Info
GET /v1/job-service/advert/getAdvertsByUserId/{id} Get advert by user id Info
PUT /v1/job-service/advert/update Update advert Info
DELETE /v1/job-service/advert/deleteAdvertById/{id} Delete advert Info
POST /v1/job-service/offer/makeAnOffer Make an offer Info
GET /v1/job-service/offer/getOfferById/{id} Get offer by id Info
GET /v1/job-service/offer/getOfferByUserId/{id} Get offer by user id Info
GET /v1/job-service/offer/getOfferByAdvertId/{id} Get offer by advert id Info
PUT /v1/job-service/offer/update Update offer Info
DELETE /v1/job-service/offer/deleteOfferById/{id} Delete offer Info
GET /v1/notification/getAllByUserId/{userId}} Get all notification by user id Info
POST /v1/file-storage/upload Upload image to file storage Info
GET /v1/file-storage/download/{id} Download image to file storage Info

Valid Request Body

    http://localhost:8080/v1/auth/register
    
        {
          "username": "string",
          "password": "string",
          "email": "string"
        }
      http://localhost:8080/v1/auth/login
    
       {
         "username": "string",
         "password": "string"
       }
    http://localhost:8080/v1/user/update
    
    form-data:
        {
          "request": {
            "id": "string",
            "username": "string",
            "password": "string",
            "userDetails": {
              "firstName": "string",
              "lastName": "string",
              "phoneNumber": "string",
              "country": "string",
              "city": "string",
              "address": "string",
              "postalCode": "string",
              "aboutMe": "string",
              "profilePicture": "string"
            }
           },
         "file": "string"
        }
    
    Bearer Token : Authorized User or Admin
    http://localhost:8080/v1/job-service/category/create
    
    form data:
    {
      "request": {
        "name": "string",
        "description": "string"
      },
      "file": "string"
    }
    
    Bearer Token : Admin Token
    http://localhost:8080/v1/job-service/category/updateCategory
    
    form data:
    {
      "request": {
        "id": "string",
        "name": "string",
        "description": "string"
      },
      "file": "string"
    }
    
    Bearer Token : Admin Token
    http://localhost:8080/v1/job-service/job/create
    
    form data:
       {
      "request": {
        "name": "string",
        "description": "string",
        "categoryId": "string",
        "keys": [
          "string"
        ]
      },
      "file": "string"
    }
    
    Bearer Token : Admin Token
    http://localhost:8080/v1/job-service/job/updateJob
    
    form data:
     {
      "request": {
        "id": "string",
        "name": "string",
        "description": "string",
        "categoryId": "string",
        "keys": [
          "string"
        ]
      },
      "file": "string"
    }
        
    Bearer Token : Admin Token
    http://localhost:8080/v1/job-service/advert/create
    
    form data:
     {
      "request": {
        "name": "string",
        "description": "string",
        "deliveryTime": 0,
        "price": 0,
        "advertiser": "EMPLOYEE",
        "userId": "string",
        "jobId": "string"
      },
      "file": "string"
    }
    
    Bearer Token : User Token
    http://localhost:8080/v1/job-service/advert/update
    
    form data:
    {
      "request": {
        "id": "string",
        "name": "string",
        "description": "string",
        "deliveryTime": 0,
        "price": 0,
        "status": "OPEN"
      },
      "file": "string"
    }
        
    Bearer Token : Authorized User or Admin
    http://localhost:8080/v1/job-service/offer/makeAnOffer
    
    {
      "userId": "string",
      "advertId": "string",
      "offeredPrice": 0
    }
    
    Bearer Token : User Token
    http://localhost:8080/v1/job-service/offer/update
    
    {
      "id": "string",
      "offeredPrice": 0,
      "status": "OPEN"
    }
        
    Bearer Token : Authorized User or Admin

Valid Request Params

    http://localhost:8080/v1/user/getUserById/{id}
    
    Bearer Token : User Token
    http://localhost:8080/v1/user/getUserByEmail/{email}
    
    Bearer Token : User Token
    http://localhost:8080/v1/user/deleteUserById/{id}
    
    Bearer Token : Authorized User or Admin
    http://localhost:8080/v1/job-service/category/getCategoryById/{id}
    
    Bearer Token : User Token
    http://localhost:8080/v1/job-service/category/deleteCategoryById/{id}
    
    Bearer Token : Admin Token
    http://localhost:8080/v1/job-service/job/getJobById/{id}
    
    Bearer Token : User Token
    http://localhost:8080/v1/job-service/job/getJobsThatFitYourNeeds/{needs}
   
    Bearer Token : User Token
    http://localhost:8080/v1/job-service/job/deleteJobById/{id}
    
    Bearer Token : Admin Token
    http://localhost:8080/v1/job-service/advert/getAdvertById/{id}
    
    Bearer Token : Authorized User or Admin
    http://localhost:8080/v1/job-service/advert/getAdvertByUserId/{id}
    
    Bearer Token : User Token
    http://localhost:8080/v1/job-service/job/deleteAdvertById/{id}
    
    Bearer Token : Authorized User or Admin
    http://localhost:8080/v1/job-service/offer/getOfferById/{id}
    
    Bearer Token : User Token
    http://localhost:8080/v1/job-service/offer/getOfferByUserId/{id}
    
    Bearer Token : User Token
    http://localhost:8080/v1/job-service/offer/getOfferByAdvertId/{id}
    
    Bearer Token : User Token
    http://localhost:8080/v1/job-service/offer/deleteOfferById/{id}
    
    Bearer Token : Authorized User or Admin
    http://localhost:8080/v1/notification/getAllByUserId/{id}
    
    Bearer Token : Authorized User or Admin
    http://localhost:8080/v1/file-storage/download/{id}
    
    Bearer Token : User Token
    http://localhost:8080/v1/file-storage/upload
    
    form-data:
    {
      "file": "string"
    }
    
    Bearer Token : User Token

🔨 Run the App

Local

1 ) Clone project git clone https://github.com/Amr-HAlahla/SpringMicroHub

2 ) Go to the project's home directory : cd SpringMicroHub

3 ) Run docker compose docker compose up -d

4 ) Run Eureka Server

5 ) Run Gateway

6 ) Run Config Server

7 ) Run other services (auth-service, user-service, job-service, notification-service and lastly file-storage)

8 ) For swagger ui localhost:8080/v1/{service-name}/swagger-ui/index.html

Screenshots

Click here to show the screenshot of project

Eureka Server

User Service Swagger UI

Job Service Swagger UI

Auth Service Swagger UI

File Storage Postman

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages