This application is built with a professional full-stack architecture using Next.js 15, Prisma ORM, and SQL Persistence.
Follow these steps to run the application with a persistent database on your local machine.
- Node.js (v18 or newer installed)
- Git
- SQL Database: Install PostgreSQL (Recommended) or MySQL.
- Open your SQL terminal (e.g., pgAdmin for Postgres or MySQL Workbench).
- Create a new empty database named
patamalaria:CREATE DATABASE patamalaria;
- Open the
.envfile in the project root. - Update the
DATABASE_URLwith your local credentials.- For MySQL users: Also change
provider = "postgresql"toprovider = "mysql"inprisma/schema.prisma.
- For MySQL users: Also change
Run these commands in your project folder terminal:
# Install all required packages
npm install
# Connect and push the schema to your local database
npx prisma db push
# Generate the internal Prisma client for the backend
npx prisma generatenpm run devThe app will be running at http://localhost:9002.
- Backend (API Layer):
src/app/actions/contains the Server Actions that handle all SQL queries. - Frontend (UI Layer):
src/app/dashboard/contains the React components and layouts. - Database Engine:
prisma/schema.prismadefines the data structures. - AI Core:
src/ai/powered by Genkit for automated surveillance.
Login with these credentials once the app is running:
| Role | Username | Password |
|---|---|---|
| Admin | admin_user |
password123 |
| Doctor | doctor_user |
password123 |
| Officer | officer_user |
password123 |
| CHW | chw_user |
password123 |