Skip to content

Production-ready real-time chat platform with Spring Boot 3, Vue 3, and MongoDB. Features WebSocket messaging, JWT authentication, Docker deployment, and comprehensive security practices.

License

Notifications You must be signed in to change notification settings

sreenathyadavk/chatify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ’¬ Chatify - Enterprise-Grade Real-Time Chat Platform

Production-Ready β€’ Scalable β€’ Secure

License PRs Welcome Deployment

Documentation β€’ Architecture β€’ API Docs β€’ VPS Deployment Guide


🎯 Project Overview

Chatify is a production-ready, enterprise-grade real-time chat application built with modern technologies and best practices. This project demonstrates proficiency in full-stack development, microservices architecture, security implementation, and DevOps practices.

Built to impress: This isn't just another chat appβ€”it's a showcase of production-ready engineering with security, scalability, and deployment automation at its core.

✨ What Makes This Special

  • πŸ—οΈ Production-Ready Architecture - Microservices design with Docker containerization
  • πŸ” Security-First - JWT authentication, encrypted credentials, HTTPS/SSL ready
  • πŸš€ Real-Time Performance - WebSocket-based instant messaging with STOMP protocol
  • πŸ“Š Observability - Health checks, metrics, and monitoring endpoints
  • πŸ”„ DevOps Ready - Automated deployment, backup scripts, CI/CD compatible
  • 🎨 Modern UI/UX - Responsive Vue 3 frontend with TailwindCSS

πŸ› οΈ Tech Stack

Backend

Spring Boot Java 17 MongoDB WebSocket JWT

Frontend

Vue.js Vite TailwindCSS Pinia Axios

DevOps & Infrastructure

Docker Nginx Let's Encrypt GitHub Actions


πŸ—οΈ Architecture

