README.md Indonesia Ver.
Welcome to VeloChat! A modern, full-stack, real-time chat web application built from scratch with dedication by Ichramsyah Abdurrachman. This application is designed to provide a secure, fast, and intuitive communication experience.
π₯ Live Site: visit VeloChat in https://velochat.vercel.app
π₯ Live Route API: visit API VeloChat in https://velochat-backend-restful-apis-production.up.railway.app/
π₯ Video Demo: Watch the VeloChat demo video at https://youtube.com/demo-velochat
β¨ Figma Design Link: View the Rinema design at https://www.figma.com/velochat-design
- About VeloChat
- Key Features
- Technologies Used
- Deployment
- Database Structure
- Installation & Running the Project
- License
- Contributing
- Feature Contribution Ideas
- Contact
VeloChat is an ambitious project to build a functional and feature-rich single-page application (SPA) for conversations. This project covers the entire development lifecycle, from designing a backend RESTful APIs architecture and real-time connections with Socket.IO to building a reactive and modern frontend interface using React JavaScript. The main focus is on security (JWT & Google OAuth authentication), user experience (real-time notifications, typing indicators, read receipts, responsive design), and clean, structured code quality.
The application is equipped with advanced features that make it a comprehensive communication platform:
- β
Manual registration with email domain validation (
@gmail.com). - β Secure login system with hashed passwords.
- β Third-party login & registration via Google OAuth 2.0.
- β JWT (JSON Web Tokens)-based authorization to protect APIs.
- β Protected pages accessible only after login.
- β Search for other users by exact email.
- β Friend Request System (Send, Accept, Decline).
- β Real-time friend request notifications.
- β Dynamic contact list separate from conversations.
- β Contact list search with debounce feature.
- β Instant one-to-one messaging with Socket.IO.
- β Permanent message history storage.
- β Typing Indicator ("Typing...") when another user is typing.
- β Unread Message Notifications with badge counts in the conversation list.
- β Read Receipts with sent and seen checkmark icons.
- β Timestamps and Date Separators (Today, Yesterday, etc.) for clear chat history.
- β Ability to change profile name.
- β Ability to update account password.
- β Upload and change profile picture with storage on Cloudinary.
- β Default profile picture for all new users.
| Category | Technologies |
|---|---|
| Frontend | React, Vite, Tailwind CSS, Zustand, React Router DOM, Axios, Socket.IO Client, @react-oauth/google, react-hot-toast, react-loading-skeleton, date-fns |
| Backend | Node.js, Express.js, Socket.IO, JSON Web Token (JWT), Passport.js (for Google OAuth), Mongoose, Bcrypt.js, Multer, Cloudinary, Express Session, Dotenv |
| Database | MongoDB Atlas (NoSQL) |
| Integrations | Google Cloud Platform (OAuth), Cloudinary (Media Storage) |
The application is deployed using modern CI/CD platforms:
- Frontend: https://velochat.vercel.app
- Backend: https://velochat-backend-restful-apis-production.up.railway.app/
The VeloChat architecture is built on the MERN stack (MongoDB, Express.js, React, Node.js), utilizing Socket.IO for real-time bidirectional communication.
- Client (Frontend): Built with React and Vite, it handles the UI and user interactions. It communicates with the backend via HTTP REST APIs (Axios) for standard operations (auth, profile updates) and Socket.IO for real-time chat features.
- Server (Backend): An Express.js application that processes API requests, manages authentication (Passport.js/JWT), and handles WebSocket connections.
- Database: MongoDB Atlas stores user data, chat history, and messages.
- External Services:
- Google OAuth: For secure third-party authentication.
- Cloudinary: For storing profile pictures.
graph TD
User([User])
Client["Frontend (React + Vite)"]
Server["Backend (Node/Express)"]
DB[("MongoDB Atlas")]
Google[Google OAuth]
Cloud[Cloudinary]
User -- "HTTPS" --> Client
Client -- "REST API (Axios)" --> Server
Client -- "Real-time (Socket.IO)" --> Server
Server <-->|Read/Write| DB
Server -- "Auth Strategy" --> Google
Server -- "Image Upload" --> Cloud
graph TD
Start([Start]) --> Login{Login / Register}
Login -- "Success" --> Dashboard[Dashboard]
Dashboard --> AddFriend[Add Friend]
Dashboard --> SelectChat[Select Chat]
AddFriend -- "Request Accepted" --> Chat[Chat Room]
SelectChat --> Chat
Chat --> SendMsg[Send Message]
The project is divided into two main directories:
- Frontend (
/frontend): Contains the React application source code, public assets, and build configurations.src/api: API integration logic.src/components: Reusable UI components.src/hooks: Custom React hooks.src/layouts: Page layout definitions.src/pages: Main application views/pages.src/store: Zustand state management stores.src/utils: Utility functions.
- Backend (
/backend): Contains the API server logic.config: Configuration files (e.g., DB connection).controllers: Logic for handling requests.middleware: Custom middleware (auth, error handling).models: Mongoose schemas for MongoDB.routes: API route definitions.
The application uses four main models in MongoDB to structure data:
- User:
name: User's name.email: Unique email (as identifier).password: Hashed password.profilePic: URL to profile picture.contacts: Array of other users' IDs who are friends.
- Chat:
users: Array of user IDs in the conversation.latestMessage: Reference to the latest message for sidebar preview.isGroupChat: Boolean indicating if itβs a group chat.
- Message:
sender: ID of the user who sent the message.content: Message content (text or encrypted data).chat: ID of the chat where the message belongs.readBy: Array of user IDs who have read the message.
- FriendRequest:
fromUser: ID of the user sending the request.toUser: ID of the user receiving the request.status: Request status ('pending', 'accepted', 'declined').
Prerequisites:
- Node.js (v18 or higher)
- NPM (Node Package Manager)
- MongoDB Atlas account
- Google Cloud Platform account (for OAuth credentials)
- Cloudinary account (for image storage)
Steps:
-
Clone the Repository
git clone https://github.com/ichramsyah/velochat-fullstack-webApp.git cd velochat-fullstack-webApp -
Set Up the Backend
cd backend npm installCreate a
.envfile in the/backendfolder and add all required environment variables (see "Technologies" section).Run the backend server:
npm run dev
-
Set Up the Frontend
Open a new terminal and, from the project root directory (
/velochat), run:cd frontend npm installCreate a
.envfile in the/frontendfolder and add:VITE_GOOGLE_CLIENT_ID=YOUR_GOOGLE_CLIENT_IDRun the frontend server:
npm run dev
-
Run via Docker (Optional)
If you prefer to run the entire application using Docker:
-
Ensure you have Docker and Docker Compose installed.
-
Create
.envfiles in both/backendand/frontenddirectories. -
Run the following command from the root directory:
docker-compose up --build
The application will be accessible at
http://localhost:3000. -
-
Access the Application
- Open
http://localhost:5173(Local) orhttp://localhost:3000(Docker) in your browser.
- Open
This project is licensed under the MIT License. See the License file for details.
Contributions are warmly welcomed! If youβd like to contribute to this project, please fork the repository and create a pull request with your proposed changes.
- Fork the Project
- Create Your Feature Branch (
git checkout -b feature/YourNewFeature) - Commit Your Changes (
git commit -m 'Add YourNewFeature') - Push to the Branch (
git push origin feature/YourNewFeature) - Open a Pull Request
Please adhere to our Code of Conduct and ensure your contributions align with VeloChatβs mission for constructive and respectful discussions.
Some ideas for future features to add:
- Group Chat: Full functionality for creating and managing group chats.
- File Sharing: Sending files beyond images (PDF, DOCX, etc.).
- Online/Offline Status: Displaying user online status indicators.
- Message Search: Feature to search messages within a conversation.
- Emoji Picker: Adding an emoji selection option to the message input.
Ichramsyah Abdurrachman - ichramsyahabdurrachman@gmail.com
Project Link: https://github.com/ichramsyah/velochat-fullstack-webApp.git
