NexusChat is a modern, real-time chat application built with a Python (FastAPI) backend and a React (Vite) frontend. It features secure user authentication, real-time messaging using WebSockets, and a responsive, dynamic user interface.
- Real-time Messaging: Instant message delivery using WebSockets.
- Secure Authentication: User registration and login with JWT-based authentication and Bcrypt password hashing.
- Modern UI/UX: Built with React, Tailwind CSS v4, and dynamic animations for a premium feel.
- Responsive Design: Works seamlessly across desktop and mobile devices.
- Robust Backend: Powered by FastAPI for high performance and scalability.
- Database: MongoDB for reliable message and user data storage.
- Security: Includes rate limiting, input validation, and secure API key handling.
Frontend:
- React (via Vite)
- Tailwind CSS v4 (for styling)
- Anime.js & Lenis (for animations and smooth scrolling)
- Native WebSockets API
Backend:
- Python 3.x
- FastAPI
- Uvicorn (ASGI server)
- Motor (Async MongoDB driver)
- PyJWT & Bcrypt (Security)
- Python 3.8+
- Node.js 18+
- MongoDB instance (local or Atlas)
- Navigate to the
backenddirectory:cd backend - Create and activate a virtual environment (optional but recommended):
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
- Install the required Python packages:
pip install -r requirements.txt
- Create a
.envfile in thebackenddirectory. Use.env.exampleas a template and provide your MongoDB URI and a secret key for JWT:MONGODB_URI=mongodb://localhost:27017 SECRET_KEY=your_super_secret_key_here
- Start the backend server:
uvicorn server:app --reload --port 8000
- Navigate to the
frontenddirectory:cd frontend - Install the frontend dependencies:
npm install
- Start the development server:
npm run dev
- Open your browser and navigate to the URL provided by Vite (usually
http://localhost:5173).
- Rate Limiting: Protects public endpoints from brute-force and DDoS attacks.
- Input Validation: Ensures all user inputs meet strict schema requirements before processing.
- Secure Password Storage: Uses Bcrypt with appropriate work factors.
- Environment Variables: Sensitive data like DB URIs and Secret Keys are kept out of source code.
Contributions, issues, and feature requests are welcome!
This project is open-source and available under the MIT License.