CORE PLATFORM

The system a 50-year-old engineering firm actually runs on.

Behairy Consulting Engineering (BCE) has run bridge, residential, industrial, and administration projects out of Cairo since 1970. Before this, project costs, client invoices, and documents lived across spreadsheets and paper. I designed and built a single internal platform that gives everyone — from the CEO to a junior engineer — exactly the access they need, a full paper trail on every cost, and native support for Egyptian tax rules.

PythonDjangoCeleryPostgreSQLRedisDocker
BCE / System Overview
Client since1970 — bridges, residential, industrial, administration
Est. 1970
RolesCEO · Senior · Accountant · Team Lead · Junior
5 tiers
Modules connectedProjects · Costs · Invoices · Todos · Files · Backups
11 apps
DeploymentDocker on a self-hosted Windows server
24/7
The Result

A 50-year-old engineering firm's entire operation — projects, costs, invoices, staff, backups — now runs on one system instead of scattered spreadsheets and paper trails.

The Client

Behairy Consulting Engineering.

BCE is a global engineering and project-management firm, privately owned and based in Dokki, Cairo, operating since 1970. Their public work spans bridges, residential developments, industrial facilities, and administration buildings — the internal platform below is the software that runs their business behind that work: costs, invoices, staff, and client records, not the buildings themselves.

Visit bce-eg.com ↗
The Breakdown

Spreadsheets & Paper

50 years of records, scattered across files

One Connected Platform

11 apps, one data & permission layer

A Number Everyone Trusts

Real-time, role-scoped, always current

The Problem

A 50-year-old engineering and project-management firm — with decades of bridge, residential, industrial, and administration work behind it — was still running day-to-day operations on spreadsheets and paper trails. Project costs, client invoices, and staff assignments were scattered across files with no single source of truth, no permission model, and no way to see a project's real financial picture without manually reconstructing it.

What I Built

A full Django platform — eleven connected apps covering projects, clients, cost tracking, invoicing, task management, and file storage — gated by a five-tier role system (CEO, Senior, Accountant, Team Lead, Junior) plus a granular per-URL permission layer for one-off exceptions. It's deployed on a self-hosted Windows server converted to run Docker, with WebSocket support for live updates and a full backup/disaster-recovery system underneath it.

Under the Hood

Eleven connected apps.

BCE isn't one feature — it's eleven Django apps sharing the same data and permission layer. A few of the more involved ones got their own full write-ups, linked below.

Clients & Projects

Clients, their contacts, and every project — status workflow across ten states (Draft → Under Study → Assigned → In Progress → Completed), department tags (Structural/Electrical/Architecture/Mechanical), and per-scope fee structures (Review/Design/Workshop/Supervision/R&D).

Cost & Invoice Management

A hierarchical cost-category tree with versioned, SHA-256-hashed cost-file attachments and budget-threshold alerts, paired with invoicing that auto-generates sequential numbers (INV-YYMM-####), tracks partial payments, and auto-updates status between Partial, Closed, and Overdue. Built-in fields for Egyptian e-invoicing. Both apps share the same file-versioning signal, so an updated document never leaves a stale reference behind.

Full case study →

Staff, Assignments & Time Tracking

Project assignments by type (Senior/Team Lead/Junior) with live session tracking — accept, pause, resume, complete — and a correction system that logs who changed what and why, with the original hours preserved.

Task Management

Shared todo lists scoped to a project, client, or assignment, with @mentions of users, projects, clients, or assignments, threaded comments, labels, and its own notification events for shares and mentions.

Virtual Folders & Files

A polymorphic folder tree (attached to either a project or a client) seeded from a standard BCE template — Financial / Discipline (ARCH, STR, ELEC, MECH, each split into IN/WIP/OUT) / Administrative — with JSON-defined role access per folder type.

Full case study →

Document Generation

One-click, print-ready PDF profile sheets per project — or bulk-exported for several at once — built around WeasyPrint's layout quirks, plus scheduled reports and export history in the dashboard app.

Full case study →

Backup & Disaster Recovery

Separate database and media backups, tied together by a restore point that can restore either or both — always taking an automatic safety backup first, with CEO approval required before it runs.

Full case study →

Notifications

One model covering assignment events, invoice events, and todo events, each rendering a type-specific title, message, and action link — read/unread state tracked per recipient.

Email Composer

Compose and export emails as .msg files, deliberately without a send button — internal logging links an email to a project without it ever leaving an audit trail gap.

Granular Permissions

Beyond the five role tiers, every URL in the system can be individually granted or denied per user — with an expiry date and a full audit log of who changed what, and why.

Who can see what.

This is pulled directly from the URL permission map — the actual per-view, per-role defaults, not a rough summary. Five tiers, each enforced identically across every module above.

CEO
Senior
Accountant
Team Lead
Junior
Work assigned projects
Manage team assignments
Cost & invoice access
Full financial report
Ltd
Backup restore approval
Full access Ltd Restricted view only No access

The Accountant row is the interesting one: no project or assignment access at all, but the only role besides CEO with the unrestricted financial report — Senior gets a deliberately limited version of the same page. It's a pure finance specialist role, not a junior CEO.

System Map

How the models connect.

The real relationships between the core models, grouped by what they actually do — core records, day-to-day operations, financial data, and system-level backup — with solid lines as foreign keys and dashed lines as cross-app references. Backup and recovery sit apart deliberately: they operate on the whole system, not a single project.

CLIENT PROJECT USER / ROLE 5 tiers ASSIGNMENT PROJECT COST INVOICE VIRTUAL FOLDER TODO LIST TIME ENTRY INDIRECT COST / EXPECTED TAX INVOICE PAYMENT NOTIFICATION assignment · invoice · todo events DATABASE BACKUP MEDIA BACKUP RESTORE POINT requires CEO approval BACKUP & RECOVERY — SYSTEM-LEVEL, NOT PROJECT-SCOPED Core Operational Financial System / Backup Foreign key Cross-app event
Process

How it works.

01

Model the business

Clients, projects, costs, invoices, assignments, and todos as connected Django models — the single source of truth everything else builds on.

02

Gate by role, then by exception

Five permission tiers set the defaults; a separate per-URL permission model lets any single user be granted or denied access to any single view, with an expiry date and an audit trail.

03

Automate the paperwork

Invoice numbers and payment status generate themselves; profile sheets and financial reports export with one click; every cost file attachment carries its own approval and version history.

04

Keep it running

The server itself started as a Windows PC, converted to run the full stack in Docker — Nginx, Gunicorn, PostgreSQL, Redis, Celery, and Daphne for WebSockets — after migrating off an earlier Waitress/WhiteNoise setup that kept crashing under load.

Outcome
30+
PEOPLE USE IT
DAILY, 5 ROLE TIERS
11
CONNECTED
MODULES
54
YEARS OF CLIENT
HISTORY, NOW DIGITAL
Why it matters

This isn't a demo project — it's the system a real, 50-year-old engineering firm runs its actual business on, every day. That changes what "finished" means: it's not about shipping a feature, it's about a CEO trusting the numbers enough to make payroll decisions from them.