Technology Stack
GSign платформын технологийн стек.
Backend (Go)
| Technology | Version | Purpose |
|---|---|---|
| Go (Golang) | 1.21+ | Main backend language |
| Fiber v2 | Latest | High-performance web framework |
| PostgreSQL | 16 | Primary database (pgx driver) |
| MongoDB | 7 | Document storage, audit logs |
| Redis | 7 | Caching, sessions, queues |
| Asynq | Latest | Distributed task queue |
| AWS S3 | - | Document storage (aws-sdk-go-v2) |
Go Libraries
go
// Web Framework
github.com/gofiber/fiber/v2
// Database
github.com/jackc/pgx/v5 // PostgreSQL
go.mongodb.org/mongo-driver // MongoDB
// Authentication
github.com/golang-jwt/jwt/v5 // JWT
golang.org/x/crypto/bcrypt // Password hashing
// PKI & Crypto
crypto/x509 // X.509 certificates
github.com/digitorus/pkcs7 // PKCS#7 signatures
github.com/pdfcpu/pdfcpu // PDF manipulation
// Task Queue
github.com/hibiken/asynq // Background jobs
// Logging
github.com/rs/zerolog // Structured loggingFrontend (Next.js)
| Technology | Version | Purpose |
|---|---|---|
| Next.js | 14+ | React framework (App Router) |
| TypeScript | 5.x | Type safety |
| Tailwind CSS | 3.x | Utility-first styling |
| Shadcn/ui | Latest | Component library |
| Zustand | Latest | State management |
| TanStack Query | v5 | Data fetching & caching |
| React PDF | Latest | PDF document viewer |
| React Signature Canvas | Latest | Signature capture |
Frontend Structure
gsign-frontend/
├── src/
│ ├── app/ # Next.js App Router
│ │ ├── (auth)/ # Auth routes
│ │ ├── (dashboard)/ # Dashboard routes
│ │ └── api/ # API routes
│ ├── components/ # React components
│ │ ├── ui/ # Shadcn/ui components
│ │ └── ...
│ ├── lib/ # Utilities
│ ├── hooks/ # Custom hooks
│ ├── stores/ # Zustand stores
│ └── types/ # TypeScript types
├── public/ # Static assets
├── tailwind.config.ts
└── next.config.mjsInfrastructure
| Service | Technology | Purpose |
|---|---|---|
| Container Runtime | Docker | Application containers |
| Orchestration | Docker Compose | Container orchestration |
| Reverse Proxy | NGINX | Load balancing, SSL |
| CI/CD | GitLab CI | Build, test, deploy |
| Monitoring | Prometheus + Grafana | Metrics & dashboards |
| Logging | Loki + Promtail | Log aggregation |
| SSL | Let's Encrypt | HTTPS certificates |
Database Schema
PostgreSQL Tables
sql
-- Core tables
users, organizations, teams
documents, envelopes, recipients
signatures, signature_fields
templates, template_fields
certificates, certificate_operations
audit_logs, webhook_events
api_keys, oauth_tokens
subscriptions, usage_recordsMongoDB Collections
javascript
// Document metadata
documents
audit_events
webhook_deliveriesRedis Keys
session:{id} # User sessions
cache:user:{id} # User cache
queue:email # Email queue
rate_limit:{ip} # Rate limitingSecurity Stack
| Feature | Implementation |
|---|---|
| Authentication | JWT with refresh tokens |
| Password Hashing | bcrypt |
| API Auth | API keys + OAuth 2.0 |
| Rate Limiting | Fiber limiter middleware |
| HTTPS | Let's Encrypt + NGINX |
| Headers | Fiber security middleware |
| PKI | X.509 certificates, PKCS#7 |
Version History
v1.0 → v1.1 Changes
| Component | Before | After |
|---|---|---|
| Backend | Node.js + Express | Go + Fiber v2 |
| Frontend | React | Next.js 14+ |
| Styling | Material-UI | Tailwind CSS + Shadcn/ui |
| Testing | Jest | Vitest (frontend), Go testing (backend) |
| Task Queue | Bull (Redis) | Asynq (Go-native) |
| Logging | Winston | zerolog |