Go to file
Christian 3a8288f5a1 feat: Implement quick analysis on PDF upload for CVR, document type, and number extraction
- Added `check_invoice_number_exists` method in `EconomicService` to verify invoice numbers in e-conomic journals.
- Introduced `quick_analysis_on_upload` method in `OllamaService` for extracting critical fields from uploaded PDFs, including CVR, document type, and document number.
- Created migration script to add new fields for storing detected CVR, vendor ID, document type, and document number in the `incoming_files` table.
- Developed comprehensive tests for the quick analysis functionality, validating CVR detection, document type identification, and invoice number extraction.
2025-12-09 14:54:33 +01:00
.github Add Material Blue design templates for dashboard and customer overview pages 2025-12-06 02:22:01 +01:00
app feat: Implement quick analysis on PDF upload for CVR, document type, and number extraction 2025-12-09 14:54:33 +01:00
data Initial BMC Hub setup 2025-12-05 14:22:39 +01:00
docs feat: Implement supplier invoices management with e-conomic integration 2025-12-07 03:29:54 +01:00
logs Initial BMC Hub setup 2025-12-05 14:22:39 +01:00
migrations feat: Implement quick analysis on PDF upload for CVR, document type, and number extraction 2025-12-09 14:54:33 +01:00
scripts feat: Implement quick analysis on PDF upload for CVR, document type, and number extraction 2025-12-09 14:54:33 +01:00
static/design_templates feat: Implement quick analysis on PDF upload for CVR, document type, and number extraction 2025-12-09 14:54:33 +01:00
uploads Initial BMC Hub setup 2025-12-05 14:22:39 +01:00
.dockerignore Initial BMC Hub setup 2025-12-05 14:22:39 +01:00
.env.bak feat: Add template editing functionality and improve file loading logic 2025-12-08 23:46:18 +01:00
.env.example Fix watchfiles spam and port conflicts 2025-12-05 14:42:18 +01:00
.env.prod.example Initial BMC Hub setup 2025-12-05 14:22:39 +01:00
.gitignore Initial BMC Hub setup 2025-12-05 14:22:39 +01:00
DEVELOPMENT.md Initial BMC Hub setup 2025-12-05 14:22:39 +01:00
docker-compose.prod.yml Initial BMC Hub setup 2025-12-05 14:22:39 +01:00
docker-compose.yml feat: Add template editing functionality and improve file loading logic 2025-12-08 23:46:18 +01:00
docker-compose.yml.bak2 feat: Add template editing functionality and improve file loading logic 2025-12-08 23:46:18 +01:00
docker-compose.yml.bak3 feat: Add template editing functionality and improve file loading logic 2025-12-08 23:46:18 +01:00
Dockerfile feat: Implement supplier invoices management with e-conomic integration 2025-12-07 03:29:54 +01:00
LICENSE Initial commit 2025-12-05 14:21:01 +01:00
main.py feat: Implement supplier invoices management with e-conomic integration 2025-12-07 03:29:54 +01:00
nohup.out feat: Implement supplier invoices management with e-conomic integration 2025-12-07 03:29:54 +01:00
README.md Update README with port configuration and reload notes 2025-12-05 14:42:43 +01:00
requirements.txt feat: Implement quick analysis on PDF upload for CVR, document type, and number extraction 2025-12-09 14:54:33 +01:00
test_ai_analyze.py feat: Enhance billing frontend with Jinja2 templates and improve invoice handling 2025-12-08 09:15:52 +01:00
test_cvr_filter.py feat: Enhance billing frontend with Jinja2 templates and improve invoice handling 2025-12-08 09:15:52 +01:00
test_quick_analysis.py feat: Implement quick analysis on PDF upload for CVR, document type, and number extraction 2025-12-09 14:54:33 +01:00

BMC Hub 🚀

Et centralt management system til BMC Networks - håndterer kunder, services, hardware og billing.

Baseret på OmniSync arkitektur med Python + PostgreSQL

🌟 Features

  • Customer Management: Komplet kundedatabase med CRM integration
  • Hardware Tracking: Registrering og sporing af kundeudstyr
  • Service Management: Håndtering af services og abonnementer
  • Billing Integration: Automatisk fakturering via e-conomic
  • REST API: FastAPI med OpenAPI dokumentation
  • Web UI: Responsive Bootstrap 5 interface
  • PostgreSQL: Production-ready database
  • Docker: Container deployment med version control

📚 Quick Start

Lokal Udvikling

# 1. Clone repository
git clone git@g.bmcnetworks.dk:ct/bmc_hub.git
cd bmc_hub

# 2. Kopier og rediger .env
cp .env.example .env
nano .env  # Tilføj dine credentials

# 3. Start med Docker Compose
docker-compose up -d

# 4. Åbn browser
open http://localhost:8001/api/docs  # API docs
open http://localhost:8001            # Web UI

Standard ports (for at undgå konflikter):

  • API: 8001 (mapped til container port 8000)
  • PostgreSQL: 5433 (mapped til container port 5432)

Note: Auto-reload er deaktiveret som standard for at undgå log spam. Når du ændrer kode, skal du genstarte containeren:

docker-compose restart api

Hvis du ønsker live reload (med potentiel log spam), sæt ENABLE_RELOAD=true i .env.

Live Deployment

# På serveren
cd /opt
git clone git@g.bmcnetworks.dk:ct/bmc_hub.git
cd bmc_hub

# Setup environment
cp .env.prod.example .env
nano .env  # Udfyld credentials og version tag

# Deploy
docker-compose -f docker-compose.prod.yml up -d

🛠️ Deployment Commands

Lokal Development

docker-compose up -d        # Start systemet
docker-compose logs -f      # Se logs
docker-compose down         # Stop systemet

Production

docker-compose -f docker-compose.prod.yml up -d    # Start
docker-compose -f docker-compose.prod.yml pull     # Update til ny version
docker-compose -f docker-compose.prod.yml restart  # Restart

📋 Krav

Development

  • Docker Desktop eller Podman
  • Git

Production

  • Docker eller Podman
  • PostgreSQL (via container)
  • Nginx reverse proxy
  • SSL certifikat

🏗️ Projekt Struktur

bmc_hub/
├── app/
│   ├── core/
│   │   ├── config.py          # Konfiguration
│   │   └── database.py        # PostgreSQL helpers
│   ├── models/
│   │   └── schemas.py         # Pydantic models
│   ├── routers/
│   │   ├── customers.py       # Customer CRUD
│   │   ├── hardware.py        # Hardware management
│   │   └── billing.py         # Billing endpoints
│   ├── services/
│   │   └── economic.py        # e-conomic integration
│   └── jobs/
│       └── sync_job.py        # Scheduled jobs
├── static/
│   └── index.html             # Dashboard UI
├── migrations/                 # Database migrations
├── docker-compose.yml          # Local development
├── docker-compose.prod.yml     # Production deployment
├── Dockerfile                  # Docker image
├── requirements.txt            # Python dependencies
├── .env.example                # Environment template (local)
├── .env.prod.example           # Environment template (production)
└── main.py                     # FastAPI application

🔌 API Endpoints

  • GET /api/v1/customers - List customers
  • GET /api/v1/hardware - List hardware
  • GET /api/v1/billing/invoices - List invoices
  • GET /health - Health check

Se fuld dokumentation: http://localhost:8000/api/docs

🧪 Testing

# Install test dependencies
pip install pytest pytest-cov

# Run tests
pytest

# Run with coverage
pytest --cov=app

📄 License

MIT License

📞 Support


Made with ❤️ by BMC Networks