GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com โ€” GitHub - togisoft/t-force

BranchesTags
Open more actions menu

Latest commit

 

History

3 Commits
3 Commits

Folders and files

NameName
Last commit message
Last commit date
.idea
.idea
 
 
assets
assets
 
 
backend
backend
 
 
frontend
frontend
 
 
monitoring
monitoring
 
 
scripts
scripts
 
 
target
target
 
 
.DS_Store
.DS_Store
 
 
.env.template
.env.template
 
 
.gitignore
.gitignore
 
 
Cargo.lock
Cargo.lock
 
 
Cargo.toml
Cargo.toml
 
 
DOCKER_README.md
DOCKER_README.md
 
 
README.md
README.md
 
 
docker-compose.dev.yml
docker-compose.dev.yml
 
 
docker-compose.prod.yml
docker-compose.prod.yml
 
 
env.prod.example
env.prod.example
 
 
ws-latency-test.html
ws-latency-test.html
 
 
ws-latency-test.js
ws-latency-test.js
 
 

Repository files navigation

๐Ÿ” T-Force - Modern Authentication & Chat Platform

T-Force Logo

Rust Next.js TypeScript PostgreSQL Docker License

๐Ÿ“ธ Screenshots

T-Force Dashboard
T-Force Dashboard
T-Force Dashboard
## ๐Ÿ“‹ Table of Contents
  • ๐ŸŽฏ About the Project
  • โœจ Features
  • ๐Ÿ› ๏ธ Technology Stack
  • ๐Ÿ—๏ธ Architecture
  • ๐Ÿš€ Installation
  • ๐Ÿ“ฑ Usage
  • ๐Ÿ”ง Development
  • ๐Ÿ“Š API Documentation
  • ๐Ÿ”’ Security
  • ๐Ÿค Contributing
  • ๐Ÿ“„ License

๐ŸŽฏ About the Project

T-Force is a comprehensive authentication and real-time chat platform developed for modern web applications. It provides a high-performance, secure, and scalable solution using Rust backend and Next.js frontend.

๐ŸŽฏ Goals

  • Security: Modern encryption and authentication standards
  • Performance: Rust's speed and Next.js optimizations
  • Scalability: Microservice architecture and Docker support
  • User Experience: Modern UI/UX design

โœจ Features

๐Ÿ” Authentication

  • โœ… Email/Password Login: Secure user registration and login
  • โœ… OAuth Integration: Social login with Google and GitHub
  • โœ… Two-Factor Authentication (2FA): TOTP-based security
  • โœ… Password Reset: Secure password reset via email
  • โœ… Session Management: Multi-session control and termination
  • โœ… JWT Token System: Secure token-based authentication

๐Ÿ’ฌ Real-Time Chat

  • โœ… WebSocket Connection: Instant messaging
  • โœ… Room System: Private and public chat rooms
  • โœ… Media Sharing: Image, video, and voice messages
  • โœ… Message History: Persistent message storage
  • โœ… Room Passwords: Secure private rooms
  • โœ… Auto Reconnection: Automatic recovery on connection loss

๐Ÿ‘ฅ User Management

  • โœ… Profile Management: User information and profile pictures
  • โœ… Role-Based Authorization: Admin and user roles
  • โœ… User Status: Active/inactive user control
  • โœ… Admin Panel: User management and system control

๐Ÿ›ก๏ธ Security Features

  • โœ… Rate Limiting: API request rate limiting
  • โœ… CORS Protection: Cross-origin request security
  • โœ… SQL Injection Protection: ORM-based secure database operations
  • โœ… XSS Protection: Frontend security measures
  • โœ… Password Hashing: Secure password storage with Argon2

๐Ÿ› ๏ธ Technology Stack

๐Ÿฆ€ Backend (Rust)

# Core Framework
actix-web = "4.4.0"          # Web framework
actix-cors = "0.7.1"         # CORS middleware
actix-web-actors = "4.2.0"   # WebSocket support

# Database
sea-orm = "1.1.14"           # ORM
postgres = "16-alpine"       # Database

# Authentication
jsonwebtoken = "9.3.1"       # JWT token
argon2 = "0.5.2"             # Password hashing
oauth2 = "4.4.2"             # OAuth integration

# Other
serde = "1.0.188"            # Serialization
tokio = "1.32.0"             # Async runtime
lettre = "0.11.18"           # Email sending

โš›๏ธ Frontend (Next.js)

