Planner - Setup and Operations Guide
This single guide replaces all previous setup docs. Follow it end-to-end to configure, run, and operate the app on Windows.
- Prerequisites
- Node.js 18+ (LTS recommended)
- Git
- Docker Desktop (only if you plan to run with Docker)
- Install
- Open PowerShell:
cd "D:\Site Workspace\Planner"
npm install
- Environment
- Create
.envfromenv.exampleand set:
REACT_APP_SUPABASE_URL=https://YOUR-PROJECT.supabase.co
REACT_APP_SUPABASE_ANON_KEY=YOUR_ANON_KEY
- Test connectivity:
node test-connection.js
- Run (Dev)
npm start
- Desktop Shortcuts (Windows)
powershell -ExecutionPolicy Bypass -File scripts\create-shortcuts.ps1
Creates:
- Planner (Dev).lnk → npm start
- Planner (Docker).lnk → docker compose up -d
- Planner (Docker Stop).lnk → docker compose down
- Run with Docker
docker compose up -d
Stop:
docker compose down
- Project structure
- src/ (React app)
- src/components, src/context, src/services, src/database
Troubleshooting
- Verify
.envvalues and internet access to*.supabase.co - Reinstall: delete node_modules, run npm install
The Service Engineer Planner (SEP) is a comprehensive ERP-lite solution for field service management:
- Advanced Scheduling: Integrated calendar views with support for multi-step case lifecycles (Travelling, Reached Centre, Installation, etc.).
- Workflow Intelligence: Automated enforcement of business rules, such as preventing multi-city assignments on the same day and highlighting schedule overlaps.
- Role-Based Access (RBAC): Distinct workflows for Admins, Managers, Service Engineers, Executives, and Clients.
- Client & Location ERP: Dedicated modules for managing IVF Hospitals (Clients) and geographic service hubs (Locations).
- Clinical Data Capture: Specialized post-case forms for recording patient counts and embryologist details.
- Approval System: Implemented a new middleware layer requiring manual Admin/Manager approval for all Service Engineer and Executive signups.
- Schema Evolution: Updated
profilesandcasestables to support clinical data, equipment tracking (Laser Details), and approval states. - UI Refresh: Added dedicated management interfaces for geographic locations and client organizations.
- Security: Restricted case updates to Admins and the specific Engineer assigned to the task.
- In Google Cloud Console, create OAuth 2.0 Client ID (Web) and enable Calendar API.
- Add Authorized JavaScript origins: your dev URL (e.g., http://localhost:3000).
- Add Authorized redirect URIs: http://localhost:3000.
- Add to .env:
- REACT_APP_GOOGLE_CLIENT_ID=...
- REACT_APP_GOOGLE_API_KEY=...
- Restart dev server.
- In the app, open Google Calendar section and click "Connect to Google Calendar".
- Create project; copy Project URL and anon key to .env.
- Apply schema: open Supabase SQL Editor, paste contents of
src/database/schema.sql, run. - Seed users using Admin (service role): set
SUPABASE_SERVICE_ROLE_KEYin .env, then run:npm run create-users
- Sign in with created users.
- Clear browser localStorage keys
engineerUseranddemoAuth. - After users exist in Supabase, login will use real auth and demo fallback won’t trigger.