A production-grade police intelligence platform built with React + TypeScript + Vite, backed by Zoho Catalyst serverless functions.
./
├── frontend/ React + TypeScript + Vite application
├── functions/
│ └── ai-cios/ Zoho Catalyst Advanced I/O Function (Node.js 24)
│ ├── index.js Express application entry point
│ ├── auth/ POST /auth/login, POST /auth/logout, GET /auth/me
│ ├── cases/ GET /cases, GET /cases/:firNumber
│ ├── analytics/ GET /analytics/dashboard
│ ├── ai/ POST /ai/chat
│ ├── map/ POST /map/analyze
│ ├── network/ GET /network/explanation
│ ├── reports/ POST /reports/pdf
│ └── mock/ Karnataka crime mock dataset (60 cases)
│ ├── catalyst.json Catalyst hosting + function targets
│ ├── .catalystrc Catalyst project binding (Project-Rainfall)
│ └── .env.example Environment variable template
Before running the application, you must configure the authentication services on Google Cloud and Zoho Catalyst.
You need to generate a Google Client ID to enable the Google login popup flow:
- Go to the Google Cloud Console.
- Create a new project (e.g.,
AI-CIOS Platform). - Navigate to APIs & Services > OAuth consent screen:
- Select External (or Internal if you are within a workspace organization) and click Create.
- Fill in the mandatory app information (App Name, User Support Email, Developer Contact).
- Click Save and Continue through the scopes and test users sections.
- Navigate to APIs & Services > Credentials:
- Click + Create Credentials at the top and select OAuth client ID.
- Set Application type to Web application.
- Under Authorized JavaScript origins, add:
http://localhost:3000(Origin of local Catalyst serve emulator)http://localhost:5173(Origin of local Vite dev server)- (Once your app is deployed, add your production Catalyst domain here, e.g.
https://project-rainfall-60078581117.development.catalystserverless.in)
- Under Authorized redirect URIs, add:
http://localhost:3000/app/loginhttp://localhost:5173/app/login- (Once deployed, add your production login URI here, e.g.
https://project-rainfall-60078581117.development.catalystserverless.in/app/login)
- Click Create and copy the generated Client ID (you will paste this in the
frontend/.envfile, and in Catalyst Console).
To configure the entire database schema, security rules, allowed CORS domains, and user roles automatically inside a fresh project:
- Go to your Zoho Catalyst Console (project selection screen).
- Click on the Settings icon (located on the right side of the top bar).
- Select Infrastructure as Code (under the General Settings section).
- Click on Import New Project.
- Enter a name for your new project, and upload the
project-template.zipfile located in the root of this repository. - Click the Import button. Catalyst will automatically spin up a fresh project pre-configured with all necessary datastore tables, columns, constraints, and CORS authorized domains.
The application uses Zoho QuickML for advanced AI model execution. You must set up and authorize this integration connection manually in the Catalyst console:
- In the Catalyst Console sidebar under Cloud Scale, navigate to Security & Identity > Connections.
- Click Create Connection and configure:
- Service Name: Select
Catalyst by Zoho. - Connection Name: Enter
quickml_connection. - Scopes: Select or add
QuickML.deployment.READ(or whatever scope is required for QuickML access).
- Service Name: Select
- Click Create and Connect.
- You will be redirected to an authorization screen. Click Connect, and on the next redirect, tick the checkbox (allow access to account) and click the Accept button to authorize the connection under your Zoho account.
- Node.js 24
- Zoho Catalyst CLI:
npm install -g zcatalyst-cli
Authenticate the Catalyst CLI and link this repository to your Zoho Catalyst project:
# Login to Zoho Catalyst
catalyst login
# Link the project (creates .catalystrc mapped to your sandbox)
catalyst project:use
# (or catalyst init if starting from a fresh space)Copy the environment variable templates for both the frontend and backend:
cp frontend/.env.example frontend/.env
cp functions/ai-cios/.env.example functions/ai-cios/.envOpen your new project's dashboard in the Zoho Catalyst Console. The URL in the browser address bar will look like this:
https://console.catalyst.zoho.in/baas/<Organization ID>/project/<Project ID>/Development#/...
Extract the following IDs from the URL:
- Organization ID (ZAID): The number directly after
/baas/. - Project ID: The number directly after
/project/.
- Open
frontend/.envand configure:VITE_GOOGLE_CLIENT_ID: Your Google OAuth 2.0 Client ID.VITE_CATALYST_CLIENT_ID: Your Organization ID (ZAID).
- Open
functions/ai-cios/.envand configure:CATALYST_ORG_ID: Your Organization ID (ZAID).CATALYST_PROJECT_ID: Your Project ID.
Install dependencies from the project root directory:
# Frontend
cd frontend
npm install
npm run build
# Backend
cd ../functions/ai-cios
npm install
# Return to root
cd ../..From the project root directory, start the Catalyst CLI local serve server:
catalyst serveThis runs the local server on http://localhost:3000/.
- The client web app is served at
http://localhost:3000/app/(recommended for testing login/sessions). - The API endpoints are served at
http://localhost:3000/server/ai-cios/.
To populate your database tables with the official Karnataka Police Department 10-case mock reference set, trigger the seed endpoint:
curl -X POST http://localhost:3000/server/ai-cios/system/seed-demo-dataNote
- Auto-Seeded Officers: Officer/Employee profiles are automatically created when you log in or access the login page.
- Seeding Skip Logic: Seeding will skip if data already exists in the database. To force a clean reseed, restart the emulator server (resets the local in-memory fallback store) or manually empty the
firstable in the Catalyst Data Store Console.
For active UI development with Hot Module Replacement (HMR):
cd frontend
npm run dev(Accessed at http://localhost:5173/app/, utilizing the configured Vite proxies).
All endpoints are served under /server/ai-cios/ in production and proxied via /server in development.
| Method | Endpoint | Description |
|---|---|---|
| POST | /auth/login |
Authenticate user (standard login) |
| POST | /auth/logout |
Logout user |
| GET | /auth/me |
Get current authenticated session |
| POST | /auth/google-login |
Authenticate Google SSO & get custom JWT |
| GET | /cases |
Get all FIR cases |
| GET | /cases/:firNumber |
Get single FIR by number |
| GET | /analytics/dashboard |
Get KPI dashboard data |
| POST | /ai/chat |
Query the AI investigation assistant |
| POST | /map/analyze |
Area analysis for map incidents |
| GET | /network/explanation |
Criminal network AI explanation |
| POST | /reports/pdf |
Generate PDF report |
cd frontend
npm run build
cd ..This produces the compiled client assets in frontend/dist/ (which catalyst.json maps as the client hosting source).
From the project root:
catalyst deployThis deploys:
- Catalyst Function:
ai-cios(Advanced I/O, Node.js 24) - Catalyst Web Client Hosting: serves
frontend/dist/