A modern, full-stack application built with Go and React, featuring comprehensive role-based access control (RBAC), user management, and email template systems. Studio45 provides a secure, scalable platform for building enterprise-grade applications with advanced authentication and authorization capabilities.
- Authentication & Authorization: JWT-based authentication with comprehensive RBAC
- User Management: Complete user lifecycle with profile management and admin controls
- Role-Based Access Control: Normalized RBAC system with granular permissions
- Email Template Management: Database-driven customizable email templates with preview and testing
- Password Reset: Secure email-based password recovery with configurable templates
- Database Migrations: Version-controlled schema management with rollback support
- Security: Input validation, SQL injection prevention, and rate limiting
- Modern React: React 19 with TypeScript and modern development practices
- Beautiful UI: shadcn/ui components with Tailwind CSS styling
- Responsive Design: Mobile-first design that works on all devices
- Protected Routes: Role-based route protection with authentication guards
- Admin Dashboard: Full-featured admin interface with data visualization
- Theme Support: Dark/light theme with system preference detection
- Monorepo Architecture: Organized codebase with clear separation of concerns
- Docker Support: Containerized deployment with Docker Compose
- Performance: Optimized builds with Vite and efficient database queries
- Type Safety: Full TypeScript coverage with strict mode enabled
Studio45 follows a modern, layered architecture pattern with clear separation between frontend, backend, and data layers:
graph TB
subgraph "Client Layer"
BROWSER[Web Browser]
MOBILE[Mobile Browser]
end
subgraph "Frontend Layer"
WEB[React Web App<br/>TypeScript + Vite]
UI[UI Components<br/>shadcn/ui + Tailwind]
AUTH_CTX[Auth Context<br/>JWT Management]
end
subgraph "Backend Layer"
API[Go API Server<br/>Fiber Framework]
MIDDLEWARE[Middleware Stack<br/>Auth + RBAC + CORS]
SERVICES[Business Services<br/>Auth + RBAC + Email]
end
subgraph "Infrastructure Layer"
TRAEFIK[Traefik Proxy<br/>Load Balancer + HTTPS]
end
subgraph "Data Layer"
DB[(PostgreSQL<br/>Primary Database)]
CACHE[(Redis<br/>Cache Layer)]
end
subgraph "External Services"
SMTP[SMTP Server<br/>Email Delivery]
ACME[Let's Encrypt<br/>SSL Certificates]
end
%% Connections
BROWSER --> TRAEFIK
MOBILE --> TRAEFIK
TRAEFIK --> WEB
WEB --> UI
WEB --> AUTH_CTX
TRAEFIK --> API
API --> MIDDLEWARE
MIDDLEWARE --> SERVICES
SERVICES --> DB
SERVICES --> CACHE
SERVICES --> SMTP
TRAEFIK --> ACME
%% Styling
classDef client fill:#e3f2fd
classDef frontend fill:#f3e5f5
classDef backend fill:#e8f5e8
classDef infrastructure fill:#f1f8e9
classDef data fill:#fff3e0
classDef external fill:#ffebee
class BROWSER,MOBILE client
class WEB,UI,AUTH_CTX frontend
class API,MIDDLEWARE,SERVICES backend
class TRAEFIK infrastructure
class DB,CACHE data
class SMTP,ACME external
Studio45 features a modern, responsive React-based administrative interface built with TypeScript and shadcn/ui components. The frontend provides comprehensive management capabilities for users, roles, permissions, and system configuration through an intuitive dashboard.
The Roles Management interface allows administrators to create and manage user roles with granular permission control. Features include:
- View all system roles with permission counts
- Create new roles with custom permissions
- Edit existing role configurations
- Real-time permission assignment and management
The Email Templates system provides a powerful interface for managing dynamic email communications:
- Template creation and customization with Go template syntax
- Variable substitution support for personalized content
- Template preview and testing capabilities
- Conditional content rendering based on user data
Comprehensive user administration interface offering:
- Complete user listing with search and filtering
- User profile management with contact information
- Role assignment and permission management
- Account status monitoring and control
Individual user profile pages provide detailed account information:
- Personal information display and editing
- Role and permission visualization
- Account activity tracking
- Membership and update history
The main dashboard offers business intelligence and system insights:
Frontend:
- React 19 with TypeScript
- Vite for build tooling
- shadcn/ui + Tailwind CSS
- React Hook Form + Zod validation
Backend:
- Go 1.24 with Fiber framework
- GORM for database operations
- JWT for authentication
- Go Migrate for schema management
Database:
- PostgreSQL (primary database)
- Redis (caching layer)
Infrastructure:
- Docker & Docker Compose
- Traefik reverse proxy
- Let's Encrypt SSL certificates
Development:
- ESLint + TypeScript compiler
- Git for version control
- Go 1.24+: Download Go
- Node.js 18+: Download Node.js
- PostgreSQL 13+: Download PostgreSQL
- Docker (optional): Download Docker
-
Clone the repository:
git clone https://github.com/ak9024/studio45.git cd studio45 -
Start the backend:
cd apps/api cp .env.example .env # Edit .env with your database configuration go mod download go run main.go migrate up # automatic create database include tables go run main.go
-
Start the frontend:
cd apps/web cp .env.example .env # Edit .env with your API configuration npm install npm run dev
-
Access the application:
- Frontend: http://localhost:5173
- Backend API: http://localhost:8080
For local development with Docker:
# Start all services (API, Web, PostgreSQL)
docker-compose -f docker-compose.local.yaml up -d
# Check service status
docker-compose -f docker-compose.local.yaml ps
# View logs
docker-compose -f docker-compose.local.yaml logs -fAccess your application:
- Frontend: http://localhost:80
- Backend API: http://localhost:8080 (internal, proxied through frontend)
- PostgreSQL: localhost:5432
Service Management:
# Stop all services
docker-compose -f docker-compose.local.yaml down
# Rebuild after code changes
docker-compose -f docker-compose.local.yaml up --buildFor production deployment with automatic HTTPS and reverse proxy:
1. Configure your domain and email:
# Edit docker-compose.yaml and update:
# - Line 38: your-email@gmail.com (Let's Encrypt notifications)
# - Line 61: CORS_ALLOWED_ORIGINS=https://yourdomain.com
# - Line 76: FRONTEND_URL=https://yourdomain.com
# - Line 121: traefik.http.routers.web.rule=Host(`yourdomain.com`)2. Set up email configuration (optional):
# Update SMTP settings in docker-compose.yaml (lines 78-84)
# Or set EMAIL_PROVIDER=local for development3. Deploy the stack:
# Start production services with Traefik reverse proxy
docker-compose up -d
# Monitor deployment
docker-compose logs -f
# Check service health
docker-compose psProduction Services:
- Traefik: Reverse proxy with automatic HTTPS (Let's Encrypt)
- API: Go backend with database migrations
- Web: React frontend served by nginx
- PostgreSQL: Database with persistent storage
SSL Certificates:
Traefik automatically obtains and renews SSL certificates from Let's Encrypt. Certificates are stored in ./letsencrypt/ directory.
- Backend API Documentation: Complete Go API documentation
- Frontend Documentation: Complete React application documentation
- RBAC System Guide: Role-Based Access Control implementation
- Email Templates Guide: Email template management
- SMTP Configuration: Email server setup
GET /health- Health check endpoint
POST /api/v1/auth/register- User registrationPOST /api/v1/auth/login- User authenticationPOST /api/v1/auth/forgot-password- Request password resetPOST /api/v1/auth/reset-password- Reset user password
GET /api/v1/protected/profile- Get current user profilePUT /api/v1/protected/profile- Update current user profile
GET /api/v1/admin/users- List all usersPOST /api/v1/admin/users- Create new userPUT /api/v1/admin/users/:id- Update specific userPUT /api/v1/admin/users/:id/roles- Update user rolesDELETE /api/v1/admin/users/:id- Delete user
GET /api/v1/admin/roles- List all rolesPOST /api/v1/admin/roles- Create new roleGET /api/v1/admin/roles/:id- Get specific rolePUT /api/v1/admin/roles/:id- Update specific roleDELETE /api/v1/admin/roles/:id- Delete roleGET /api/v1/admin/roles/:id/permissions- Get role permissionsPUT /api/v1/admin/roles/:id/permissions- Update role permissions
GET /api/v1/admin/permissions- List all permissionsPOST /api/v1/admin/permissions- Create new permissionGET /api/v1/admin/permissions/:id- Get specific permissionPUT /api/v1/admin/permissions/:id- Update specific permissionDELETE /api/v1/admin/permissions/:id- Delete permission
GET /api/v1/admin/users/:id/permissions- Get user permissionsGET /api/v1/admin/users/:id/permissions/:permission- Check user permission
Studio45 provides multiple methods to promote users to different roles:
CLI Promotion (Direct Database)
go run main.go promote [email]- Promote user from 'user' to 'admin' role via CLI
CLI Usage Examples:
Promote user to admin (direct database access):
# Navigate to API directory
cd apps/api
# Promote user by email
go run main.go promote user@example.comSecurity Considerations:
- API promotion requires admin authentication token
- CLI promotion requires direct server access and database connection
- All promotions are logged with audit trail (timestamp, granted_by)
- Users cannot promote themselves via API
- CLI promotion only works for user → admin promotion
GET /api/v1/admin/email-templates- List all email templatesPOST /api/v1/admin/email-templates- Create new email templateGET /api/v1/admin/email-templates/:id- Get specific templatePUT /api/v1/admin/email-templates/:id- Update email templateDELETE /api/v1/admin/email-templates/:id- Delete email templateGET /api/v1/admin/email-templates/:id/variables- Get template variablesPOST /api/v1/admin/email-templates/:id/preview- Preview email templatePOST /api/v1/admin/email-templates/:id/test- Send test email
- Documentation: Check the comprehensive docs in each app directory
- Issues: Report bugs or request features in GitHub Issues
- Discussions: Join discussions in GitHub Discussions
- Database Connection: Verify PostgreSQL is running and DB_DSN is correct
- Frontend Build: Clear node_modules and reinstall dependencies
- Authentication: Verify JWT_SECRET is set consistently
Built with ❤️ by @ak9024
Studio45 - Empowering enterprise applications with modern technology and security





