A modern microservices architecture with Go backend services and React TypeScript frontend, featuring real-time analytics and audit logging.
- 🔐 Authentication & Authorization
- 📊 Real-time Analytics
- 📝 Audit Logging
- 🎯 Event Tracking
- 🖥️ Modern Dashboard
- 🔄 Hot Reload Development
- 🐳 Docker Support
-
Backend: Main API service (Go/Gin)
- Authentication & Authorization
- User Management
- Event Publishing
-
Analytics: Event tracking service (Go/ClickHouse)
- Page Views
- User Actions
- API Requests
- Custom Events
-
Audit Logs: Activity logging service (Go/ClickHouse)
- User Actions
- Resource Access
- Security Events
- System Changes
-
Dashboard: Admin interface (React/TypeScript)
- User Management
- Analytics Visualization
- Audit Log Viewer
- Real-time Updates
-
Backend
- Go 1.21+
- Gin Web Framework
- JWT Authentication
- PostgreSQL 16
- ClickHouse
- RabbitMQ
-
Frontend
- React 18
- TypeScript
- Tailwind CSS
- React Query
- Zustand
- React Router 6
-
Infrastructure
- Docker & Docker Compose
- Air (Hot Reload)
- Make
- Migrate
- Go 1.21+
- Node.js 18+
- Docker & Docker Compose
- Make
- Clone and setup:
git clone <repository-url>
cd go-hyper
cp .env.example .env
- Start infrastructure and run migrations:
make docker-up
make init-db
- Start all services in development mode:
make dev-all
- Access the services:
- Dashboard: http://localhost:5173
- Backend API: http://localhost:8080
- Analytics API: http://localhost:8081
- Audit Logs API: http://localhost:8082
make dev-all
: Start all services with hot reloadmake dev-backend
: Start backend service onlymake dev-analytics
: Start analytics service onlymake dev-audit-logs
: Start audit logs service onlymake dev-dashboard
: Start dashboard onlymake build
: Build all servicesmake test
: Run testsmake docker-up
: Start infrastructure servicesmake docker-down
: Stop infrastructure servicesmake migrate-up
: Run database migrationsmake migrate-down
: Revert migrationsmake kill-ports
: Kill processes using service ports
- Backend: 8080
- Analytics: 8081
- Audit Logs: 8082
- Dashboard: 5173 (dev) / 80 (prod)
- PostgreSQL: 5432
- ClickHouse: 8123/9000
- RabbitMQ: 5672/15672 (Management: 15672)
Admin:
- Email: admin@example.com
- Password: password123
User:
- Email: user@example.com
- Password: password123
.
├── migrations/ # Database migrations
├── pkg/ # Shared packages
│ ├── auth/ # Authentication utilities
│ ├── database/ # Database clients
│ ├── events/ # Event publishing
│ ├── models/ # Shared data models
│ ├── queue/ # Message queue utilities
│ └── utils/ # Common utilities
├── scripts/ # Utility scripts
├── services/ # Microservices
│ ├── analytics/ # Analytics service
│ ├── audit-logs/ # Audit logging service
│ ├── backend/ # Main API service
│ └── dashboard/ # Frontend application
└── docker-compose.yml # Infrastructure setup
- POST
/api/auth/login
: User login - POST
/api/auth/register
: User registration
- GET
/api/user/profile
: Get user profile - GET
/api/admin/users
: List all users (admin only)
- GET
/api/analytics/events
: Get user analytics events - POST
/track
: Track events
- GET
/api/audit/logs
: Get user audit logs - POST
/audit
: Log audit events
- Page Views
- API Requests
- User Login/Logout
- User Registration
- Custom Events
- Authentication attempts
- Resource access
- User actions
- System changes
Key environment variables (see .env
for full list):
# Service Ports
BACKEND_PORT=8080
ANALYTICS_PORT=8081
AUDIT_LOGS_PORT=8082
# PostgreSQL
DB_HOST=localhost
DB_PORT=5432
DB_USER=postgres
DB_PASSWORD=postgres
DB_NAME=go_turbo
# RabbitMQ
RABBITMQ_URL=amqp://guest:guest@localhost:5672
# ClickHouse
CLICKHOUSE_HOST=localhost:9000
CLICKHOUSE_DATABASE=default
CLICKHOUSE_USER=default
CLICKHOUSE_PASSWORD=
# Frontend
VITE_API_URL=http://localhost:8080
Build and run with Docker:
docker-compose up -d
MIT