https://github.com/akshayjadhav4/thread
Spring Boot REST API's for thread social media application
https://github.com/akshayjadhav4/thread
rest-api spring-boot
Last synced: 2 months ago
JSON representation
Spring Boot REST API's for thread social media application
- Host: GitHub
- URL: https://github.com/akshayjadhav4/thread
- Owner: akshayjadhav4
- Created: 2024-12-07T11:59:22.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-04T07:20:48.000Z (over 1 year ago)
- Last Synced: 2025-07-03T08:46:54.061Z (about 1 year ago)
- Topics: rest-api, spring-boot
- Language: Java
- Homepage:
- Size: 56.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
# Thread Clone API
A Spring Boot-based REST API that implements core functionality similar to Threads (by Meta) application.
## Technologies Used
- Java 17
- Spring Boot 3.3.5
- PostgreSQL
- Redis
- Apache Kafka
- JWT Authentication
- Maven
## Features
- User authentication and authorization
- Thread creation and management
- Like/Unlike functionality with Redis caching
- Follower/Following system
- Hashtag support
- Pagination support
## Prerequisites
- Java 17 or higher
- Maven
- PostgreSQL
- Redis Server
- Kafka Server
## Configuration
The application can be configured through `application.properties`. Key configurations include:
```properties
# 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/v1
```
## Project Structure
- `config/` - Configuration classes for Spring Security, Redis, Kafka, etc.
- `controller/` - REST endpoints
- `model/` - Entity classes
- `service/` - Business logic
- `repository/` - Data access layer
- `security/` - Security configurations and JWT implementation
- `dto/` - Data Transfer Objects
- `mapper/` - Object mapping configurations
## API Endpoints
### Authentication
- `POST /api/v1/auth/register` - Register new user
- `POST /api/v1/auth/login` - Login user
### Threads
- `POST /api/v1/thread/` - Create new thread
- `GET /api/v1/thread/{threadId}` - Get thread by ID
- `GET /api/v1/thread/all` - Get all threads (paginated)
- `GET /api/v1/thread/user/{userId}` - Get user's threads
- `GET /api/v1/thread/hashtag/{hashtag}` - Get threads by hashtag
- `PUT /api/v1/thread/{threadId}` - Update thread
- `DELETE /api/v1/thread/{threadId}` - Delete thread
## Building and Running
1. Clone the repository
2. Configure application.properties with your database credentials
3. Start Redis server
4. Start Kafka server
5. Run the application:
```bash:Readme.md
./mvnw spring-boot:run
```