Monorepo, microservices backend for a marketing with real-time games platform.
Java, Spring, Maven, Docker, AWS, MySQL, MongoDB, Redis, Kafka, Resilience4J, Firebase, Grafana stack.
For local development, we use the /resources/application.yml
of each service instead of making a separated config
server for simple demo.
For deployment with docker, we use docker-compose.yml
to run our services as containers that can be used by
front-end team during development and for demo purposes.
Our service is set up by Spring Boot using Spring Initializr
- Project: Maven
- Language version: Java (JDK 17)
- Spring boot version: 3.3.1
Leverage a lot of spring framework library such as Lombok, Spring Boot DevTools, Spring Data JPA (Hibernate by default), Spring Web, Spring Websocket, etc...
For more details, can look at application.yml
of each service
-
AWS S3: Utilized for storing static files, including audio and images.
-
AWS Polly: Employs advanced deep learning technologies to convert text, such as quiz game questions, into lifelike speech.
-
Firebase Cloud Messaging (FCM): Facilitates the delivery of notifications and messages to users across multiple platforms.
-
SpeedSMS: Enables the rapid and efficient dispatch of SMS messages to a large number of recipients.
- Open IntelliJ.
- Click on "Open" and navigate to the folder containing your Spring Boot project.
- Go to
File > Project Structure > Project
. - Ensure the Project SDK is set to your installed JDK (preferably JDK 17).
- Verify that your project uses the correct build tool (Maven).
- Each service is a Maven project and needs to be run individually.
- Open the first service, right-click the main class annotated with
@SpringBootApplication
, and selectRun 'Application'
. - Repeat the process for the main class of the second service by right-clicking and selecting
Run 'Application'
. - Note: Some services, such as sessions and notifications, rely on third-party integrations. These require specific environment variables and secret files, which are stored in the
.env
file. Please contact@Fbin
for access to these credentials and configurations.
- Docker installed on your local machine.
- Docker Compose installed on your local machine.
Our docker images are built using the Google Jib
plugin, which simplifies the process of building and pushing images to a registry.
- Navigate to the root directory of each service.
- Run the following Maven command to build the Docker image:
mvn compile jib:dockerBuild
We use docker-compose.yml
to manage and run our services as containers. This setup is used by the front-end team during development and for demo purposes.
- Navigate to the root directory of the project where the
docker-compose.yml
file is located. - Run the following command to start all services:
docker-compose up
Some services require environment variables and secret files that are saved in the .env
file. Ensure you have the correct .env
file in the root directory before starting the services.
To stop the running services, use the following command:
docker-compose down
- Ensure that your Docker daemon is running before executing any Docker commands.
- For more details on configuring each service, refer to the
application.yml
file of each service.