Admin Panel for Sense.
docker compose build sense_adminMake sure you have a PostgreSQL instance running. Alternatively, you can use Supabase or Neon.
npm installnpx prisma migrate deploynpx prisma db seed -- --email '<your_email>@tech.gov.sg'npx zenstack generatenpm run devTo handle changes in your database schema, follow these steps:
-
Update your Prisma schema file located at
prisma/schema.prisma. -
After updating the schema, generate a new migration with the following command:
npx prisma migrate dev --name descriptive_migration_name
This command creates a new migration based on schema changes and applies it to the development database.
-
Run ZenStack generation to apply any changes in the schema or permissions:
npx zenstack generate
This step is necessary after any changes to the schema.zmodel file or when permissions are updated.
-
Deploy migrations to production using:
npx prisma migrate deploy
E2E_SU_USERNAME=e2e
E2E_SU_PASSWORD=
E2E_ADMIN_USERNAME=e2e-org
E2E_ADMIN_PASSWORD=
SENSE_ADMIN_BASE_URL=http://localhost:8051# Reset the Database
npm run test:e2e:prepare-db
# Run the Tests in UI Mode
npx playwright test --uiAlways run this in production mode, even during development.
Specifies the log level for the application. error will only log error messages.
The connection URL for the PostgreSQL database. Format: postgresql://<user>:<password>@<host>:<port>/<database>?schema=<schema>.
The license key for AdminJS Relations, stored in Notion.
... [additional environment variables] ...
x-api-key: The API Key set in the env variableAPI_KEY(above).
{
"id": "86a39452-2581-4e61-9410-105262f5e720",
"remoteId": "bro@hive.gov.sg",
"email": "bro@hive.gov.sg",
"memberships": [
{
"role": "MEMBER",
"organization": {
"id": "70cff6c4-3c55-4819-9afe-703e358942d3",
"name": "MFA"
}
}
],
"accessRights": [
{
"dataSourceId": 4
}
]
}HTTP Response Code 200.
{
"healthy": true,
"checks": {
"checkPrisma": true,
"checkMetabase": true
}
}HTTP Response Code 500.
{
"healthy": false,
"checks": {
"checkPrisma": false,
"checkMetabase": true
}
}- Session data is stored in Redis. (
src/app.ts) - Only a single session is allowed per user. Upon logging in, previous sessions are destroyed (
src/redis.ts).