Twitter is a social media application that allows users to connect and share their thoughts and experiences with others. With a robust system design and a reliable technology stack, Twitter provides a seamless and secure user experience.
This application is built using a microservices architecture with the Spring framework, allowing for modular and independent development of specific functionalities. This approach enables scalability and maintainability of the application.
-
Java 17
-
Spring Boot 3.0.5
-
Spring Web
-
Spring Security
-
Spring Data Jpa
-
Spring Cloud
-
Redis
-
MongoDB
-
PostgreSQL
- Apache Kafka
- AWS blob storage
- OpenFeign
- Discovery Server
- Spring Api Gateway
- Distributed tracing with Zipkin
- Spring cloud config server
- Mapstruct
- Swagger docs
- Testcontainers
- Mockito
Handles user registration, authorization, and generation of JWT tokens for secure login that expires after 24 hours. Once the user activates their account by entering the code, they can log in using their email and password and receive a personal JWT token that expires after 24 hours.
Connects to Amazon blob storage, enabling users to store and retrieve media files.
Allows users to view and follow other users, update their profiles, and upload custom avatars and banners. The service utilizes caching to store user profiles for improved performance.
Allows users to create/update/delete tweets, as well as retweet/like/reply on them. Also, there is views system, so when user gets any tweet, views counter is incremented by 1, and cache system that will cache tweets. When user creates new tweet, it will be added to user's user timeline and home timelines of his followers in cache, however if user has a lot of followers, it will be added only to user timeline to reduce time and improve performance.
Provides any type of timeline for user. When user gets his user timeline, then it will be received from cache, but if it's absent there, it will be requested from tweet service which will obtain it from database and give it back sorted by reversed chronological order. When user gets his home timeline, service tries to obtain it from cache, but if there was nothing, then it will take user timeline of every followee of that user, sort resulted list and cache it for further usage. As is known celebrities don't push created tweets to home timelines of followers, so that service take user timeline of every followee celebrity and add those tweets to the response as well as sort it by reversed chronological order.
This service receives messages with entities from the message queue and store them in cache for particular user.
Acts as a centralized access point for the application, ensuring secure interaction with the services using JWT tokens.
Facilitates microservice communication by enabling service discovery and load balancing.
Provides configuration properties for all services in the application.
- Install docker desktop and configure it.
- Download docker-compose.yml
- Open file location in terminal and enter
docker-compose up
- Wait until all images are pulled and containers are created
- Open postman and send requests!
If you need documentation for endpoints, hit http://localhost:8080/swagger-ui.html