graph TB
    Client[Client Browser] -->|HTTPS| Nginx[Nginx Reverse Proxy]
    Nginx -->|/api/*| Backend[Spring Boot Backend]
    Nginx -->|/ws| Backend
    Nginx -->|/| Frontend[Vue 3 SPA]
    Backend -->|CRUD Operations| MongoDB[(MongoDB)]
    Backend -->|WebSocket| Client
    
    subgraph "Docker Network"
        Nginx
        Backend
        MongoDB
        Frontend
    end
    
    style Client fill:#4FC08D
    style Nginx fill:#009639
    style Backend fill:#6DB33F
    style Frontend fill:#4FC08D
    style MongoDB fill:#47A248
Loading

Key Design Decisions:

  • Microservices Architecture - Independently scalable services
  • Reverse Proxy Pattern - Nginx for SSL termination and load balancing
  • Stateless Backend - JWT tokens for horizontal scalability
  • Container Orchestration - Docker Compose for easy deployment

See ARCHITECTURE.md for detailed design documentation.


πŸš€ Features

Core Functionality

  • βœ… Real-Time Messaging - Instant message delivery via WebSockets
  • βœ… User Authentication - Secure JWT-based auth with refresh tokens
  • βœ… Persistent Chat History - MongoDB-backed message storage
  • βœ… Online Status - Live user presence tracking
  • βœ… Multiple Chat Rooms - Support for one-on-one conversations
  • βœ… Responsive Design - Mobile-first UI that works everywhere

Security Features πŸ”

  • βœ… JWT Authentication - Secure token-based authentication
  • βœ… Password Hashing - BCrypt password encryption
  • βœ… HTTPS/TLS Ready - SSL certificate configuration included
  • βœ… CORS Protection - Configurable cross-origin resource sharing
  • βœ… Security Headers - XSS, CSP, HSTS headers configured
  • βœ… Environment Variables - Secrets externalized and protected
  • βœ… Input Validation - Server-side validation on all endpoints

DevOps & Operations πŸ”§

  • βœ… Docker Containerization - Multi-stage builds for optimization
  • βœ… Health Checks - Automated container health monitoring
  • βœ… Automated Backups - Scheduled MongoDB backup scripts
  • βœ… Monitoring Endpoints - Spring Boot Actuator integration
  • βœ… Log Management - Structured logging with configurable levels
  • βœ… One-Command Deployment - Automated deployment scripts
  • βœ… Security Validation - Pre-deployment security checks

Code Quality πŸ“Š

  • βœ… Clean Architecture - Separation of concerns, layered design
  • βœ… RESTful API - Standard HTTP methods and status codes
  • βœ… Error Handling - Comprehensive exception handling
  • βœ… Unit Tests - JUnit tests for critical components
  • βœ… API Documentation - OpenAPI/Swagger integration
  • βœ… Type Safety - TypeScript-like structure with Pinia stores

πŸ“Έ Screenshots

Login & Registration

Login Page Register Page

Chat Interface

Chat Interface - Dark Mode Chat Interface - Light Mode

Real-Time Messaging Demo

Real-Time Chat Demo


⚑ Quick Start

Prerequisites

  • Docker & Docker Compose installed
  • 2GB+ RAM available
  • Ports 3000 and 4000 available

Installation

# 1. Clone the repository
git clone https://github.com/YOUR_USERNAME/chatify.git
cd chatify

# 2. Configure environment variables
cp .env.example .env

# Edit .env and set secure credentials
# Generate secure values:
# MongoDB password: openssl rand -base64 32
# JWT secret: openssl rand -base64 64
nano .env

# 3. Validate security configuration
./validate-security.sh

# 4. Deploy with Docker
./deploy.sh

# 5. Verify deployment
curl http://localhost:4000/actuator/health

Access the application:


πŸ“š Documentation

Document Description
DEPLOYMENT.md Complete deployment guide with Docker
VPS_DEPLOYMENT_GUIDE.md Step-by-step VPS deployment with HTTPS
ARCHITECTURE.md System architecture and design decisions
API_DOCS.md REST API endpoint documentation
CONTRIBUTING.md Contribution guidelines

πŸ” Security

Security is a top priority. This project implements:

  • Authentication: JWT with access & refresh tokens
  • Encryption: BCrypt password hashing, HTTPS/TLS support
  • Secrets Management: Environment variables, never committed to Git
  • Input Validation: Server-side validation on all inputs
  • Security Headers: XSS protection, CSP, HSTS, frame options
  • Database Security: MongoDB authentication, internal network only
  • Container Security: Non-root users, minimal attack surface

Security Validation: Run ./validate-security.sh before deployment to catch common security issues.


πŸš€ Deployment

Local Development

# Backend (Spring Boot)
cd server
mvn spring-boot:run

# Frontend (Vue 3)
cd client
npm install
npm run dev

Production Deployment (Docker)

# One-command deployment
./deploy.sh

# Or manually
docker compose up -d --build

VPS Deployment

Complete guide with HTTPS/SSL setup available in VPS_DEPLOYMENT_GUIDE.md

Includes:

  • Ubuntu server setup
  • Docker installation
  • SSL certificate (Let's Encrypt)
  • Automated backups
  • Firewall configuration
  • Monitoring setup

πŸ“Š Performance & Metrics

  • Build Time: ~49 seconds (multi-stage Docker build)
  • Startup Time: ~60 seconds (all services)
  • Container Size:
    • Backend: ~250MB (Alpine-based JRE)
    • Frontend: ~45MB (Nginx Alpine)
    • MongoDB: ~700MB
  • Response Time: <100ms (REST API)
  • WebSocket Latency: <50ms (real-time messaging)
  • Memory Usage: ~500MB (all containers combined)

πŸ§ͺ Testing

# Run backend tests
cd server
mvn test

# Run frontend tests (if configured)
cd client
npm run test

# Security validation
./validate-security.sh

Test Coverage:

  • Unit tests for core services
  • Integration tests for API endpoints
  • Security validation scripts

🀝 Contributing

Contributions are welcome! Please read CONTRIBUTING.md for details on our code of conduct and the process for submitting pull requests.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

πŸ“ API Examples

Register a New User

curl -X POST http://localhost:4000/auth/register \
  -H "Content-Type: application/json" \
  -d '{
    "username": "john_doe",
    "email": "john@example.com",
    "password": "SecurePass123"
  }'

Login

curl -X POST http://localhost:4000/auth/login \
  -H "Content-Type: application/json" \
  -d '{
    "username": "john_doe",
    "password": "SecurePass123"
  }'

Send a Message (WebSocket)

const socket = new SockJS('http://localhost:4000/ws');
const stompClient = Stomp.over(socket);

stompClient.connect({}, () => {
  stompClient.send('/app/chat', {}, JSON.stringify({
    senderId: 'user1',
    receiverId: 'user2',
    content: 'Hello, World!'
  }));
});

Complete API documentation: API_DOCS.md


πŸŽ“ What I Learned

Building this project taught me:

  • Full-Stack Development - End-to-end application development
  • Real-Time Communication - WebSocket protocol and STOMP
  • Security Best Practices - JWT, encryption, secure deployment
  • Microservices Architecture - Service separation and communication
  • Docker & Containerization - Multi-stage builds, orchestration
  • DevOps Practices - Automated deployment, monitoring, backups
  • Production Deployment - VPS setup, SSL, database backups
  • Modern Frontend - Vue 3 Composition API, state management

πŸ’Ό Why This Project Stands Out

βœ… Production-Ready - Not just a tutorial project, built for real deployment
βœ… Security-Conscious - Implements industry-standard security practices
βœ… Well-Documented - Extensive documentation for every aspect
βœ… Scalable Architecture - Designed to handle growth
βœ… DevOps Integration - Automated deployment and monitoring
βœ… Clean Code - Follows SOLID principles and best practices
βœ… Modern Tech Stack - Latest versions of frameworks and tools


πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


πŸ‘¨β€πŸ’» Author

Sreenath Yadav


πŸ™ Acknowledgments

  • Spring Boot team for the excellent framework
  • Vue.js community for the fantastic frontend tools
  • MongoDB for the flexible database solution
  • Docker for simplifying deployment
  • All open-source contributors

⭐ Star this repository if you found it helpful!

Built with ❀️ and a lot of β˜•

Report Bug β€’ Request Feature β€’ Discussions

About

Production-ready real-time chat platform with Spring Boot 3, Vue 3, and MongoDB. Features WebSocket messaging, JWT authentication, Docker deployment, and comprehensive security practices.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published