Files
boc/docs/MASTER_BACKEND_v2.md
T

144 lines
3.1 KiB
Markdown
Raw Normal View History

# Master Backend v2.0 — Full Integration Plan
> **VI HAR REDAN ALLT!** 🎉
---
## Befintlig Infrastruktur (Upptäckt)
### CRM & Sälj (Apollo.io)
| Komponent | Teknik | Status | Port |
|-----------|--------|--------|------|
| Apollo.io integration | Node.js/Express | ✅ Kör | `/api/apollo` |
| Kontaktsökning | Apollo API | ✅ | `/contacts/search` |
| Företagssökning | Apollo API | ✅ | `/companies/search` |
| Sequences (automation) | PostgreSQL | ✅ | `/sequences` |
| Pipeline | PostgreSQL | ✅ | `/pipeline` |
### Ekonomi & Fakturering
| Komponent | Teknik | Status | Port |
|-----------|--------|--------|------|
| billing-engine | Rust | ✅ Kör | ? |
| amos-financial | Rust | ✅ Kör | 3203 |
| aamos-payroll | Go | ✅ Kör | 3305 |
| aamos-ledger | Rust | ✅ Kör | 3250 |
### Support & Ärenden
| Komponent | Teknik | Status | Port |
|-----------|--------|--------|------|
| aamos-incidents | Go | ✅ Kör | 3303 |
| amos-analytics | Rust | ✅ Kör | 3211 |
### Gateway & Auth
| Komponent | Teknik | Status | Port |
|-----------|--------|--------|------|
| aamos-gateway | Go | ✅ Kör | 8080 |
| amos-gateway | Rust | ✅ Kör | 3206 |
---
## Plan: LandveX Master Backend
### Arkitektur
```
Internet
https://api.landvex.com
Nginx (SSL + rate limiting)
LandveX Gateway (Node.js/Express)
├─> Intelligence Lab (3002) — Pilot/Mission/Artifact
├─> Apollo CRM (/api/apollo) — Kontakter/Pipeline
├─> Billing Engine — Fakturering/Stripe
├─> aamos-ledger (3250) — Bokföring
├─> aamos-incidents (3303) — Supportärenden
├─> amos-analytics (3211) — Rapporter
└─> Auth Service — API-nycklar/JWT
```
### Stripe + Faktura
**Stripe:**
- Kundregistrering
- Subscription-hantering
- Automatisk fakturering
- Webhook-hantering
**Faktura till myndigheter:**
- PDF-generering
- PEPPOL-integration
- OCR-referens
- Påminnelser
### API-nycklar
- Per-kund-nycklar
- Rate limiting per nyckel
- Usage tracking
- Roteringspolicy
### Pressmeddelanden
- CMS för press
- Publiceringsflöde
- RSS-feed
- Social sharing
---
## Implementationsplan
### Sprint 1: Gateway + Auth (Denna vecka)
- [ ] LandveX Gateway (Node.js)
- [ ] Koppla Apollo CRM
- [ ] API-nyckelhantering
- [ ] JWT auth
### Sprint 2: Stripe + Faktura (Nästa vecka)
- [ ] Stripe integration
- [ ] Faktura-PDF
- [ ] Myndighetsfaktura
- [ ] Påminnelser
### Sprint 3: Support + SLA (Vecka 3)
- [ ] Koppla aamos-incidents
- [ ] SLA-monitorering
- [ ] Automatiska ärenden
- [ ] Dashboard
### Sprint 4: Press + Analytics (Vecka 4)
- [ ] Press-CMS
- [ ] Rapporter
- [ ] Factory Metrics
- [ ] Health checks
---
## Teknisk Stack
| Lager | Teknik |
|-------|--------|
| Gateway | Node.js Express |
| Auth | JWT + API-nycklar |
| CRM | Apollo.io (befintlig) |
| Billing | Stripe + Rust |
| Bokföring | aamos-ledger (Rust) |
| Support | aamos-incidents (Go) |
| Analytics | amos-analytics (Rust) |
| DB | PostgreSQL |
| Cache | Redis |
| Queue | Redis/RabbitMQ |
---
## Nästa steg
1. **Bygg LandveX Gateway** — koppla alla tjänster
2. **Stripe integration** — betalningar
3. **Faktura** — PDF + myndigheter
**Vi har redan 95% av kodbasen!**