A Spring Boot-based REST API that implements core functionality similar to Threads (by Meta) application.
- Java 17
- Spring Boot 3.3.5
- PostgreSQL
- Redis
- Apache Kafka
- JWT Authentication
- Maven
- User authentication and authorization
- Thread creation and management
- Like/Unlike functionality with Redis caching
- Follower/Following system
- Hashtag support
- Pagination support
- Java 17 or higher
- Maven
- PostgreSQL
- Redis Server
- Kafka Server
The application can be configured through application.properties. Key configurations include:
# Database Configuration
spring.datasource.url=your_database_url
spring.datasource.username=your_username
spring.datasource.password=your_password
# JWT Configuration
auth.token.expirationInMils=
auth.token.jwtSecret=
# Kafka Configuration
spring.kafka.bootstrap-servers=
spring.kafka.consumer.group-id=
# Redis Configuration
spring.redis.host=
spring.redis.port=
# API Configuration
api.prefix=/api/v1config/- Configuration classes for Spring Security, Redis, Kafka, etc.controller/- REST endpointsmodel/- Entity classesservice/- Business logicrepository/- Data access layersecurity/- Security configurations and JWT implementationdto/- Data Transfer Objectsmapper/- Object mapping configurations
POST /api/v1/auth/register- Register new userPOST /api/v1/auth/login- Login user
POST /api/v1/thread/- Create new threadGET /api/v1/thread/{threadId}- Get thread by IDGET /api/v1/thread/all- Get all threads (paginated)GET /api/v1/thread/user/{userId}- Get user's threadsGET /api/v1/thread/hashtag/{hashtag}- Get threads by hashtagPUT /api/v1/thread/{threadId}- Update threadDELETE /api/v1/thread/{threadId}- Delete thread
- Clone the repository
- Configure application.properties with your database credentials
- Start Redis server
- Start Kafka server
- Run the application:
./mvnw spring-boot:run