Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Real-time chat application with user authentication and messaging. Built with Node.js (Express), React/Next.js, and MongoDB.

Notifications You must be signed in to change notification settings

Utzig26/realtime-chat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

89 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Realtime Chat

Aplicação de chat em tempo real com WebSockets, autenticação e clustering.

Quick Start

git clone [email protected]:Utzig26/realtime-chat.git
cd realtime-chat
docker-compose up -d

Acesse: http://localhost:5000

Stack

  • Backend: Node.js + TypeScript + Express + Socket.IO + Cluster
  • Frontend: Next.js + TypeScript + Tailwind CSS
  • Database: MongoDB + Redis
  • Containerização: Docker + Docker Compose

Como Executar

Desenvolvimento

# Subir todos os serviços com hot reload
docker-compose up -d

# Verificar logs
docker-compose logs -f

Produção (para testar recomendo usar o de produção)

# Subir sem override (modo produção)
docker-compose -f docker-compose.yml up -d

Acesso

API/FRONT

Variáveis de Ambiente

Desenvolvimento

# Configurar API
cp api/.example.env api/.env

# Configurar Frontend  
cp front-end/.example.env front-end/.env

Produção

API (.env):

NODE_ENV=production
PORT=3000
MONGODB_URI=mongodb://mongo:27017/chat
REDIS_URL=redis://redis:6379
SALT_ROUNDS=12
COOKIE_DOMAIN=localhost

Frontend (.env):

NODE_ENV=production
NEXT_PUBLIC_API_URL=http://localhost:3000
NEXT_PUBLIC_SOCKET_URL=http://localhost:3000
NEXT_PUBLIC_WS_URL=ws://localhost:3000
NEXT_PUBLIC_APP_NAME=Realtime Chat
NEXT_PUBLIC_APP_VERSION=1.0.0
NEXT_PUBLIC_ENABLE_DEBUG=false

Estrutura

├── api/              # Backend (Node.js + Express + Socket.IO)
├── front-end/        # Frontend (Next.js)
├── docker-compose.yml
└── docker-compose.override.yml

Comandos Úteis

# Parar todos os serviços
docker-compose down

# Rebuild e subir
docker-compose up -d --build

# Logs específicos
docker-compose logs -f api
docker-compose logs -f frontend

About

Real-time chat application with user authentication and messaging. Built with Node.js (Express), React/Next.js, and MongoDB.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published