Skip to content

alokumar01/dev-clustra

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

34 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

DevClustra πŸš€

Real-time communication platform focused on backend architecture, real-time systems, containerized deployment, and DevOps workflows.


πŸ“– Overview

DevClustra is a real-time chat and collaboration platform built to explore modern backend engineering, distributed systems, and DevOps workflows.

The project focuses on:

  • Real-time communication using Socket.IO
  • JWT authentication architecture
  • Conversation-based messaging systems
  • Dockerized full-stack workflows
  • CI/CD integration using Jenkins
  • Cloud-native deployment practices
  • Scalable backend architecture

This project was designed to understand how modern communication systems work internally while integrating practical DevOps concepts used in production-grade environments.


✨ Features

πŸ” Authentication & Security

  • JWT Authentication
  • Access & Refresh Token flow
  • HTTP-only secure cookies
  • Persistent login sessions
  • Protected routes
  • Secure password hashing using bcrypt

πŸ’¬ Real-time Messaging

  • One-to-one conversations
  • Real-time message delivery
  • Online/offline user presence
  • Unread message tracking
  • Read receipts
  • Conversation-based chat architecture
  • Socket rooms for real-time updates

☁️ Cloud Media Support

  • Avatar uploads
  • Cloudinary integration
  • Secure media upload flow

⚑ Backend Architecture

Backend follows a modular architecture focused on scalability, maintainability, and separation of concerns.

Core architecture layers include:

  • Controllers
  • Services
  • Middlewares
  • Authentication Layer
  • Conversation Layer
  • Message Layer
  • Socket Layer

πŸ› οΈ Tech Stack

Frontend

  • Next.js
  • React
  • Tailwind CSS
  • shadcn/ui
  • Socket.IO Client
  • Zustand
  • Axios

Backend

  • Node.js
  • Express.js
  • MongoDB Atlas
  • Mongoose
  • Socket.IO
  • JWT
  • bcrypt
  • Cloudinary

DevOps & Cloud

  • Docker
  • Docker Compose
  • Docker Hub
  • Jenkins
  • AWS EC2 (planned)
  • Kubernetes (planned)
  • Terraform (planned)
  • Prometheus & Grafana (planned)

🐳 Containerization & DevOps

DevClustra is fully containerized using Docker to ensure consistent development and deployment workflows.

Implemented DevOps workflow includes:

  • Frontend Dockerization
  • Backend Dockerization
  • Docker Compose orchestration
  • Docker networking
  • Environment management
  • Docker Hub image registry
  • CI/CD integration workflow

πŸ—οΈ Container Architecture

Browser
   ↓
Frontend Container (Next.js)
   ↓
REST APIs + Socket.IO
   ↓
Backend Container (Node.js + Express)
   ↓
MongoDB Atlas

πŸ”„ CI/CD Workflow

Current CI/CD pipeline architecture:

GitHub Push
      ↓
Jenkins Pipeline
      ↓
Build Docker Images
      ↓
Push Images to Docker Hub
      ↓
Deployment Workflow

This workflow helps automate:

  • Build processes
  • Image generation
  • Deployment consistency
  • Environment reproducibility
  • Scalable deployment practices

πŸ—οΈ Application Architecture

Frontend (Next.js)
        ↓
REST APIs + Socket.IO
        ↓
Backend (Node.js + Express)
        ↓
MongoDB Atlas

πŸ“‚ Project Structure