{
  "next": "15.5.0",              // React framework
  "react": "19.0.0",            // UI library
  "typescript": "5.0+",         // Type safety
  "tailwindcss": "3.4.0",       // CSS framework
  "shadcn/ui": "latest",        // UI components
  "react-hook-form": "7.62.0",  // Form management
  "jwt-decode": "4.0.0",        // JWT parsing
  "lucide-react": "0.541.0"     // Icons
}

๐Ÿ—„๏ธ Database & Infrastructure

  • PostgreSQL 16: Primary database
  • Docker & Docker Compose: Containerization
  • Traefik: Reverse proxy and load balancer
  • Nginx (production): Static file serving
  • Let's Encrypt: Automatic SSL certificates

๐Ÿ”„ DevOps & Monitoring

  • GitHub Actions: CI/CD pipeline
  • Prometheus: Metrics collection
  • Grafana: Monitoring dashboard
  • Docker Health Checks: Service monitoring
  • Automated Backups: Database backup scripts
  • Log Aggregation: Structured logging

๐Ÿ› ๏ธ Development Tools

  • Cargo: Rust package manager
  • npm/yarn: Node.js package manager
  • ESLint & Prettier: Code formatting
  • TypeScript: Type checking
  • Sea-ORM: Database ORM
  • Actix-Web: Web framework
  • Tailwind CSS: Utility-first CSS
  • Shadcn/UI: Component library

๐Ÿ—๏ธ Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚   Frontend      โ”‚    โ”‚    Traefik      โ”‚    โ”‚    Backend      โ”‚
โ”‚   (Next.js)     โ”‚โ—„โ”€โ”€โ–บโ”‚  (Reverse Proxy)โ”‚โ—„โ”€โ”€โ–บโ”‚    (Rust)       โ”‚
โ”‚   Port: 3000    โ”‚    โ”‚   Port: 80      โ”‚    โ”‚   Port: 8080    โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
         โ”‚                       โ”‚                       โ”‚
         โ”‚                       โ”‚                       โ”‚
         โ–ผ                       โ–ผ                       โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚   Static Files  โ”‚    โ”‚   Load Balancer โ”‚    โ”‚   PostgreSQL    โ”‚
โ”‚   & Assets      โ”‚    โ”‚   & SSL/TLS     โ”‚    โ”‚   Database      โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿ“ก API Endpoints

๐Ÿ” Authentication

POST   /api/auth/register     # User registration
POST   /api/auth/login        # Login
POST   /api/auth/logout       # Logout
GET    /api/auth/validate     # Token validation
POST   /api/auth/forgot       # Password reset request
POST   /api/auth/reset        # Password reset

๐Ÿ‘ค User Management

GET    /api/user/me           # Get user information
PUT    /api/user/profile      # Update profile
POST   /api/user/avatar       # Upload profile picture
GET    /api/user/sessions     # Active sessions
DELETE /api/user/session/:id  # Terminate session

๐Ÿ’ฌ Chat System

GET    /api/chat/rooms        # Get chat rooms
POST   /api/chat/rooms        # Create a new room
GET    /api/chat/rooms/:id    # Get room details
DELETE /api/chat/rooms/:id    # Delete room
GET    /api/chat/messages     # Get message history
POST   /api/chat/upload       # Upload media
WS     /ws                    # WebSocket connection

๐Ÿš€ Installation

๐Ÿ“‹ Requirements

  • Docker & Docker Compose: Container management
  • Git: Version control
  • Node.js 18+: Frontend development (optional)
  • Rust 1.70+: Backend development (optional)

๐Ÿ”ง Quick Start

  1. Clone the project
git clone https://github.com/togisoft/t-force.git
cd t-force
  1. Create environment file
cp env.prod.example .env.prod
# Edit the .env.prod file
  1. Start development environment
# For development
cp env.prod.example .env.dev
./scripts/dev.sh

# For production
./scripts/prod-deploy.sh
  1. Access the application
  • Frontend: http://localhost
  • Backend API: http://localhost/api
  • Traefik Dashboard: http://localhost:8080
  • Grafana: http://grafana.localhost

๐Ÿณ Production Deployment

# Create production environment file
cp env.prod.example .env.prod

# Start in production mode
./scripts/prod-deploy.sh

๐Ÿ“ฑ Usage

