A real-time messaging platform built with React, Redux, and a Node.js backend. This project allows users to send and receive messages with a responsive and user-friendly interface.
The project is divided into the following directories:
- client: Contains the frontend code developed with React and Redux.
- server: Contains the backend API developed with Node.js and Express.
- User Authentication:
- Secure user login and registration using JWT.
- Real-Time Messaging:
- Chat functionality with real-time updates.
- Responsive Design:
- Optimized for mobile and desktop views.
- Redux for State Management:
- Centralized state management for better scalability and maintainability.
- Backend API:
- Handles user authentication, message storage, and retrieval.
Ensure you have the following installed on your system:
- Node.js: Download and install Node.js
- MongoDB: Download and install MongoDB
-
Clone the Repository and Navigate to the Project Directory:
git clone https://github.com/rajeshCreate72/messaging-website.git cd messaging-website
-
Install Dependencies:
# Install backend dependencies cd server npm install # Install frontend dependencies cd ../client npm install
-
Set Up Environment Variables:
Create a
.env
file in theserver
directory with the following content:PORT=8080 DB_URI=<Your MongoDB connection string URI>
-
Run the Application:
# Start the backend server cd ../server npm start # Open a new terminal and start the frontend application cd ../client npm start
-
Access the Application:
- Open your browser and navigate to
http://localhost:3000
to use the app.
- Open your browser and navigate to
The /server
directory contains the backend code and API logic. It includes:
- Dependencies:
express
: Web framework for handling API routes.mongoose
: ODM for MongoDB.jsonwebtoken
: For secure authentication.
- Endpoints:
/api/auth
: Handles user authentication./api/messages
: Handles message creation and retrieval.
To set up and run the backend server:
- `POST /api/login`: User login endpoint for authentication.
- `POST /api/register`: User registration endpoint to create a new account.
- `GET /api/contacts`: Endpoint to retrieve user contacts.
- `GET /api/chats`: Endpoint to retrieve chats for a user.
- `GET /api/users`: Endpoint to fetch user details.
# Navigate to the server directory
cd server
# Install dependencies
npm install
# Run the server
npm start
A live version of the application is available at: