Focused on follow real world practices, architectures, design and requiriments (user experience, asyncronous communication avoiding tigh-coupling, performance) as an excelent way to get real/deep hands-on experience.
- Custom profile image upload and update, or default one if none is provided.
- User details updating.
- Search for a specific user.
- Send message to a user to start a conversation (first time interaction).
- Messages delivered in real time.
- Conversations storing.
- Delete a conversation locally (it remails for the other participant).
- Conversation recreation on new message after a delete.
- User deletion
- Conversation messages remove when all participants has delete it or they have been deleted
- Development and Production Spring Profiles.
- Whole project deployment Docker integration using a separate compose file for each service and profile.
- Configuration management by Spring Cloud Config Server.
- Single point of access through Spring Cloud Gateway.
- Services APIs exposure with Open API Swagger for easier client integration, exposing docs access through Gateway.
- A Kafka broker for event asyncronous communication (decoupling some services).
- User service: handle user details data and integrates with Media service to access profile images.
- Media service: works as a media storing server, handling profile images access.
- Chat service: handle Conversations and Messages REST resources, using websockets connections by Spring Stopm WebSockets and SockJs for client side.
- PostgreSQL Relational Database.
- Redis Caching instance.
- Security (JWT, OAuth2.0)
- Integration with Cloud (AWS S3 Bucket for Media service, Gateway, RDS, or EC2 instances).
- Three different DBs (NoSQL Cassandra for Chat, Relational MySQL for User service, and PostgreSQL for Social).
- A Redis Cache instance for each services that requires it (this is most for optimization handling learning propouses, because, even if the real architecture is intended to work in this way, there is no need of all these instances for a local project, how can we have 3 reddis instances, and 3 different DBs running at the same time in our machine, without getting overhead?).
- Client SPA (Frontend Angular/React)
- A Jenkins pipeline.
- Java 21
- Core
- Functional Programming (Java 8 Streams API)
- Docker Compose
- PostgreSQL
- Redis (Jedis extension)
- Kafka (Kraft mode)
- Open API Swagger
- Spring:
- Profiles
- Test (Unit and Integration)
- JUnit5
- Mockito
- JaCoCo (Coverage)
- Web (Rest)
- Actuator
- WebSockets
- Data JPA
- Hibernate
- Model Mapper
- Spring Cloud:
- Eureka Server
- Config Server
- Gateway
- FeignClient
- Resilience4j Circuit Braker
- SockJS
- Maven 3.0+
Spring Framework | Tools & Other Languages | Architectures |
---|---|---|
- Internal:
- User
- Chat
- External:
- Media
- Gateway
- Dependencies:
- Redis instance
- Apache Kafka Server
- Clone the repository using Git (or download directly)
git clone https://github.com/CsarNarciso/Chat-Web.git
- Navigate to the project root directory
cd Chat-Web/
The following have to be installed locally:
- Apache Kafka.
- Redis.
Or you can use Docker Compose for this:
- To setup the whole project directly:
docker compose -f prod-compose.yaml up -d
Then, just jump directly to the next section to see how to use the application.
- Or if you just want to create a Kafka and a Redis container:
docker compose -f docker-compose.common.yaml up -d
Note: either using a Docker environment or a local one, the application is configured to use default redis (6379) and kafka (9492) ports. In case you are using the provided compose files, the default ports are already configured, in case not, you need to make sure these two tools are using the specified ports.
First, make sure to have already completed the previous section and have all the software required up and running. Then, follow the steps below:
-
Run the services using Maven (they already have Maven Wraper integrated, so you don't need to install it on your machine)
cd Service-Name/
./mvnw spring-boot:run -Dmaven.test.skip
Note: Gateway is not necesary for internal microservices to work.
http://localhost:8000/v3/swagger-ui.html
http://localhost:8001/user/swagger-ui.html
Download the Postman collections in JSON format and import them in Postman Desktop.
https://www.postman.com/csarnarciso/chat-web/overview