A full-stack salon management application with a Go backend and React frontend.
Language : Go 1.24
Framework : Gorilla Mux
Database : PostgreSQL
Configuration : Viper
Logging : Slog
Framework : React 19
Build Tool : Vite
Styling : Tailwind CSS
Icons : Lucide React
Charts : Recharts
Routing : React Router DOM
salon-saas/
├── cmd/
│ └── server/
│ └── main.go # Application entry point
├── internal/
│ ├── analytics/ # Analytics service and handlers
│ ├── auth/ # JWT authentication
│ ├── db/ # Database connection
│ ├── handler/ # HTTP handlers and routing
│ ├── middleware/ # Auth and RBAC middleware
│ ├── models/ # Database models
│ ├── repository/ # Data access layer
│ └── service/ # Business logic
├── migrations/ # SQL schema migrations
├── web/ # React frontend
│ ├── src/
│ │ ├── api/ # API client
│ │ ├── components/ # Reusable UI components
│ │ ├── context/ # React context (Auth)
│ │ ├── pages/ # Page components
│ │ ├── App.jsx # Main app component
│ │ └── main.jsx # React entry point
│ ├── package.json
│ └── vite.config.js
└── config.yaml # Application configuration
salons : Multi-tenant salon records
admins : Staff accounts with roles (owner, manager, staff)
customers : Client information
services : Salon services offered
payments : Payment/invoice records
payment_items : Line items for payments
appointments : Booking records
shifts : Staff working schedules
products : Inventory products
Soft deletes on all tables
Automatic updated_at timestamps
UUID primary keys
Multi-tenant isolation by salon_id
Method
Endpoint
Description
POST
/login
Admin login
POST
/register
Register new salon
GET
/health
Health check
All protected routes are prefixed with /api and require authentication.
Method
Endpoint
Description
Roles
GET
/api/admins
List all admins
owner
POST
/api/admins
Create admin
owner
GET
/api/admins/{id}
Get admin
owner
PUT
/api/admins/{id}
Update admin
owner
DELETE
/api/admins/{id}
Delete admin
owner
Method
Endpoint
Description
Roles
GET
/api/services
List services
all
POST
/api/services
Create service
owner, manager
GET
/api/services/{id}
Get service
all
PUT
/api/services/{id}
Update service
owner, manager
DELETE
/api/services/{id}
Delete service
owner, manager
Method
Endpoint
Description
Roles
GET
/api/customers
List customers
all
POST
/api/customers
Create customer
owner, manager
GET
/api/customers/{id}
Get customer
all
PUT
/api/customers/{id}
Update customer
owner, manager
DELETE
/api/customers/{id}
Delete customer
owner, manager
Method
Endpoint
Description
Roles
GET
/api/products
List products
all
POST
/api/products
Create product
owner, manager
GET
/api/products/{id}
Get product
all
PUT
/api/products/{id}
Update product
owner, manager
DELETE
/api/products/{id}
Delete product
owner, manager
Method
Endpoint
Description
Roles
GET
/api/appointments
List appointments
all
POST
/api/appointments
Create appointment
owner, manager
PUT
/api/appointments/{id}/status
Update status
owner, manager
Method
Endpoint
Description
Roles
GET
/api/admins/{id}/shifts
List shifts
owner, manager
PUT
/api/admins/{id}/shifts
Update shifts
owner, manager
Method
Endpoint
Description
GET
/api/analytics/daily
Daily summary
GET
/api/analytics/range
Date range analytics
GET
/api/analytics/payment-methods
Payment method breakdown
GET
/api/analytics/top-services
Most popular services
GET
/api/analytics/staff-performance
Staff performance metrics
GET
/api/analytics/revenue-trend
Revenue trends
Method
Endpoint
Description
Roles
POST
/api/checkout
Process payment
all
GET
/api/invoices/{invoice_number}
Get invoice
all
Method
Endpoint
Description
GET
/api/salons/me
Get current salon
Go 1.24+
Node.js 18+
PostgreSQL 14+
Configure the database in config.yaml:
db :
host : localhost
port : 5432
user : your_user
password : your_password
name : salon
sslmode : disable
Run database migrations:
psql -U your_user -d salon -f migrations/20260226212258_001.up.sql
psql -U your_user -d salon -f migrations/20260227183056_002.up.sql
psql -U your_user -d salon -f migrations/20260227200329_003.up.sql
psql -U your_user -d salon -f migrations/20260406120000_004.up.sql
Start the backend server:
go run cmd/server/main.go
The server runs on port 8080 by default.
Navigate to the web directory:
Install dependencies:
Create a .env.local file:
VITE_API_BASE = http://localhost:8080
Start the development server:
The frontend runs on port 5173 by default.
go build -o server cmd/server/main.go
The system uses JWT tokens for authentication. Upon login, a token is returned that must be included in the Authorization header:
Authorization: Bearer <token>
owner : Full access to all features
manager : Can manage staff, services, customers, appointments
staff : Read-only access to most data, can process checkout
Backend:
Frontend:
Code Structure Conventions
Handlers : HTTP entry points, request parsing, response formatting
Services : Domain logic and orchestration
Repositories : Data access layer (SQL queries)
Models : Database schema and API types
Middleware : Auth and RBAC logic
Use helpers in internal/middleware/auth_middleware.go to get context values:
GetAdminID(r.Context())
GetSalonID(r.Context())
GetRole(r.Context())
MIT