Dominion/README.md

63 lines
2.6 KiB
Markdown
Raw Normal View History

2026-08-07 09:48:18 +00:00
# Commercial Banking Balance Sheet & Financial Reporting Portal
2026-08-07 08:06:39 +00:00
2026-08-07 09:48:18 +00:00
A full-stack enterprise web application built for multi-branch balance sheet consolidation, trial balance ledger verification, automated accounting reconciliation, double-entry bookkeeping, and executive financial reporting.
2026-08-07 08:06:39 +00:00
2026-08-07 09:48:18 +00:00
---
2026-08-07 08:06:39 +00:00
2026-08-07 09:48:18 +00:00
## 🚀 Key Features
2026-08-07 08:06:39 +00:00
2026-08-07 09:48:18 +00:00
- **Multi-Branch Operations**: Head Office Admin, Branch Users, Maker-Checker authorization matrix.
- **Server-Side Architecture**: Express backend (`server.ts`) handling state management, calculations, audit logging, and email dispatches.
- **PostgreSQL & Fallback Storage**: Connects to PostgreSQL via `pg` connection pool with automatic fallback to JSON data persistence (`/app/data/portal-data.json`).
- **Containerized Deployment**: Ready for Docker, Docker Compose, and **Coolify** self-hosting.
2026-08-07 08:06:39 +00:00
2026-08-07 09:48:18 +00:00
---
2026-08-07 08:06:39 +00:00
2026-08-07 09:48:18 +00:00
## 📁 Repository Structure & Key Configuration Files
2026-08-07 08:06:39 +00:00
2026-08-07 09:48:18 +00:00
| File | Description |
| :--- | :--- |
| `Dockerfile` & `dockerfile` | Multi-stage production container build (Vite client + Express CJS server). |
2026-08-07 10:35:45 +00:00
| `docker-compose.yml` | Full-stack orchestration (App container mapped to host port 7000 + PostgreSQL container mapped to host port 7001). |
2026-08-07 09:48:18 +00:00
| `.dockerignore` | Defines context exclusions for slim Docker image builds. |
2026-08-07 10:35:45 +00:00
| `.env.example` | Template environment variables (`DATABASE_URL`, `PORT`, `HOST_PORT`, `POSTGRES_HOST_PORT`, `DATA_PATH`, `SMTP_*`). |
2026-08-07 09:48:18 +00:00
| `COOLIFY.md` | Complete deployment guide for Coolify platform & managed databases. |
2026-08-07 10:35:45 +00:00
| `server.ts` | Express server entry point with PostgreSQL initialization, environment SMTP dispatching, and REST API routes. |
2026-08-07 09:48:18 +00:00
---
## 🛠️ Local Development & Running via Docker
2026-08-07 10:35:45 +00:00
### 1. Run via Docker Compose (With PostgreSQL & Non-Conflicting Host Ports)
2026-08-07 09:48:18 +00:00
```bash
docker-compose up --build -d
```
2026-08-07 10:35:45 +00:00
By default, the application will be accessible on host port `http://localhost:7000` (mapped to internal container port `3000`), and PostgreSQL on host port `7001` (mapped to internal container port `5432`), preventing conflicts with common host ports like 3000, 8080, or 5432.
2026-08-07 09:48:18 +00:00
2026-08-07 10:35:45 +00:00
If you wish to use different custom host ports, set them in `.env`:
2026-08-07 09:48:18 +00:00
```env
2026-08-07 10:35:45 +00:00
HOST_PORT=7000
POSTGRES_HOST_PORT=7001
2026-08-07 09:48:18 +00:00
```
### 2. Run via Docker CLI
```bash
docker build -t balance-sheet-portal .
2026-08-07 10:35:45 +00:00
docker run -p 7000:3000 -v portal_data:/app/data balance-sheet-portal
2026-08-07 09:48:18 +00:00
```
### 3. Native Node.js Development
```bash
# Install dependencies
npm install
# Start development server (Express + Vite hot reload)
npm run dev
```
---
## ☁️ Deployment on Coolify
Refer to [`COOLIFY.md`](./COOLIFY.md) for step-by-step instructions on deploying via Docker Compose or Coolify Managed PostgreSQL.