Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

154 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gophir 🐬

Gophir is a modern real-time web chat application built with TypeScript, React, and WebSockets. It features a robust authentication system, real-time messaging, and persistent user profiles.

Gophir Showcase


🚀 Features

  • Real-time Messaging: Instant communication powered by Socket.io.
  • Authentication: Secure JWT-based authentication with bcrypt password hashing.
  • User Profiles: Personalized user descriptions and profile management.
  • Notifications: Real-time and persistent notification system.
  • Responsive UI: Modern interface built with React and custom CSS.
  • Clean Architecture: Backend organized into UseCases, Repositories, and Providers.

🛠️ Tech Stack

Frontend

Backend


🏁 Getting Started

Prerequisites

  • Node.js (v20+)
  • Yarn or NPM
  • Docker (optional, for database)

1. Database Setup

You can use Docker to quickly start a PostgreSQL instance:

cd server
docker-compose up -d

2. Backend Setup

  1. Navigate to the server directory:
    cd server
  2. Install dependencies:
    yarn install
  3. Configure environment variables (create .env from .env.example):
    cp .env.example .env
  4. Run migrations:
    yarn migrate
  5. Start the server:
    yarn build
    yarn start

3. Frontend Setup

  1. Navigate to the client directory:
    cd client
  2. Install dependencies:
    yarn install
  3. Configure environment variables (create .env from .env.example):
    cp .env.example .env
  4. Start the development server:
    yarn dev

📂 Project Structure

Backend (/server)

  • src/controller: HTTP request handlers.
  • src/usecase: Business logic layer.
  • src/repositories: Data access layer.
  • src/socket: WebSocket event handlers and configuration.
  • src/factory: Dependency injection/factory patterns.

Frontend (/client)

  • src/components: Reusable UI components.
  • src/hooks: Custom React hooks (Session, Socket, Notifications).
  • src/page: Application pages and routing logic.
  • src/services: API and Socket communication services.

📊 Database Schema

  • Users: Authentication details (username, hashed password).
  • Messages: Chat history (content, author, timestamp).
  • Profiles: User-specific information (descriptions).
  • Notifications: Persistent user alerts.

📜 License

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


Developed with ❤️ by tosuki

About

A webchat written using TS + Sockets + React

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages