popertots 50746595e7 feat(bookings): improve admin booking wizard and user dashboard
Backend:
- Enriched GetAllUserBookings response with calculated total_amount,
  amount_paid, and duration_minutes.
- Refactored GetBookingHandler to return a flat booking object matching
  frontend expectations.
- Added account_role to admin user list response and sorted users by
  booking activity.
- Corrected function name oo to AdminCreateBookingForUserHandler.

Frontend:
- Rebuilt BookingCreateModal into a 4-step wizard supporting guest
  bookings, service overrides, and real-time availability checks.
- Fixed account dashboard logic to correctly identify upcoming vs past
  bookings and sort unpaid items to the top.
- Extracted booking flow into a shared BookingFlow component.
- Redirected admin users from home page to /today.
2026-02-12 22:15:10 +00:00
2025-11-06 16:05:33 +00:00
2025-11-28 18:03:06 +00:00
2025-10-31 23:11:33 +00:00
2026-01-19 22:32:25 +00:00
2025-11-06 16:05:33 +00:00

Crussell

Crussell is a fullstack application that powers a nailbar / salon booking service. The repository is split into a Go backend and a SvelteKit frontend, both of which are containerised with Docker. A lightweight SabreDAV instance is also exposed so that the salon can offer WebDAV access to clients.

📦 Project Structure

Crussell/
├─ backend/            # Go 1.22 + chi router API
├─ frontend/           # SvelteKit SPA
├─ sabredav/           # PHP + Composer for DAV
├─ nginx/              # Nginx reverseproxy for HTTP & HTTPS
├─ init-scripts/       # PostgreSQL init SQL
├─ compose.yml         # DockerCompose definition
├─ local-dev.sh        # Development helper using tmux
└─ README.md

⚙️ Prerequisites

Tool Version
Docker & DockerCompose ≥ 20.10
Go ≥ 1.22
Node ≥ 18 npm
tmux ≥ 3.0

Tip

: If you already have Docker Desktop or Docker Engine installed, you are good to go.

📥 Getting Started

# Clone the repository
git clone http://git.popertots.com/popertots/Crussell.git
cd Crussell

# Copy the example environment file and edit it
cp .env.example .env
# Open .env and provide values for POSTGRES_*, JWT_SECRET_KEY, etc.

DockerCompose

The simplest way to bring the whole stack up is with DockerCompose.

docker compose up --build -d

postgres PostgreSQL 17 backend Go API (exposed on :8080) sabredav PHPbased WebDAV (served by Nginx) nginx Reverseproxy (HTTP on :80 and HTTPS on :443)

After the containers are running, the frontend is reachable at http://localhost. The API is available at http://localhost/api. SabreDAV can be accessed via http://localhost/dav.

Development with local-dev.sh

For a more interactive dev experience the repository ships a small helper script that launches Docker, starts a tmux session with three panes (PostgreSQL console, Go dev server, Svelte dev server) and seeds the database with an admin and a regular user plus a handful of sample services.

chmod +x local-dev.sh
./local-dev.sh

The script performs the following steps:

  1. Docker checks starts Docker if it isnt already running.
  2. PostgreSQL reset removes the old volume and starts a fresh container.
  3. tmux session creates crussell-dev with panes:
    • psql console
    • Go server (go run -tags dev ./main.go)
    • Svelte dev server (npm run dev -- --host)
  4. Seeding creates an admin (admin@example.com) and a regular user (user@example.com), updates the admin role, and registers six example services.

Note

: The script uses a temporary shell script to perform the HTTP calls, so no external tooling like jq is required.

🔧 Building & Testing

Backend

cd backend
# Build the binary
go build -o bin/backend ./main.go

The binary is then copied into the Docker image via the Dockerfile.

Frontend

cd frontend
npm ci
npm run build   # Production build
npm run dev     # Development server

SabreDAV

SabreDAV is bundled with PHPFPM and Composer. The Docker image installs dependencies automatically during the container startup.

📂 Environment Variables

Variable Purpose Example
POSTGRES_USER DB username myuser
POSTGRES_PASSWORD DB password mysecret
POSTGRES_DB DB name mydb
JWT_SECRET_KEY HMAC key for JWT supersecret
SABRE_DAV_* Optional SabreDAV overrides

Create a .env file in the project root based on the provided .env.example.

📊 Seeding Data

The local-dev.sh script automatically seeds:

  • Admin user (admin@example.com / password)
  • Regular user (user@example.com / password)
  • Six example nailbar services

If you want to seed manually, use the provided init-scripts/init-script.sql and your favourite Postgres client.

📌 Useful Commands

# Show Docker containers
docker ps

# Rebuild the Go binary and restart containers
make build-backend
docker compose up -d backend

# Tail logs
docker compose logs -f

# Open a shell inside the backend container
docker compose exec backend sh

Happy coding!

S
Description
Nail salon website with booking system and portfolio
Readme
48 MiB
Languages
Go 64.6%
JavaScript 16.5%
Svelte 14.8%
TypeScript 1.9%
PLpgSQL 1.2%
Other 0.9%