{"id":24913952,"url":"https://github.com/vishwaravi/twitter-rest-api","last_synced_at":"2025-10-12T09:04:45.475Z","repository":{"id":215311859,"uuid":"731696653","full_name":"vishwaravi/twitter-rest-api","owner":"vishwaravi","description":"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.","archived":false,"fork":false,"pushed_at":"2025-01-23T18:08:48.000Z","size":363,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-02T06:15:19.787Z","etag":null,"topics":["backend","backend-api","java","java-spring-boot","mysql","rest-api","social-media","spring-boot","spring-security","twitter","twitter-api"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vishwaravi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-12-14T16:57:45.000Z","updated_at":"2025-01-23T18:08:51.000Z","dependencies_parsed_at":"2024-01-03T18:26:47.227Z","dependency_job_id":"12d7e4f0-b0a1-49d6-b0ef-92022d90b4d0","html_url":"https://github.com/vishwaravi/twitter-rest-api","commit_stats":null,"previous_names":["vishwaravi/twitter","vishwaravi/twitter-api","vishwaravi/twitter-springboot-api","vishwaravi/twitter-rest-api"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vishwaravi%2Ftwitter-rest-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vishwaravi%2Ftwitter-rest-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vishwaravi%2Ftwitter-rest-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vishwaravi%2Ftwitter-rest-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vishwaravi","download_url":"https://codeload.github.com/vishwaravi/twitter-rest-api/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245974191,"owners_count":20702982,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["backend","backend-api","java","java-spring-boot","mysql","rest-api","social-media","spring-boot","spring-security","twitter","twitter-api"],"created_at":"2025-02-02T06:15:22.418Z","updated_at":"2025-10-12T09:04:45.470Z","avatar_url":"https://github.com/vishwaravi.png","language":"Java","readme":"# Twitter backend\nThis 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.\n\n\u003e **Frontend Repository**: This Backend works with the [Twitter React Frontend](https://github.com/vishwaravi/twitter-react) - make sure to set up and run the Frontend App.\n\n\n## Technologies Used\n### Backend :\n* Java (version : JDK 21 LTS)\n* Spring Boot (version 3.4.2)\n* Dependencies\n    * Spring Web\n    * Spring Security\n    * Spring Data Jpa\n    * MySQL Driver\n    * Lombok\n    * JJWT (JWT Authentication)\n### Database :\n- Maria DB\n\n- ℹ️ Note : \n    if you are using MySQL or PostGres. Change the Driver Dependency in pom.xml and Change Connection URL in .env Config.\n\n### TESTING \n- [POSTMAN](https://www.postman.com/downloads/)\n### Installation :\n\nStep 1 : Clone the Repo. \u003cbr\u003e\nStep 2 : rename the \".env.example\" file to \".env\" \u003cbr\u003e\nStep 3 : create a Database.\n\u003cbr\u003e\nStep 4 : Setup the Environment variables using .env file by Your db url and password\u003cbr\u003e Example :\n```javascript\nDB_URL= \"jdbc:mariadb://localhost:3306/DB_name\"\nDB_USERNAME= \"username here\"\nDB_PASSWORD= \"password here\"\nJWT_SECRET=\"enter the secret\"\n```\nstep 5 : Run the application\n\n\n---\n\n### IDE : [VSCode extension and Spring Tool Suite](https://spring.io/tools) , [IntelliJ](https://www.jetbrains.com/idea/download/?section=windows)\n\n## Key Features :\n### User :\n- Creating Accounts\n- Deleting Accounts\n- Following Users\n- Followers\n### Content :\n- Posts\n- Tweets\n- Likes\n- comments\n### other Featues\n- Authentication and Authorization ( username and password )\n- JWT Authentication and Authorization\n### ER - Diagram\n![Schema image](/schema-img/schema.png)\n---\n## DDL commands\n### USER TABLE\n```javascript\n    CREATE TABLE users_table (\n    id bigint NOT NULL AUTO_INCREMENT,\n    user_id varchar(50) NOT NULL UNIQUE,\n    user_name varchar(50) NOT NULL,\n    user_dob date DEFAULT NULL,\n    user_email varchar(50) NOT NULL,\n    user_passwd varchar(100) NOT NULL,\n    time_stamp varchar(255) DEFAULT NULL,\n    user_pic varchar(255) DEFAULT NULL,\n    banner_pic varchar(255) DEFAULT NULL,\n    followers bigint DEFAULT NULL,\n    following bigint DEFAULT NULL,\n    PRIMARY KEY (id)\n);\n```\n---\n### TWEET TABLE\n```javascript\n    CREATE TABLE tweets_table (\n    tweet_id bigint NOT NULL AUTO_INCREMENT,\n    user_id varchar(255) DEFAULT NULL,\n    tweet_filepath varchar(255) DEFAULT NULL,\n    hashtags varchar(255) DEFAULT NULL,\n    time_stamp varchar(255) DEFAULT NULL,\n    tweet_content varchar(255) DEFAULT NULL,\n    likes_count bigint DEFAULT NULL,\n    PRIMARY KEY (tweet_id)\n);\n```\n---\n### COMMENTS TABLE\n```javascript\n    CREATE TABLE comments_table (\n    id bigint NOT NULL AUTO_INCREMENT,\n    comment_content varchar(255) DEFAULT NULL,\n    time_stamp varchar(255) DEFAULT NULL,\n    tweet_id bigint DEFAULT NULL,\n    user_id varchar(255) DEFAULT NULL,\n    PRIMARY KEY (id)\n);\n```\n---\n### LIKES TABLE\n```javascript\n    CREATE TABLE likes_table (\n    id bigint NOT NULL AUTO_INCREMENT,\n    liked_by varchar(255) DEFAULT NULL,\n    tweet_id bigint DEFAULT NULL,\n    time_stamp varchar(255) DEFAULT NULL,\n    PRIMARY KEY (id)\n);\n```\n---\n### FOLLOWERS TABLE\n```javascript\n    CREATE TABLE followers_table (\n    id bigint NOT NULL AUTO_INCREMENT,\n    followed_by varchar(255) DEFAULT NULL,\n    time_stamp varchar(255) DEFAULT NULL,\n    user_id varchar(255) DEFAULT NULL,\n    PRIMARY KEY (id)\n);\n```\n---\n### FOLLOWING TABLE\n```javascript\n    CREATE TABLE following_table (\n    id bigint NOT NULL AUTO_INCREMENT,\n    following varchar(255) DEFAULT NULL,\n    time_stamp varchar(255) DEFAULT NULL,\n    user_id varchar(255) DEFAULT NULL,\n    PRIMARY KEY (id)\n);\n```\n\n## API ENDPOINTS\n### USER\n**POST** - `localhost:8080/register` - *REGISTER USER* \u003cbr\u003e\n**GET** - `localhost:8080/{userId}` - *GET USER DETAILS*\u003cbr\u003e\n**DELETE** - `localhost:8080/{userId}` - *DELETE USER* \u003cbr\u003e\n**PUT** - `localhost:8080/{userId}/follow` - *FOLLOW USER*\u003cbr\u003e\n**PUT** - `localhost:8080/{userId}/unfollow` - *UNFOLLOW USER*\u003cbr\u003e\n\n### TWEET \n**GET** - `localhost:8080/home` - *FEED POSTS* \u003cbr\u003e\n**POST** - `localhost:8080/home` - *POST TWEET* \u003cbr\u003e\n**DELETE** - `localhost:8080/home/{tweetId}` - *DELETE TWEET* \u003cbr\u003e\n**PUT** - `localhost:8080/home/{tweetId}/comment` - *POST COMMENT* \u003cbr\u003e\n**DELETE** - `llocalhost:8080/home/{tweetId}/comment` - *DELETE COMMENT* \u003cbr\u003e\n**PUT** - `localhost:8080/home/{tweetId}/like` - *LIKE POST* \u003cbr\u003e\n**PUT** - `localhost:8080/home/{tweetId}/dislike` - *DISLIKE POST* \u003cbr\u003e\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvishwaravi%2Ftwitter-rest-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvishwaravi%2Ftwitter-rest-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvishwaravi%2Ftwitter-rest-api/lists"}