Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/prince9871/twitter-backend
This is a Twitter clone project built using Node.js, Express, and MongoDB. It allows users to create an account, follow and unfollow other users, and create and view tweets.
https://github.com/prince9871/twitter-backend
Last synced: 2 days ago
JSON representation
This is a Twitter clone project built using Node.js, Express, and MongoDB. It allows users to create an account, follow and unfollow other users, and create and view tweets.
- Host: GitHub
- URL: https://github.com/prince9871/twitter-backend
- Owner: prince9871
- Created: 2023-04-03T09:37:26.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2023-04-03T12:41:57.000Z (over 1 year ago)
- Last Synced: 2023-08-24T03:14:31.232Z (about 1 year ago)
- Language: JavaScript
- Homepage: https://twitter-backend-git-master-prince9871.vercel.app/
- Size: 35.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Twitter Clone Project
This is a Twitter clone project built using Node.js, Express, and MongoDB. It allows users to create an account, follow and unfollow other users, and create and view tweets.## Deployment Link
Test This Project With Check Deployments
https://twitter-backend-git-master-prince9871.vercel.app/## Installation
Clone the repository
https://github.com/prince9871/twitter-backend.gitInstall dependencies using
- npm install
Start the server using
- npm start
To start the server in development mode using nodemon## Endpoints
The following endpoints are available:### Authentication
#### POST: Register a new user -- /register
#### POST: Login with existing credentials --/login
#### POST: Reset password for an existing user -- /reset-password/:userId
### User
#### Get details of the logged in user, including the number of followers and following --/user GET:
#### Follow another user -- /user/follow POST:
#### DELETE: Unfollow a previously followed user -- /user/unfollow
### Tweet
#### POST: Create a new tweet -- /tweets
#### GET: Get all tweets by the logged in user --/tweets/user
#### GET: Get all tweets by users the logged in user is following -- /tweets/followed
#### GET: Search for tweets based on a search query -- /tweets/search
#### GET: Get tweets with pagination -- /tweets/page
## Models
### The project uses two models: User and Tweet### User
The User model has the following properties:- username (string, required)
- email (string, required, unique)
- favorite_food (string, required)
- password (string, required)
- following (array of user IDs)
- followers (array of user IDs)
### Tweet
The Tweet model has the following properties:- content (string, required)
- userId (user ID of the user who created the tweet)
- hashtags (array of strings)## Dependencies
- bcrypt: ^5.1.0
- express: ^4.18.2
- joi: ^17.9.1
- jsonwebtoken: ^9.0.0
- mongoose: ^7.0.3
- nodemon: ^2.0.22
- Endpoints
- The following endpoints are available:## Badges
[![MIT License](https://img.shields.io/badge/License-MIT-green.svg)](https://choosealicense.com/licenses/mit/)