This Flutter chat app is a real-time messaging application that allows users to engage in seamless conversations. The app is built using Flutter for the front end, and it communicates with a Node.js backend server that utilizes Express, MongoDB for data storage, and sockets for real-time communication.
To check out this repo, click here.
The app includes dedicated pages for user authentication, allowing users to log in or sign up to access the chat functionality.
This widget includes two main actions: a signout button and an online status icon, which represents the socket server's status.
A user list page displays all users along with their online status. Users can easily identify who is online and initiate chats.
The chat page provides a user-friendly interface for users to engage in real-time conversations. The chat history between two users is displayed, and new messages are instantly updated.
Users can send and receive messages in real-time, providing a smooth and interactive chat experience.
Secure user authentication is implemented using JSON Web Tokens (JWT), ensuring a safe and personalized messaging experience.
Messages and user data are stored in a MongoDB database. MongoDB Compass, a graphical user interface, can be used for easy database management. Additionally, MongoDB Atlas, a cloud-based database service, offers a scalable and reliable solution for data storage.
Real-time communication is achieved through Socket.io, enabling instant message updates and notifications.
Passwords are securely hashed using bcrypt to enhance user authentication.
Cross-Origin Resource Sharing (CORS) is handled using the cors package to enable secure communication with the frontend.
The dotenv package is used to load environment variables from a .env file.
The server framework used for handling HTTP requests and routes.
Input validation is performed using the express-validator package.
JSON Web Tokens (JWT) are used for secure user authentication.
A MongoDB object modeling tool used for interacting with the MongoDB database.
Enables real-time bidirectional event-based communication.
POST /api/auth/signup
{
"name": "Belen",
"email": "test1@test.com",
"password": "123456"
}
POST /api/auth/login
{
"email": "test1@test.com",
"password": "123456"
}
{
"x-token": token
}
GET /api/auth/renew
GET /api/users?offset=0
Parameter | Type | Description |
---|---|---|
offset |
int |
Optional |
GET /api/messages/:uid