๐Ÿ‘ค User Registration and Login

  1. Click on "Sign Up" tab on the main page
  2. Enter email, name and a strong password
  3. Complete email verification
  4. Sign in or use OAuth for quick login

๐Ÿ’ฌ Chat Usage

  1. Access the dashboard
  2. Click on "New Room" button
  3. Set room name and password (optional)
  4. Invite friends by sharing the room code
  5. Start sending messages, images, videos and audio

๐Ÿ”’ Security Settings

  1. Go to profile settings
  2. Open "Two-Factor Authentication" section
  3. Scan QR code and enter verification code
  4. Store your backup codes in a safe place

๐Ÿ”ง Development

๐Ÿ”ง Development Environment Setup

# Backend development
cd backend
cargo run

# Frontend development
cd frontend
npm install
npm run dev

# Database migration (handled automatically by prod-deploy.sh)

๐Ÿงช Running Tests

# Backend tests
cd backend
cargo test

# Frontend tests
cd frontend
npm test

# E2E tests
npm run test:e2e

๐Ÿ“œ Available Scripts

All scripts should be run from the project root directory:

# Start development environment
./scripts/dev.sh

# Start production environment
./scripts/prod-deploy.sh

# Create backup
./scripts/backup.sh

# View logs
./scripts/logs.sh

# Stop services
./scripts/stop.sh

# Reset environment
./scripts/reset.sh

๐Ÿ“ Code Standards

Rust (Backend)

# Format check
cargo fmt --check

# Linting
cargo clippy -- -D warnings

# Run tests
cargo test

TypeScript (Frontend)

# Format check
npm run lint

# Type checking
npm run type-check

# Build test
npm run build

๐Ÿ“Š API Documentation

๐Ÿ” Authentication Endpoints

POST /api/auth/register

{
  "name": "John Doe",
  "email": "[email protected]",
  "password": "securePassword123"
}

POST /api/auth/login

{
  "email": "[email protected]",
  "password": "securePassword123"
}

Response:

{
  "user": {
    "id": "uuid",
    "email": "[email protected]",
    "name": "John Doe",
    "role": "user"
  },
  "token": "jwt_token_here"
}

๐Ÿ’ฌ Chat WebSocket Events

Client โ†’ Server

{
  "type": "join_room",
  "room_id": "room_uuid",
  "password": "optional_password"
}

{
  "type": "send_message",
  "room_id": "room_uuid",
  "content": "Hello, world!",
  "message_type": "text"
}

Server โ†’ Client

{
  "type": "message",
  "data": {
    "id": "message_uuid",
    "user": {
      "id": "user_uuid",
      "name": "John Doe"
    },
    "content": "Hello, world!",
    "timestamp": "2024-01-01T12:00:00Z"
  }
}

๐Ÿ”’ Security

๐Ÿ›ก๏ธ Security Measures

  • Password Hashing: Argon2 algorithm
  • JWT Token: Secure token-based authentication
  • Rate Limiting: API request rate limiting
  • CORS: Cross-origin request security
  • SQL Injection: Protection via ORM usage
  • XSS: Frontend sanitization

๐Ÿ” Environment Variables

# Critical security settings
NEXTAUTH_SECRET=your-super-secret-key
JWT_SECRET=your-jwt-secret
DATABASE_URL=postgres://user:pass@localhost/db

# OAuth settings
GOOGLE_CLIENT_ID=your-google-client-id
GOOGLE_CLIENT_SECRET=your-google-client-secret
GITHUB_CLIENT_ID=your-github-client-id
GITHUB_CLIENT_SECRET=your-github-client-secret

๐Ÿšจ Security Recommendations

  1. Use strong passwords
  2. Enable 2FA
  3. Keep environment variables secure
  4. Use HTTPS (in production)
  5. Perform regular updates

๐Ÿค Contributing

  1. Fork the project
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

๐Ÿ“‹ Contribution Guidelines

  • Follow code standards
  • Write tests
  • Update documentation
  • Write descriptive commit messages

๐Ÿ“„ License

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


Developed with โค๏ธ

๐Ÿ› Bug Report | ๐Ÿ’ฌ Discussions | ๐Ÿ“– Wiki

About

tforce.codelungo.com/

Topics

2factor-authenticationactix-webactix-web-middlewareoauth2rustrust-authrust-authenticationrust-example

Resources

Readme
Activity

Stars

11 stars

Watchers

0 watching

Forks

1 fork
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 โ€” GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800ร—600. No cookies required.