This project is a monolith-based architecture serving as the backend for a Twitter-like application. It utilizes the following technologies:
- Node.js: JavaScript runtime for server-side development.
- Express: Web application framework for Node.js.
- MongoDB: NoSQL database for data storage.
- Jest: Testing framework for unit testing.
- Cloudinary: Cloud storage service for handling static images.
- Passport: Authentication middleware for Node.js.
- bcrypt: Library for encrypting passwords.
- multer: Node JS middleware for handling form-data.
- jsonwebtoken: Librry for generating JWT Tokens.
- Backend Framework: Express.js
- Database: MongoDB
- Testing Framework: Jest
- Node.js: Download Node.js
- Express:
npm install express
- MongoDB: MongoDB Installation Guide
- Jest:
npm install jest
- Cloudinary: Cloudinary Documentation
- Passport:
npm install passport
- bcrypt:
npm install bcrypt
- User authentication with Passport.
- Password encryption using bcrypt.
- Image storage and retrieval through Cloudinary.
- Monolithic architecture for a streamlined backend.
- Authenticated Users should be able to post tweets, like on tweets, and comment on tweets.
- Users can upload static images while posting tweets.
- Users can be able to comment on tweets and comment on comments too.
- Users can filter hashtags separately.
Unit tests have been implemented using Jest. To run the tests, use the following command:
npm test
-
Clone the repository:
git clone https://github.com/vishnu-mouli-102408/Twitter-Backend.git
-
Install dependencies:
npm install
-
Configure environment variables:
- Create a
.env
file in the project root. - Set the following variables in the
.env
file:MONGODB_URI=your_mongodb_connection_string CLOUDINARY_API_KEY=your_cloudinary_api_key CLOUDINARY_API_SECRET=your_cloudinary_api_secret
- Create a
-
Run the application:
npm start
-
Testing:
- Run unit tests using Jest:
npm test
- Run unit tests using Jest:
-
Access the application:
- Once the application is running, access it through your web browser at
http://localhost:3000
(or the specified port).
- Once the application is running, access it through your web browser at
-
Explore the API:
-
Enjoy building on top of the Twitter Backend!
Ensure to set the following environment variables in your .env
file:
MONGODB_URI
: MongoDB connection string.CLOUDINARY_API_KEY
: Cloudinary API key.CLOUDINARY_API_SECRET
: Cloudinary API secret.
This project is licensed under the MIT License.