Skip to content

Microservice-based application development using Spring Boot, Kafka, Redis, MySQL, MongoDB, Elasticsearch, Docker and Kubernetes.

Notifications You must be signed in to change notification settings

ashrawan/swa-proj3

Repository files navigation

Introduction

Microservice-based application development using Spring Boot, Spring Security, Spring Cloud, Kafka, Redis, Zipkin, MySQL, MongoDB, Elasticsearch, Docker and Kubernetes.


# How to run ?

Development:

  1. Running Single Service at a time:

    • If Using IDE: Run each services by clicking their "run" icon
    • Using only CMD : On terminal of specific service, type mvn spring-boot:run
    • JAR file: First, Create jar mvn clean install and run java -jar target/service1.jar
  2. Running the application using docker

    • If cloned first time, In the root directory run mvn clean install or use IDE, maven -> lifecycle -> install (to create jar for all services)
    • Then, In terminal type: docker compose up. (this will run mysql, and other services)
    mvn clean install -DskipTests
    docker compose up

Check docs/dev folder README, to start the required services. "MongoDB", "Kafka", "Redis" ..

Deployment K8S:

mvn clean install -DskipTests

# If minkiube, also run -> minikube docker-env
docker compose build

# app-cores: All configs and DB, services: all services
kubectl create -f k8s/app-cores
kubectl create -f services

# add "192.168.49.2 jobapp.swa.local" to /etc/host
sudo nano /etc/hosts

==========================
127.0.0.1	localhost
192.168.49.2 jobapp.swa.local
==========================

Testing Deployed Services

# FROM: "auth-service", This is for create user

curl --location --request POST 'http://jobapp.swa.local/auth/create-user' \
--header 'Content-Type: application/json' \
--data-raw '{
    "fullName": "Test user",
    "email": "test1",
    "password": "test1"
}'

# FROM: "auth-service", This is for Login

curl --location --request POST 'http://jobapp.swa.local/auth/login' \
--header 'Content-Type: application/json' \
--data-raw '{
    "username": "test1",
    "password": "test1"
}'

# How to create this project, and how to add new modules/services ?

Steps: Creating multi-module project

  1. Create new project "swa-2", and select buildSystem maven.
  2. Then either Create new services or Add existing ones
    • Create (New Module): right click on project "swa-2" and create any module
      • e.g click on: new -> module -> springInitializr
    • Add (Add Module): right click on "swa-2", open module settings
      • then under that Settings -> Modules -> click on + -> import module -> Select .pom file or directory -> then import module from external model -> select maven -> Apply
    • After that go to pom.xml of root project "swa-2" and add to <modules> ... <modules>

# How to contribute to the project ?

INSTRUCTION:

  1. Use "develop" branch to make and commit changes.
  2. We will merge to "main" on the day-end or when services are integrated and working fine.

Want to know, What to contribute and how to do it ?

Please, Check out TODO.md , and discuss with the team


# Need Further help ?

Reach out team-mates to Discuss and do it together.

About

Microservice-based application development using Spring Boot, Kafka, Redis, MySQL, MongoDB, Elasticsearch, Docker and Kubernetes.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published