dev-clustra/
β”‚
β”œβ”€β”€ client/
β”‚   β”œβ”€β”€ app/
β”‚   β”œβ”€β”€ components/
β”‚   β”œβ”€β”€ store/
β”‚   β”œβ”€β”€ services/
β”‚   β”œβ”€β”€ lib/
β”‚   β”œβ”€β”€ public/
β”‚   β”œβ”€β”€ Dockerfile
β”‚   β”œβ”€β”€ .dockerignore
β”‚   β”œβ”€β”€ .env.local
β”‚   └── .env.docker
β”‚
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ config/
β”‚   β”‚   β”œβ”€β”€ modules/
β”‚   β”‚   β”‚   β”œβ”€β”€ auth/
β”‚   β”‚   β”‚   β”œβ”€β”€ user/
β”‚   β”‚   β”‚   β”œβ”€β”€ conversation/
β”‚   β”‚   β”‚   └── message/
β”‚   β”‚   β”œβ”€β”€ middlewares/
β”‚   β”‚   β”œβ”€β”€ helpers/
β”‚   β”‚   β”œβ”€β”€ routes/
β”‚   β”‚   β”œβ”€β”€ socket-server.js
β”‚   β”‚   └── app.js
β”‚   β”‚
β”‚   β”œβ”€β”€ Dockerfile
β”‚   β”œβ”€β”€ .dockerignore
β”‚   β”œβ”€β”€ .env
β”‚   └── server.js
β”‚
β”œβ”€β”€ docker-compose.yml
└── README.md

βš™οΈ Environment Variables

Frontend .env.local

NEXT_PUBLIC_API_BASE_URL=http://localhost:5000/api/v1

Frontend .env.docker

NEXT_PUBLIC_API_BASE_URL=http://localhost:5000/api/v1

Backend .env

PORT=
MONGO_URI=

JWT_SECRET=
JWT_ACCESS_TOKEN_EXPIRES=
JWT_REFRESH_TOKEN_EXPIRES=

CLIENT_URL=

CLOUDINARY_CLOUD_NAME=
CLOUDINARY_API_KEY=
CLOUDINARY_API_SECRET=

RESEND_API_KEY=

πŸš€ Local Development Setup

1. Clone Repository

git clone https://github.com/alokumar01/dev-clustra.git

2. Install Dependencies

Frontend

cd client
pnpm install

Backend

cd backend
pnpm install

3. Run Development Servers

Frontend

pnpm dev

Backend

pnpm dev

🐳 Docker Setup

Build & Run Containers

docker compose up --build

Stop Containers

docker compose down

πŸ“¦ Docker Hub Integration

Docker images are pushed to Docker Hub for deployment and CI/CD workflows.

Docker Hub repositories:

aalokumar01/dev-clustra-frontend
aalokumar01/dev-clustra-backend

Docker workflow:

Dockerfile
    ↓
Docker Build
    ↓
Docker Image
    ↓
Docker Hub Push
    ↓
Deployment Workflow

☁️ Deployment Roadmap

Current

  • Dockerized frontend & backend
  • Docker Compose orchestration
  • Docker networking
  • Docker Hub workflow
  • Jenkins CI/CD integration

Planned

  • AWS EC2 deployment
  • Kubernetes orchestration
  • Terraform infrastructure provisioning
  • Monitoring using Prometheus & Grafana
  • Redis integration

🧠 Engineering Concepts Explored

This project focuses heavily on understanding:

  • Real-time system design
  • WebSocket architecture
  • JWT authentication flow
  • Refresh token mechanisms
  • Socket rooms & presence systems
  • Containerized workflows
  • Docker networking
  • CI/CD pipelines
  • Cloud deployment workflows
  • Modular backend architecture
  • Scalable infrastructure concepts

🎯 Learning Goals

DevClustra was built to explore practical software engineering concepts beyond traditional CRUD applications.

Primary focus areas include:

  • Backend engineering
  • Real-time communication systems
  • DevOps workflows
  • Container orchestration concepts
  • Cloud deployment workflows
  • Scalable architecture design

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

Alok Kumar

  • Full Stack & DevOps Enthusiast
  • Focused on Backend Engineering, Cloud, and Real-time Systems

GitHub

https://github.com/alokumar01

Portfolio

https://whoisalok.tech

Project Repository

https://github.com/alokumar01/dev-clustra

About

My Project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors