Skip to content

LafaekStreet Government Portal

A web-based portal for Timor-Leste government agencies to manage, track, and resolve civic infrastructure reports submitted by citizens through the LafaekStreet mobile app.

Live: https://gov.lafaekstreet.com


Overview

DetailValue
URLhttps://gov.lafaekstreet.com
Tech StackNext.js 14 + TypeScript + Tailwind CSS + Prisma
HostingVercel
Port (local)3001
DatabaseShared PostgreSQL (Aiven)
AuthEmail + Password + Email-based 2FA + hCaptcha
Login Tablegovernment_agencies
ThemeLight (green primary #3aa87d)

Features

Authentication

Login Page

  • Email + password login (no self-registration)
  • hCaptcha verification on login (bot protection)
  • 2FA via email (6-digit code, 3 attempts/day)
  • JWT session cookie (session_token, 24h expiry)
  • Account lockout after failed attempts

2FA Verification

Dashboard

Dashboard

  • Platform stats (total reports, pending, fixed, agencies)
  • Quick actions (view pending reports, assignments)
  • Recent activity feed

Reports Management

Reports List

  • View all reports with filters (status, severity, municipality, date range)
  • Report detail with AI analysis, images, comments, status history
  • Update report status (pending, under review, in progress, fixed, rejected)
  • Assign/reassign reports to agencies
  • Add official comments

Report Detail

Assignments

Assignments

  • View reports assigned to your agency
  • Filter by status and priority

Map View

Map View

  • Interactive OpenStreetMap with report markers
  • Filter by status, severity, municipality
  • Click markers to view report details

Analytics

Analytics

  • Report distribution by status, type, severity (recharts)
  • Agency performance table
  • Export data as CSV, Excel, or PDF

Agency Management

Agency Management

  • View agency list and details
  • Create new agencies
  • Edit agency information

Blockchain Verification

Blockchain Verification

  • View Hedera transaction records
  • Verify report immutability via HashScan

Profile & Settings

  • Edit profile and change password
  • View system settings

Project Structure

lafaekstreet_govportal/
├── prisma/schema.prisma          # Shared database schema
├── src/
│   ├── app/
│   │   ├── (auth)/               # Login, 2FA, Locked pages
│   │   ├── (dashboard)/          # Protected pages with sidebar
│   │   │   ├── dashboard/        # Home dashboard
│   │   │   ├── reports/          # Report list + detail
│   │   │   ├── assignments/      # Agency assignments
│   │   │   ├── map/              # Map view
│   │   │   ├── analytics/        # Charts + export
│   │   │   ├── agencies/         # Agency CRUD
│   │   │   ├── blockchain/       # Hedera verification
│   │   │   ├── settings/         # System settings
│   │   │   └── profile/          # User profile
│   │   └── api/                  # API routes
│   ├── components/               # Reusable UI components
│   ├── lib/                      # Prisma, auth, utils, constants
│   └── services/                 # Data fetching services

Quick Start

1. Install Dependencies

bash
cd lafaekstreet_govportal
npm install

2. Set Up Environment

bash
cp .env.example .env.local
# Edit .env.local with your database URL, JWT secret, SMTP config, hCaptcha keys

Required environment variables:

VariableDescription
DATABASE_URLPostgreSQL connection string
JWT_SECRETSecret key for session tokens
SMTP_HOSTSMTP server (e.g. smtp.gmail.com)
SMTP_PORTSMTP port (e.g. 587)
SMTP_USERNAMESMTP email account
SMTP_PASSWORDSMTP email password
NEXT_PUBLIC_HCAPTCHA_SITE_KEYhCaptcha site key (public)
HCAPTCHA_SECRET_KEYhCaptcha secret key (server-side)

3. Generate Prisma Client

bash
npx prisma generate

4. Start Development Server

bash
npm run dev
# Opens at http://localhost:3001

5. Login

Use credentials from the government_agencies table. A 2FA code will be sent to the agency's email.


Database User

This portal uses a dedicated PostgreSQL user lafaekstreet_govportal with least privilege permissions. See Database/user/gov_portal/ for setup.


Available Scripts

CommandDescription
npm run devStart dev server on port 3001
npm run buildProduction build
npm run startStart production server
npm run lintRun ESLint
npm run type-checkTypeScript type checking
npm run db:generateGenerate Prisma client
npm run db:studioOpen Prisma Studio

Port Allocation

AppPortURL
Public Dashboard3000https://lafaekstreet.com
Gov Portal3001https://gov.lafaekstreet.com
Admin Panel3002Local Only
Backend API8000https://api.lafaekstreet.com

Built for Timor-Leste

Built for Timor-Leste