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.
- 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.
- Framework: React (Vite)
- Language: TypeScript
- State Management: React Context API
- Routing: React Router v7
- Icons: Phosphor React
- Notifications: React Hot Toast
- Communication: Socket.io-client, Axios
- Runtime: Node.js
- Framework: Express
- Real-time: Socket.io
- Database: PostgreSQL
- ORM/Query Builder: Knex.js
- Validation: Zod
- Logging: Winston
- Auth: JWT (JSON Web Tokens) & Bcrypt
- Node.js (v20+)
- Yarn or NPM
- Docker (optional, for database)
You can use Docker to quickly start a PostgreSQL instance:
cd server
docker-compose up -d- Navigate to the server directory:
cd server - Install dependencies:
yarn install
- Configure environment variables (create
.envfrom.env.example):cp .env.example .env
- Run migrations:
yarn migrate
- Start the server:
yarn build yarn start
- Navigate to the client directory:
cd client - Install dependencies:
yarn install
- Configure environment variables (create
.envfrom.env.example):cp .env.example .env
- Start the development server:
yarn dev
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.
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.
- Users: Authentication details (username, hashed password).
- Messages: Chat history (content, author, timestamp).
- Profiles: User-specific information (descriptions).
- Notifications: Persistent user alerts.
This project is licensed under the MIT License. See the LICENSE file for details.
Developed with ❤️ by tosuki