Skip to content

Latest commit

 

History

13 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Real-Time Chat Application

A high-performance, real-time chat application built with Go and the Fiber v3 framework. This application features secure user authentication, private messaging, a real-time friend list, and persistent message history.

🚀 Key Features

  • Real-Time Messaging: Bi-directional communication using WebSockets (Fiber v3 extension).
  • Private Conversations: Instant 1-on-1 chats between friends.
  • Friend List: Dynamic sidebar to find and start chats with other users.
  • Message History: Persistent storage of all conversations using PostgreSQL.
  • Secure by Design:
    • CSRF Protection (Token-based).
    • Session Management with Redis.
    • Secure Password Hashing (Bcrypt).
    • Auth Middleware for route protection.
  • Modern UI: Clean, responsive dashboard designed with Bootstrap 5 and Bootstrap Icons.
  • Responsive Layout: Mobile-first design that adapts seamlessly to all screen sizes.

🛠️ Technology Stack

📋 Prerequisites

  • Go 1.21+ installed.
  • PostgreSQL instance running.
  • Redis instance running.

📦 Getting Started

  1. Clone the repository:

    git clone https://github.com/putra4648/my-chat-app.git
    cd my-chat-app
  2. Environment Variables: Create a .env file in the root directory and configure your connection strings:

    DATABASE_URL=postgres://user:password@localhost:5432/chat_db
    REDIS_URL=localhost:6379
    PORT=3000
  3. Install Dependencies:

    go mod download
  4. Initialize Database: Run the migration SQL located in migrations/001_create_table.sql.

  5. Run the Application:

    go run cmd/main.go
  6. Access the App: Open http://localhost:3000 in your browser.

🏗️ Project Architecture

The project follows a clean, modular structure:

  • /cmd: Application entry point.
  • /internal/app: Main application setup and dependency orchestration.
  • /internal/configs: Modular middleware configurations (CORS, CSRF, Session, etc.).
  • /internal/handlers: Route handlers organized by domain (Auth, Dashboard, WS).
  • /internal/repositories: Data access layer using PostgreSQL.
  • /internal/services: Business logic layer.
  • /internal/middleware: Custom security and system middlewares.
  • /views: HTML templates and frontend assets.

Built with ❤️ by Antigravity

About

Simple Chat System

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages