Skip to content

SleimaD/field-platform

Repository files navigation

Field Intelligence Platform (FIP)

Django Next.js PWA Offline--First Docker License

A production-oriented, offline-first Field Intelligence Platform designed for industrial environments requiring strict workflow control, full audit traceability and resilient field operations.


Vision

Industrial field operations (oil & gas, mining, utilities, infrastructure) often operate in environments where:

  • Connectivity is unstable or intermittent
  • Workflow discipline is critical
  • Auditability is mandatory
  • SLA breaches have financial and safety impact
  • Data consistency cannot rely on UI-only enforcement

This project explores a robust, backend-driven, workflow-safe architecture capable of supporting offline-aware, multi-domain operational event management.


Core Capabilities

Strict Workflow Engine (Backend-Enforced)

  • Controlled state transitions: draft → submitted → triaged → in_progress → closed
  • Backend validation of every transition
  • Version-based optimistic concurrency control
  • Safe close and archive operations
  • Conflict detection and prevention

Full Audit Trail

  • Complete event history timeline
  • JSON-serializable audit payloads
  • Assignment, status and SLA traceability
  • Deterministic logging structure

Multi-Domain Industrial Taxonomy

Event domains supported:

  • HSE Incident
  • Near Miss
  • Hazard Observation
  • Maintenance Anomaly
  • Inspection Finding

Designed to scale across industrial verticals without changing the workflow engine.


SLA & Overdue Visibility

  • Due date management
  • Overdue KPI tracking
  • Visual overdue indicators
  • Status-aware SLA logic
  • Archived vs Active separation

Reference Cache Layer (ID → Human Resolution)

  • Site / Zone / Asset mapping via cached reference layer
  • Automatic full cache rebuild when IDs cannot be resolved
  • Designed for incremental sync scenarios
  • Resilient against backend resets or reseeding

Offline-First & PWA Architecture

This project is designed with offline-first principles in mind.

  • PWA-ready frontend
  • Token-based authentication
  • Local reference cache
  • Incremental sync pull endpoint
  • Deterministic data ordering for stable synchronization
  • Cursor-based sync architecture
  • Cache invalidation strategy with full rebuild detection

The system is structured to support intermittent connectivity environments and future mobile field deployments.


Architecture Overview

Backend

  • Django
  • PostgreSQL
  • Deterministic queryset ordering
  • Strict workflow state machine
  • Version-safe transitions
  • Audit logging layer
  • Incremental sync endpoint (/api/sync/pull)
  • Safe pagination strategy

Frontend (Admin Web)

  • Next.js
  • TypeScript
  • Auth-aware API client
  • JWT access/refresh token handling
  • Guarded routes
  • Enterprise-grade data table:
    • Sorting
    • Pagination
    • Filtering
    • KPI summary cards
  • Workflow feedback via redirects + toast state

Infrastructure

  • Docker Compose
  • PostgreSQL container
  • MinIO object storage
  • Auto-migrations on service start
  • Environment-configured API base URL

Demo Mode

A deterministic demo dataset is included.

Reset and seed demo data:

docker compose -f infra/docker-compose.yml run --rm api python manage.py demo_seed --reset

Default demo credentials:

  • Username: demo.admin
  • Password: (default demo password)

The seeded dataset includes:

  • Multiple industrial domains
  • Assigned events
  • Overdue events
  • Archived events
  • Versioned workflow transitions
  • Complete audit history timeline

This enables a full end-to-end demonstration of:

  • Strict workflow transitions
  • SLA & overdue visibility
  • Assignment lifecycle
  • Concurrency-safe state mutations
  • Audit traceability

Engineering Highlights

  • Deterministic queryset ordering for stable pagination
  • Version-based optimistic concurrency control
  • Backend-enforced workflow state machine
  • Safe close/archive actions with version validation
  • Full rebuild reference cache strategy
  • Incremental sync architecture with cursor support
  • Separation of workflow logic from UI rendering
  • Strict mutation control at API layer

Offline-First & PWA Design

This platform is structured to support connectivity-constrained environments.

Architectural foundations supporting offline-first evolution:

  • Local reference cache (Site / Zone / Asset resolution)
  • Cursor-based incremental sync endpoint
  • Deterministic ordering to prevent sync drift
  • Cache invalidation and automatic full rebuild detection
  • JWT-based stateless authentication
  • PWA-ready frontend architecture

Designed to evolve toward:

  • Offline event drafting
  • Progressive sync queues
  • Field-mobile deployments
  • Intermittent connectivity environments

Tech Stack

Backend:

  • Python 3
  • Django
  • PostgreSQL
  • REST API
  • JWT authentication

Frontend:

  • Next.js
  • TypeScript
  • Auth-aware API client
  • Enterprise-grade data table patterns
  • PWA-ready structure

Infrastructure:

  • Docker Compose
  • PostgreSQL container
  • MinIO object storage
  • Auto-migrations on startup

License

MIT License

About

Production-grade offline-first Field Intelligence Platform with strict workflow control, audit traceability and industrial multi-domain taxonomy.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors