Skip to content

akshayjadhav4/thread

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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:

# 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:
./mvnw spring-boot:run

About

Spring Boot REST API's for thread social media application

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages