Worksense is a small workplace scheduling application providing shift management, time off requests, and shift swap capabilities.
This repository contains:
frontend/– React + TypeScript front-end client (Vite)server/– Express + TypeScript API server
The database schema is defined in server/migrations/20231110_initial.sql.
To set up the database:
- Create a Supabase or Postgres database
- Open the SQL Editor (Supabase Dashboard → SQL Editor, or use
psql) - Copy and paste the contents of
server/migrations/20231110_initial.sql - Run the SQL to create tables
Tables:
| Table | Purpose |
|---|---|
users |
Employee and manager accounts (with role) |
shifts |
Individual work shifts; may be unassigned (assigned_to NULL) |
time_off_requests |
Employee time off periods with approval workflow |
shift_swap_requests |
Requests to swap assigned shifts |
Important constraints:
- Unique
users.email - Validated role via CHECK constraint
end_time > start_timefor shiftsend_date >= start_datefor time off
- Install dependencies (inside
server/):cd server npm install - Configure environment variables by copying
.env.exampleto.envand updating values:cp .env.example .env
- Start development server:
npm run dev
- Install dependencies (inside
Frontend/):cd Frontend npm install - Configure environment variables by copying
.env.exampleto.env:cp .env.example .env
- Start development server:
npm run dev
- Build for production:
npm run build
Create feature branches (e.g. database, auth, shifts-ui) and open PRs for review.