Restaurant Employee Scheduling Application
A full-stack web application for restaurant managers to create schedules, manage employees and roles, and assign shifts with an intuitive calendar interface.
- Multi-Restaurant Support - Manage multiple restaurant locations from a single account
- Employee Management - Add, edit, and organize staff with role assignments
- Role-Based Organization - Create custom roles with color coding for visual distinction
- Shift Templates - Define recurring shift patterns for quick schedule population
- Weekly Schedule View - Interactive calendar with drag-and-drop shift management
- Auto-Populate Schedules - Generate schedules from shift templates automatically
- Schedule Publishing - Email schedules directly to employees
- Google OAuth - Sign in with Google for seamless authentication
- Real-time Updates - Redis caching for responsive performance
- Go with Chi router
- PostgreSQL for data persistence
- Redis for caching (optional)
- JWT authentication with Google OAuth support
- SendGrid for transactional emails
- Swagger/OpenAPI documentation
- Next.js 15 with App Router and Turbopack
- React 19 with TypeScript
- Tailwind CSS 4 for styling
- shadcn/ui component library
- react-hook-form with Zod validation
- Google Maps API for address autocomplete
- Go 1.24+
- Node.js 18+
- Docker & Docker Compose
- PostgreSQL 16 (or use Docker)
- Redis 6.2 (optional, or use Docker)
git clone https://github.com/balebbae/RESA.git
cd RESAdocker-compose up -dThis starts PostgreSQL on port 5432 and Redis on port 6379.
Create a .env file in the root directory:
# Server
ADDR=":8080"
EXTERNAL_URL="localhost:8080"
FRONTEND_URL="http://localhost:3000"
ENV="development"
# Database
DB_ADDR="postgres://admin:adminpassword@localhost:5432/resa?sslmode=disable"
DB_MAX_OPEN_CONNS=30
DB_MAX_IDLE_CONNS=30
DB_MAX_IDLE_TIME="15m"
# Redis (optional)
REDIS_ADDR="localhost:6379"
REDIS_ENABLED=false
REDIS_DB=0
# Authentication
AUTH_TOKEN_SECRET="your-secret-key-here"
AUTH_BASIC_USER="admin"
AUTH_BASIC_PASS="admin"
# Google OAuth (optional)
GOOGLE_CLIENT_ID=""
GOOGLE_CLIENT_SECRET=""
GOOGLE_REDIRECT_URL="http://localhost:3000/auth/google/callback"
# Email (optional)
FROM_EMAIL=""
SENDGRID_API_KEY=""
# CORS
CORS_ALLOWED_ORIGIN="http://localhost:3000"
# Rate Limiter
RATE_LIMITER_ENABLED=true
RATELIMITER_REQUESTS_COUNT=20Create client/web/.env.local:
NEXT_PUBLIC_API_URL=http://localhost:8080/v1
NEXT_PUBLIC_GOOGLE_MAPS_API_KEY=your-google-maps-keymake migrate-up# With hot reload (requires Air: go install github.com/air-verse/air@latest)
air
# Or without hot reload
go run cmd/api/main.goThe API will be available at http://localhost:8080.
cd client/web
npm install
npm run devThe app will be available at http://localhost:3000.
RESA/
├── cmd/
│ ├── api/ # HTTP handlers and routes
│ └── migrate/
│ ├── migrations/ # SQL migration files
│ └── seed/ # Database seeding
├── internal/
│ ├── auth/ # JWT and OAuth authentication
│ ├── db/ # Database connection
│ ├── mailer/ # Email service (SendGrid)
│ ├── ratelimiter/ # Rate limiting
│ └── store/ # Data access layer
│ └── cache/ # Redis caching
├── client/web/ # Next.js frontend
│ ├── app/ # App Router pages
│ ├── components/ # React components
│ ├── hooks/ # Custom React hooks
│ ├── lib/ # Utilities and API client
│ └── types/ # TypeScript definitions
├── docs/ # Generated Swagger docs
├── docker-compose.yml # Local development containers
└── Makefile # Build and migration commands
| Command | Description |
|---|---|
make migrate-up |
Apply pending migrations |
make migrate-down |
Rollback last migration |
make migrate-create name |
Create new migration files |
make seed |
Seed database with test data |
make gen-docs |
Generate Swagger documentation |
make test |
Run tests |
| Command | Description |
|---|---|
npm run dev |
Start development server |
npm run build |
Build for production |
npm run lint |
Run ESLint |
Swagger documentation is available at http://localhost:8080/v1/swagger/index.html (requires basic auth).
| Method | Endpoint | Description |
|---|---|---|
| POST | /v1/authentication/user |
Register new user |
| POST | /v1/authentication/token |
Login |
| GET | /v1/restaurants |
List user's restaurants |
| POST | /v1/restaurants |
Create restaurant |
| GET | /v1/restaurants/:id/employees |
List employees |
| GET | /v1/restaurants/:id/roles |
List roles |
| GET | /v1/restaurants/:id/schedules |
List schedules |
| POST | /v1/restaurants/:id/schedules/:sid/auto-populate |
Auto-fill schedule |
MIT