Skip to content

Twitter-like backend application built using Spring Boot and Maven. It provides RESTful APIs to perform various Twitter-like functionalities such as posting tweets, following/unfollowing users, and fetching timelines.

Notifications You must be signed in to change notification settings

vishwaravi/Twitter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Twitter backend

This project is a Twitter-like backend application built using Spring Boot and Maven. It provides RESTful APIs to perform various Twitter-like functionalities such as posting tweets, following/unfollowing users, and fetching timelines.

Technologies Used

Backend :

  • Java (version : JDK 22)
  • Spring Boot (version 3.3.0)
  • Dependencies
    • Spring Web
    • Spring Security
    • Spring Data Jpa
    • MySQL Driver
    • Lombok

Database :

  • MySQL

TESTING

Installation :

JAVA : To Install Java in Windows, Go to The Official JAVA Website by Click Here and download the latest java Package (used : JDK22). If you Don't Know the Complete Installation Process, then Watch this Youtube Video.

MySQL :

To Install MySql in Windows, Visit The The Official MySQL site by Click Here and Choose the Latest Supported version (used : V8.0.36) click the MSI installer and Download it. the follow the steps By Watching This Youtube Video.

Key Features :

User :

  • Creating Accounts
  • Deleting Accounts
  • Following Users
  • Followers

Content :

  • Posts
  • Tweets
  • Likes
  • comments

other Featues

  • Authentication and Authorization

ER - Diagram

Schema image

DDL commands

USER TABLE

    CREATE TABLE users_table (
    id bigint NOT NULL AUTO_INCREMENT,
    user_id varchar(50) NOT NULL UNIQUE,
    user_name varchar(50) NOT NULL,
    user_dob date DEFAULT NULL,
    user_email varchar(50) NOT NULL,
    user_passwd varchar(100) NOT NULL,
    time_stamp varchar(255) DEFAULT NULL,
    user_pic varchar(255) DEFAULT NULL,
    banner_pic varchar(255) DEFAULT NULL,
    followers bigint DEFAULT NULL,
    following bigint DEFAULT NULL,
    PRIMARY KEY (id)
);

TWEET TABLE

    CREATE TABLE tweets_table (
    tweet_id bigint NOT NULL AUTO_INCREMENT,
    user_id varchar(255) DEFAULT NULL,
    hashtags varchar(255) DEFAULT NULL,
    time_stamp varchar(255) DEFAULT NULL,
    tweet_content varchar(255) DEFAULT NULL,
    likes_count bigint DEFAULT NULL,
    PRIMARY KEY (tweet_id)
);

COMMENTS TABLE

    CREATE TABLE comments_table (
    id bigint NOT NULL AUTO_INCREMENT,
    comment_content varchar(255) DEFAULT NULL,
    time_stamp varchar(255) DEFAULT NULL,
    tweet_id bigint DEFAULT NULL,
    user_id varchar(255) DEFAULT NULL,
    PRIMARY KEY (id)
);

LIKES TABLE

    CREATE TABLE likes_table (
    id bigint NOT NULL AUTO_INCREMENT,
    liked_by varchar(255) DEFAULT NULL,
    tweet_id bigint DEFAULT NULL,
    time_stamp varchar(255) DEFAULT NULL,
    PRIMARY KEY (id)
);

FOLLOWERS TABLE

    CREATE TABLE followers_table (
    id bigint NOT NULL AUTO_INCREMENT,
    followed_by varchar(255) DEFAULT NULL,
    time_stamp varchar(255) DEFAULT NULL,
    user_id varchar(255) DEFAULT NULL,
    PRIMARY KEY (id)
);

FOLLOWING TABLE

    CREATE TABLE following_table (
    id bigint NOT NULL AUTO_INCREMENT,
    following varchar(255) DEFAULT NULL,
    time_stamp varchar(255) DEFAULT NULL,
    user_id varchar(255) DEFAULT NULL,
    PRIMARY KEY (id)
);

MEDIA TABLE

CREATE TABLE media_table (
    id bigint NOT NULL AUTO_INCREMENT,
    file_name varchar(255) DEFAULT NULL,
    file_path varchar(255) DEFAULT NULL,
    file_type varchar(255) DEFAULT NULL,
    time_stamp varchar(255) DEFAULT NULL,
    PRIMARY KEY (id)
);

API ENDPOINTS

USER

POST - localhost:8080/register - REGISTER USER
GET - localhost:8080/{userId} - GET USER DETAILS
DELETE - localhost:8080/{userId} - DELETE USER
PUT - localhost:8080/{userId}/follow - FOLLOW USER
PUT - localhost:8080/{userId}/unfollow - UNFOLLOW USER

TWEET

GET - localhost:8080/home - FEED POSTS
POST - localhost:8080/home - POST TWEET
DELETE - localhost:8080/home/{tweetId} - DELETE TWEET
PUT - localhost:8080/home/{tweetId}/comment - POST COMMENT
DELETE - llocalhost:8080/home/{tweetId}/comment - DELETE COMMENT
PUT - localhost:8080/home/{tweetId}/like - LIKE POST
PUT - localhost:8080/home/{tweetId}/dislike - DISLIKE POST

About

Twitter-like backend application built using Spring Boot and Maven. It provides RESTful APIs to perform various Twitter-like functionalities such as posting tweets, following/unfollowing users, and fetching timelines.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages