A real-time chat application built using React, Node.js, PostgreSQL, and Docker. This app allows users to send and receive messages, manage user authentication, and handle chat functionalities in a simple and intuitive interface.
- Real-time Messaging: Send and receive messages instantly.
- User Authentication: Register, log in, and manage sessions securely.
- PostgreSQL Database: Store messages and user data.
- Dockerized: All services (frontend, backend, PostgreSQL, and Nginx) run in isolated Docker containers.
- Responsive UI: Built with React and optimized for desktop and mobile use.
The app is divided into several services:
- Frontend: React-based user interface, which communicates with the backend.
- Backend: Node.js server with Express for API routes, including authentication and messaging.
- PostgreSQL: A relational database for storing user data and chat messages.
- Nginx: Reverse proxy server to handle routing between the frontend and backend (optional in this setup).
- Frontend: React, Vite
- Backend: Node.js, Express, Prisma
- Database: PostgreSQL
- Containerization: Docker, Docker Compose
Before running the app locally, ensure you have the following installed:
- Docker and Docker Compose
- A text editor (e.g., VS Code)
- Node.js (for local development)
Follow these steps to set up the project on your local machine.
git clone https://github.com/firstnuel/chat-app
cd chat-appCreate a .env file in the app-backend directory with the following variables folling the env.template
Make sure to replace your_db_user and your_db_password with your desired credentials.
Use Docker Compose to build and start all the services.
docker-compose up --buildThis will:
- Build the backend and frontend Docker images.
- Start the PostgreSQL container and configure the database.
- Start the backend server and frontend application.
Once the containers are up and running, you can access the app:
- Frontend:
http://localhost:5173 - Backend:
http://localhost:3000/api/
or centrally via the reverse proxy
- Frontend:
http://localhost:8080 - Backend:
http://localhost:8080/api/
- Register a New User: Navigate to the frontend and sign up with your email and password.
- Log In: After registration, log in to access the chat features.
- Send Messages: Once logged in, you can send and receive messages in real-time.
This project is licensed under the MIT License - see the LICENSE file for details.