Getting Started
Version: 1.0.1
Prerequisites
- Node.js 18 or higher
- A Supabase project (free tier works)
Installation
1. Clone and install dependencies
git clone <your-repo-url>
cd Complaint-Managment-System
npm install
2. Configure environment variables
Copy the example file and edit it:
cp .env.example .env.local
| Variable | Description |
|---|---|
NEXT_PUBLIC_SUPABASE_URL | Your Supabase project URL |
NEXT_PUBLIC_SUPABASE_ANON_KEY | Supabase anon (public) key |
SUPABASE_SERVICE_ROLE_KEY | Service role key — used for server-side login and user management |
JWT_SECRET | Session signing secret — use 32+ random characters in production |
CRON_SECRET | Bearer token for Vercel Cron (/api/cron) — set in Vercel env vars |
Never commit
.envor.env.localto version control.
3. Set up the database
- Open your Supabase project → SQL Editor
- Open the file
database/cms-schema.sqlfrom this project - Paste the entire file and click Run
This creates all tables, permissions, default admin user, complaint types, and optional sample complaints.
4. Configure Supabase Storage (for uploads)
Create two storage buckets in Supabase:
| Bucket | Purpose |
|---|---|
complaint-images | Evidence photos attached to complaints |
branding-assets | Business logo uploaded from Profile page |
Set bucket policies to allow public read access for image URLs (or configure as needed for your deployment).
5. Start the development server
npm run dev
Open http://localhost:3000 in your browser.
First Login
Use the default admin credentials created by the database schema:
- Email:
admin@admin.com - Password:
admin123
After login you land on the Dashboard. The sidebar shows all menu items for admin users.
Try Demo Mode (no database)
If you want to explore the product without Supabase, use the standalone demo:
cd demo-mode
npm install
npm run dev
Open the Demo Mode login screen and choose an account card. Sample complaints and workflows are already filled in. Demo Mode is deployed separately from the production app.
Available Scripts
| Command | Purpose |
|---|---|
npm run dev | Start development server |
npm run build | Create production build |
npm run start | Run production build locally |
npm run lint | Run ESLint |
Deployment (Vercel)
- Push the project to GitHub
- Import the repository in Vercel
- Add all environment variables from
.env.example - Run
database/cms-schema.sqlon your production Supabase project - Deploy
Pre-deploy checklist:
- Strong
JWT_SECRETset -
cms-schema.sqlapplied on Supabase -
npm run buildpasses locally - Default admin password changed
- Storage buckets created
Typical Workflow (Day-to-Day Use)
- Login with your assigned credentials
- Check the Dashboard for open complaints and priorities
- Go to Complaints to view, add, or update complaints
- Attach images as evidence when creating or editing a complaint
- Use Resolution Workflow (or the Workflow button on a complaint row) to record how a complaint was resolved
- Copy a customer message from the complaint actions menu to send to the customer
- Print a complaint summary from the detail view when needed
- Admins manage users, permissions, complaint types, and business branding from Settings
Sidebar Basics
- Click the chevron at the top of the sidebar to collapse/expand it
- Collapsed mode shows icons only; hover for flyout submenus
- Settings submenu includes Profile, Users and Access (admin), Complaint Type, theme toggle, and Sign out
- The sidebar footer shows the app version (e.g.
v1.0.1) - Your sidebar state (collapsed/expanded) and theme preference are saved in the browser
App version & changelog
See App Version Details for the current version table and bump checklist.
| Place | What to update |
|---|---|
lib/appConfig.ts | APP_VERSION, APP_VERSION_DATE |
demo-mode/lib/appConfig.ts | Same values for Demo Mode |
package.json / demo-mode/package.json | "version" field |
| APP-VERSION.md | Current version / release date table |
| CHANGELOG.md | New dated section at the top |
_meta/navigation.json | "version" (docs site metadata) |
How to bump a release
- Decide the new version (e.g.
1.1.0) and today’s date. - Update
APP_VERSION/APP_VERSION_DATEin both appConfig files. - Set the same version in both
package.jsonfiles. - Update APP-VERSION.md and add a section at the top of CHANGELOG.md.
- Deploy — the sidebar will show
v{new version}.
Page guides
Step-by-step docs for every screen (with screenshots):