- Node.js installed
- Cloudflare account configured
- Wrangler CLI installed
cd C:\Users\rsimd\Desktop\client-database-system\frontend
npm installcd C:\Users\rsimd\Desktop\client-database-system\backend
npm installMake sure your D1 database has the is_active column in the users table. Run this migration if needed:
-- Add is_active column to users table (if not exists)
ALTER TABLE users ADD COLUMN is_active INTEGER DEFAULT 1;To run the migration:
wrangler d1 execute client-database --command="ALTER TABLE users ADD COLUMN is_active INTEGER DEFAULT 1;"cd frontend
npm run build
npm run deployThis will deploy to: https://client-database-tji.pages.dev/
cd backend
wrangler deployThis will deploy to: https://client-database-api.ghwmelite.workers.dev/
- Visit your frontend URL
- Login with:
admin / Admin@123 - Check all new pages:
- Dashboard (should show charts)
- Clients (click one to see detail page)
- Analytics (view reports)
- Users (admin only)
- Settings (all 4 tabs)
Solution:
cd frontend
npm install react-router-dom axios react-hot-toast rechartsSolution: Redeploy the backend:
cd backend
wrangler deploy --forceSolution: Make sure you're logged in as an admin user. The default admin is:
- Username:
admin - Password:
Admin@123
Solution: Verify R2 bucket configuration in wrangler.toml:
[[r2_buckets]]
binding = "FILES"
bucket_name = "client-database-files"- Login as admin
- Go to
/users - Click "Add New User"
- Fill in details and save
- Verify user appears in list
- Try editing and deleting
- Go to
/analytics - Change time range dropdown
- Verify charts update
- Click "Export Report"
- Verify CSV downloads
- Go to
/clients - Click on any client
- Add a note
- Upload a file
- Download the file
- Edit client info
- Verify all changes save
- Go to
/settings - Try each tab
- Update profile email
- Change password
- Toggle preferences
After deployment, verify:
- Dashboard shows 4 stat cards
- Dashboard shows 3 charts
- Analytics page loads with charts
- Analytics export works
- Client detail page shows notes tab
- Client detail page shows files tab
- File upload works
- File download works
- Settings page has 4 tabs
- Users page loads (admin only)
- User CRUD operations work
- Branding shows "ClientPro Database"
- All navigation links work
If all items in the checklist pass, your deployment is successful!
Your ClientPro Database is now fully featured with:
- ✅ User Management
- ✅ Advanced Analytics
- ✅ File Uploads
- ✅ Interactive Charts
- ✅ Settings Page
- ✅ Client Detail View
Common commands:
View backend logs:
wrangler tailTest backend locally:
cd backend
npm run devTest frontend locally:
cd frontend
npm run devReset database (careful!):
wrangler d1 execute client-database --command="DELETE FROM users WHERE role='user';"To update after code changes:
- Make your changes
- Run:
# Frontend
cd frontend && npm run build && npm run deploy
# Backend
cd backend && wrangler deployThat's it! 🚀