Skip to content

Software Requirements & Specifications

This document specifies the software requirements, dependencies, and technical specifications for developing and deploying the Dharini platform.

ComponentVersionNotes
Node.js22.x LTSRequired for NestJS runtime
PostgreSQL16.xWith PostGIS 3.4 extension
Redis7.x (Alpine)For BullMQ job queues
ComponentVersionNotes
Node.js22.x LTSRequired for Next.js
Browser SupportChrome 90+, Firefox 90+, Safari 14+, Edge 90+Modern browsers with ES2020 support
ComponentVersionNotes
Flutter SDK≥3.16.0Cross-platform framework
Dart SDK^3.5.4Language runtime
AndroidAPI 21+ (Android 5.0)Minimum supported version
iOS12.0+Minimum supported version (planned)

ToolVersionPurpose
Docker24.x+Container runtime
Docker Compose2.x+Multi-container orchestration
Git2.x+Version control
Node.js22.x LTSBackend and web development
Flutter SDK≥3.16.0Mobile development
Android StudioLatestAndroid SDK and emulator
VS Code / IDELatestRecommended IDE
Terminal window
# Clone repository
git clone https://github.com/dsih-artpark/dharini.git
cd dharini
# Copy environment template
cp .env.example .env
# Start development services
docker compose --profile development up -d
# Run database migrations
docker exec -it backend npm run migration:run
ServicePortURL
Backend API4000http://localhost:4000
Web Frontend3000http://localhost:3000
APK Server3001http://localhost:3001
PostgreSQL5432localhost:5432
Redis6379localhost:6379
pgAdmin5050http://localhost:5050

ComponentSpecificationNotes
Compute2 vCPU, 4GB RAM minimumt3.medium or equivalent
DatabasePostgreSQL 16 with PostGISAWS RDS recommended
Storage50GB+ SSDFor database, logs, APKs
Object StorageS3-compatibleFor media uploads
SSLTLS 1.2+Required for HTTPS
ServicePurpose
EC2Application hosting
RDSManaged PostgreSQL
S3File storage (photos, reports)
Route 53DNS management
ACMSSL certificates
PortProtocolPurpose
22TCPSSH access (restricted)
80TCPHTTP (redirects to HTTPS)
443TCPHTTPS
5432TCPPostgreSQL (internal only)

Core Framework:

  • NestJS 11.x
  • TypeScript 5.x
  • TypeORM 0.3.x

Key Dependencies:

PackageVersionPurpose
@nestjs/passport11.xAuthentication
@nestjs/jwt11.xJWT tokens
@nestjs/bullmq11.xJob queue
@casl/ability6.xAuthorization (RBAC)
@aws-sdk/client-s33.xS3 file uploads
typeorm0.3.xDatabase ORM
pg8.xPostgreSQL driver
nodemailer7.xEmail sending
twilio5.xSMS/OTP

Core Framework:

  • Next.js 15.x (App Router)
  • React 18.x
  • TypeScript 5.x

Key Dependencies:

PackageVersionPurpose
jotai2.xState management
axios1.xHTTP client
leaflet1.9.xMaps
react-leaflet4.xReact map components
recharts2.xCharts/visualization
tailwindcss3.xStyling
posthog-js1.xAnalytics

Core Framework:

  • Flutter ≥3.16.0
  • Dart ^3.5.4

Key Dependencies:

PackageVersionPurpose
flutter_bloc8.xState management
flutter_hooks0.20.xHooks for widgets
fquery1.5.xData fetching/caching
hive2.xLocal database
dio5.xHTTP client
go_router14.xNavigation
geolocator13.xGPS location
mobile_scanner6.xQR/barcode scanning
sentry_flutter9.xError tracking
posthog_flutter5.xAnalytics

TableDescriptionKey Relations
usersUser accounts→ teams, roles
projectsSurveillance projects→ teams, sites, diseases
teamsTeam organization→ users, projects
rolesPermission definitions→ users (via user_roles)
sitesCollection locations→ projects, visits (PostGIS geometry)
visitsSite visit records→ sites, samples, users
samplesSample records→ visits, lab_tests, diseases
lab_testsTest results→ samples, diseases
diseasesDisease definitions→ projects, samples
sample_typesSample type catalog→ samples
mediaUploaded files→ S3 references
CREATE EXTENSION IF NOT EXISTS postgis;
CREATE EXTENSION IF NOT EXISTS postgis_topology;
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";

  • Method: JWT Bearer tokens
  • Token Expiry: 24 hours (configurable)
  • OTP Delivery: SMS via Twilio or email via SMTP
  • Format: OpenAPI 3.0 (Swagger)
  • Endpoint: /api/docs (development/staging)
  • Generated Client: es_client package for mobile
EndpointLimitWindow
Auth endpoints10 requests15 minutes
API endpoints100 requests15 minutes
File uploads20 requests15 minutes

  • OTP-based login (SMS/email)
  • JWT tokens with RS256 or HS256
  • Secure httpOnly cookies for web sessions
  • Token refresh mechanism
  • Role-based access control (CASL)
  • Scope hierarchy: System → Project → Team
  • Policy-based guards on all endpoints
  • HTTPS/TLS 1.2+ required
  • Database encryption at rest (RDS)
  • S3 bucket encryption (SSE-S3)
  • Sensitive data masked in logs
  • Audit logging for all data changes
  • User attribution on all operations
  • Data retention policies configurable

OperationTarget
API read operations< 200ms
API write operations< 500ms
File uploads (< 5MB)< 3s
Dashboard load< 2s
MetricCapacity
Concurrent users500+
Samples per project100,000+
Daily API requests100,000+
Storage (media)Unlimited (S3)
  • Mobile app supports full offline operation
  • Local Hive database for data persistence
  • Automatic sync on connectivity restore
  • Photo compression (1MB max, 1920px)

  • Service: Sentry
  • Coverage: Backend, web, mobile
  • Alerts: Critical errors trigger notifications
  • Service: PostHog
  • Events: User actions, feature usage
  • Privacy: Configurable data collection
EndpointPurpose
/healthBackend liveness
/api/docsAPI availability
APK server /healthDistribution service
  • Structured JSON logs (production)
  • Log levels: error, warn, info, debug
  • Retention: 30 days (configurable)

See Environment Variables Reference for the complete list of configuration options.

Terminal window
# Database
DB_HOST, DB_PORT, DB_USERNAME, DB_PASSWORD, DB_DATABASE
# Redis
REDIS_HOST, REDIS_PORT
# Security
JWT_SECRET
# AWS S3
S3_REGION, S3_BUCKET, S3_ACCESSKEYID, S3_SECRETACCESSKEY
# Frontend
NEXT_PUBLIC_API_URL, NEXT_PUBLIC_APP_ENV

Docker Compose supports multiple deployment profiles:

ProfileServicesUse Case
developmentAll + pgAdmin + local PostgresLocal development
demoAll + local PostgresDemo environments
stagingBackend, frontend, APK, RedisStaging (external DB)
productionBackend, frontend, APK, RedisProduction (external DB)
Terminal window
# Development
docker compose --profile development up -d
# Production
docker compose --profile production up -d

ComponentCurrent VersionMinimum Supported
Backend API0.1.00.1.0
Web Frontend0.1.00.1.0
Mobile App0.2.0-beta40.2.0-beta1
Database SchemaMigration-basedLatest migration

Document generated from production branch. Last updated: March 2026.