Webify
Microservices-based web application with user management and real-time chat. Built with Node.js, Express, MongoDB, React, and Nginx as API Gateway. Demonstrates clean microservices architecture with containerized deployment.
Timeline
Role
Status
CompletedTechnology Stack
Webify πΆπ¬
A microservices-based web application with user management and real-time chat, built using Node.js, Express, MongoDB, React, and Nginx as an API Gateway. This project demonstrates a clean microservices architecture with containerized deployment using Docker Compose.
π Tech Stack
- Frontend β React/Next.js
- Backend Services:
- User Service β Authentication, user profile (Express + MongoDB)
- Chat Service β Chat messages & channels (Express + MongoDB + Stream Chat)
- Gateway β Nginx reverse proxy (routes requests to microservices)
- Database β MongoDB
- Containerization β Docker & Docker Compose
ποΈ Architecture
ββββββββββββββ
Client (Browser) β β Frontend β
βββββββ¬βββββββ
β
βΌ
ββββββββββββββ
β Gateway β (Nginx, port 5001)
βββββββ¬βββββββ
βββββββββββββββββΌβββββββββββββββββ
β β
βΌ βΌ
βββββββββββββββββ βββββββββββββββββ
β User Service β β Chat Service β
β (port 3001) β β (port 3002) β
βββββββββ¬ββββββββ βββββββββ¬ββββββββ
β β
βΌ βΌ
βββββββββββββββββ βββββββββββββββββ
β MongoDB β β MongoDB β
βββββββββββββββββ βββββββββββββββββ
Gateway Routes:
/api/user/*β User Service/api/auth/*β User Service/api/chat/*β Chat Service
Gateway exposes a single entrypoint at http://localhost:5001/api/*
π Folder Structure
webify/
βββ frontend/ # React/Next.js frontend
βββ gateway/ # API Gateway (Nginx)
β βββ Dockerfile
β βββ nginx.conf
βββ services/
β βββ user-service/ # User & Auth service
β β βββ src/
β β β βββ routes/
β β β βββ controllers/
β β β βββ models/
β β β βββ index.js
β β βββ package.json
β βββ chat-service/ # Chat service
β β βββ src/
β β β βββ routes/
β β β βββ controllers/
β β β βββ models/
β β β βββ index.js
β β βββ package.json
βββ docker-compose.yml # Orchestrates services locally
βββ package.json # Root package.json (helper scripts)
βββ README.md
βοΈ Getting Started
1. Clone the repo
git clone https://github.com/your-username/webify.git
cd webify
2. Environment variables
Create .env files for each service based on the .env.example inside their folder:
services/user-service/.env
PORT=3001
MONGO_URL=mongodb://mongo:27017/userdb
JWT_SECRET=supersecret
services/chat-service/.env
PORT=3002
MONGO_URL=mongodb://mongo:27017/chatdb
3. Run with Docker Compose
docker-compose up --build
Endpoints:
- API Gateway: http://localhost:5001/api
- User Service: http://localhost:3001
- Chat Service: http://localhost:3002
- Frontend: http://localhost:5173
4. Shut down
docker-compose down
π NPM Scripts (root)
npm run dev # Run all services via docker-compose
npm run down # Stop all services
npm run logs # Follow logs
npm run frontend:build # Build frontend manually
npm run frontend:start # Start frontend locally (without docker)
β Features
- User authentication (JWT, token blacklist with TTL)
- Secure login/logout
- Profile management
- Real-time chat
- Microservices architecture with independent scaling
- API Gateway with Nginx
- MongoDB for persistence
- Docker Compose for orchestration
π€ Contributing
- Fork the repo
- Create feature branch (
git checkout -b feature/new-feature) - Commit changes (
git commit -m 'Add new feature') - Push to branch (
git push origin feature/new-feature) - Open Pull Request
π License
This project is licensed under the MIT License.
