How lamdx4/chat-chit-server works
Project type and purpose
• Chat-Chit Server is a backend for a real-time chat application built in Node.js/TypeScript.
• It exposes REST endpoints (Express) and WebSocket channels (Socket.IO) supporting group chats, 1:1 messaging, stories, friend management, file uploads, reactions, polls, read receipts, notifications, etc.
• Data is persisted in MySQL via TypeORM; caching/realtime scaling via Redis; file storage in AWS S3; authentication via JWT + Google OAuth.
File structure
• Entry point: index.ts initializes Express, Socket.IO, middleware, routes, infra (DB, Redis, S3).
• Layered architecture under src/:
• web/ → Presentation layer: Express controllers, routes, request DTOs & validators, middlewares, Socket.IO handlers.
• application/ → Business logic services (auth, user, group, story) and DTOs.
• core/ → Domain model: TypeORM entities (User, Message, GroupChat, Story, etc.), value objects (role priority).
• infras/ → Infrastructure services:
– infras/data → DataSource + repositories implement persistence
– infras/jwt → JWT provider & payload definitions
– infras/aws-s3 → S3 file storage service
– infras/google-auth → Google OAuth helper
– infras/redis → Redis client for caching & Socket.IO adapter
• shared-kernel/ → Cross-cutting utilities: config service, logger, decorators, shared types.
• Docker and GitHub Actions configs for containerization & CI/CD.
README for architectural insights
• Technology stack listing matches layers.
• Feature list highlights key subsystems: Authentication, Messaging (HTTP + WS), File Upload, Caching, External Integrations.
• Database schema shows core entities and relationships.