This is the backend repository for the Tipgram, a real-time messaging application built using the MERN (MongoDB, Express.js, React, Node.js) stack. It leverages WebSocket technology to enable real-time messaging between users.
- Node.js
- Express.js
- WebSocket: Socket.IO
- MongoDB Atlas
To run the backend server locally, follow these steps:
- Node.js and npm installed on your machine.
- MongoDB installed and running locally or a MongoDB Atlas account for the database (replace with your connection string).
git clone https://github.com/AnmolDotX/tipgramserver
cd tipgramserver
Create a .env
file in the root directory (if not already present) and configure the following environment variables:
PORT=8000
MONGO_URI=your_mongodb_uri
CLIENT_ORIGIN = your_localhost_server
PORT
: Port on which the server will run locally (e.g., 5000).MONGO_URI
: MongoDB connection URI (replace with your local MongoDB URI or MongoDB Atlas URI).CLIENT_ORIGIN
: localhost url of your frontend (e.g., "http://localhost:5173").
Install the required dependencies:
npm install
Start the development server:
npm run dev
The backend server should now be running locally on the specified port (e.g., http://localhost:8000).
If you don't have MongoDB installed locally and are using MongoDB Atlas, follow these additional steps:
-
Sign up for a MongoDB Atlas account and create a cluster.
-
Obtain the MongoDB Atlas connection URI.
-
Replace the
MONGO_URI
value in the.env
file with your MongoDB Atlas connection URI.
Feel free to contribute to this project by opening issues or submitting pull requests. Your contributions are welcome!