📖 Project Overview
The KeepTrack Database Service is a comprehensive backend API built with Go and GoFiber framework, designed to manage organizational assets, user access, and business operations. The service provides RESTful APIs for three main interfaces: Core, Console, and Dashboard.
🏗️ Architecture
- Framework: GoFiber (Fast HTTP framework for Go)
- Database: Supabase (PostgreSQL with real-time features)
- Authentication: JWT-based authentication system
- Containerization: Docker with multi-stage builds
- Deployment: GitHub Actions CI/CD to VPS
🎯 Key Features
- Multi-tenant organization management
- Role-based access control (RBAC)
- Asset tracking and management
- User management and authentication
- Service provider integration
- Real-time database operations
⚙️ Setup & Installation
Prerequisites
- Go 1.24.4 or higher
- Docker and Docker Compose
- Supabase project setup
Environment Variables
Local Development
git clone [repository-url]cd databasego mod downloadgo run main.go
Docker Deployment
docker compose up -d --build
🔐 Authentication
The API uses JWT (JSON Web Tokens) for authentication. All protected endpoints require a valid JWT token in the Authorization header.
Authentication Flow
- User registers/logs in via authentication endpoints
- Server validates credentials and returns JWT token
- Client includes JWT token in subsequent requests
- Server validates token and grants access
Token Format
🏢 Core APIs
Core APIs handle fundamental business operations including organizations, branches, users, and authentication.
📦 Assets APIs
Assets APIs manage inventory items, categories, and asset tracking operations.
🖥️ Console APIs
Console APIs provide administrative functions for system management and user access control.
📊 Dashboard APIs
Dashboard APIs provide data for analytics, reporting, and user dashboard interfaces.
🏥 Health Check
Monitor the health and status of the database service and its connections.
🔍 Service Status
🗄️ Database Connection
📊 System Info
🔐 API Testing Interface (Postman-like)
Comprehensive API testing interface with JWT authentication and database connection testing.
🔐 Authentication Setup
📡 API Request Builder
🚀 Quick API Tests
📋 Response
🚀 Deployment
Docker Deployment
docker compose up -d --build
GitHub Actions CI/CD
The service uses GitHub Actions for automated deployment to VPS. Deployment is triggered by tag changes.
Health Check
Port Configuration
- Default Port: 8100
- Health Check: Every 30 seconds
- Resource Limits: 512MB RAM, 0.5 CPU