diff --git a/Home.md b/Home.md index 0e2d30d..da96771 100644 --- a/Home.md +++ b/Home.md @@ -1,28 +1,79 @@ # ๐ŸŒฟ CannaManage -**B2B SaaS for German Cannabis Social Clubs (Anbauvereinigungen)** +**Multi-tenant compliance platform for German Cannabis Social Clubs (Anbauvereinigungen)** -> Status: Phase 0 โ€” Planning Complete | Stack: Spring Boot 3.x + PrimeFaces โ†’ Next.js | Legal: โœ… CanG-Compliant +> **Status:** Sprint 2 โœ… Complete | **Stack:** Java 21 + Spring Boot 4.0.6 | **Tests:** 37 green | **Legal:** CanG ยง19 compliant -## Documentation Index +--- -| Document | Description | -|----------|-------------| -| [Project Charter](CannaManage-01-Charter) | Vision, scope, risk register, timeline Gantt chart | -| [User Stories](CannaManage-02-UserStories) | 25 stories with MoSCoW priorities + acceptance criteria | -| [Architecture](CannaManage-03-Architecture) | System diagram, 8-entity ERD, multi-tenancy design | -| [Flow Charts](CannaManage-04-Flowcharts) | 5 business logic flows (distribution, recall, compliance) | -| [API Spec](CannaManage-05-API) | REST API: 7 controllers, 30+ endpoints | -| [Wireframes & Mockups](CannaManage-06-Wireframes) | 6 screen wireframes with AI-generated UI mockups | -| [Coding Standards](CannaManage-07-CodingStandards) | Java 21 standards, compliance code rules, Git strategy | -| [Test Plan](CannaManage-08-TestPlan) | 26 test cases, JaCoCo 100% gate on ComplianceService | -| [Deployment Guide](CannaManage-09-Deployment) | Hetzner VPS, Docker Compose, Gitea CI/CD | -| [Retrospective](CannaManage-10-Retrospective) | Sprint 0 retro: decisions, challenges, Sprint 1 goals | +## ๐Ÿš€ Current State -## Quick Facts +| Milestone | What's Done | Tests | +|-----------|-------------|-------| +| **Sprint 1** โ€” Foundation | 8 JPA entities, ComplianceService (CanG ยง19 enforcement), Flyway V1 | 25 unit tests | +| **Sprint 2** โ€” REST API | 5 controllers, JWT auth, Spring Security 7, OpenAPI, TenantFilterAspect | 12 integration tests | +| **Sprint 3** โ€” Member Portal | _Planned:_ STAFF role, member self-service, real-time notifications | โ€” | -- **Market:** 500โ€“3,000 German Anbauvereinigungen (cannabis social clubs) -- **Revenue Target:** โ‚ฌ39,500 MRR at 500 clubs (Year 3) -- **Legal Basis:** Konsumcannabisgesetz (CanG) ยงยง2, 15-26 โ€” B2B operations software only -- **Architecture:** Spring Boot 3.x + JPA/Hibernate, multi-tenant (shared schema + tenant_id) -- **Source:** [pi_mcps plans/cannabis-club-saas](http://192.168.188.119:30008/pplate/pi_mcps/src/branch/main/plans/cannabis-club-saas) +## ๐Ÿ“‹ Documentation + +| # | Document | Description | +|---|----------|-------------| +| 01 | [Project Charter](CannaManage-01-Charter) | Vision, scope, legal framework, risk register, Gantt timeline | +| 02 | [User Stories](CannaManage-02-UserStories) | 25 stories with MoSCoW priorities + acceptance criteria | +| 03 | [Architecture](CannaManage-03-Architecture) | System diagram, ERD, multi-tenancy design (shared schema + Hibernate @Filter) | +| 04 | [Flow Charts](CannaManage-04-Flowcharts) | Business logic flows: distribution, recall, compliance check | +| 05 | [API Spec](CannaManage-05-API) | REST API: 5 controllers, JWT auth, role-based access | +| 06 | [Wireframes & Mockups](CannaManage-06-Wireframes) | UI mockups for admin dashboard, distribution, quota views | +| 07 | [Coding Standards](CannaManage-07-CodingStandards) | Java 21 standards, compliance patterns, Git strategy | +| 08 | [Test Plan](CannaManage-08-TestPlan) | Test strategy, 37 automated tests, coverage goals | +| 09 | [Deployment Guide](CannaManage-09-Deployment) | Hetzner VPS, Docker Compose, PostgreSQL, Gitea CI/CD | +| 10 | [Retrospective](CannaManage-10-Retrospective) | Sprint retrospectives and decisions log | + +## ๐Ÿ—๏ธ Tech Stack + +| Layer | Technology | +|-------|-----------| +| Language | Java 21 (Temurin) | +| Framework | Spring Boot 4.0.6 | +| Security | Spring Security 7.0 + JWT (stateless, JJWT 0.12.6) | +| ORM | Hibernate 7 / JPA | +| Database | PostgreSQL 16 (prod) ยท H2 (test) | +| Migrations | Flyway 10 | +| Multi-tenancy | Hibernate `@Filter` + `TenantFilterAspect` (AOP) | +| API Docs | SpringDoc OpenAPI 2.8.6 ยท Swagger UI | +| Build | Maven multi-module | +| Hosting | Hetzner VPS (German DC) ยท Docker Compose | + +## ๐Ÿ“ฆ Module Layout + +``` +cannamanage/ +โ”œโ”€โ”€ cannamanage-domain/ โ†’ JPA entities, enums, TenantContext +โ”œโ”€โ”€ cannamanage-service/ โ†’ Business logic, repositories, ComplianceService +โ”œโ”€โ”€ cannamanage-api/ โ†’ Spring Boot app, controllers, security, DTOs +โ””โ”€โ”€ docs/ โ†’ Sprint plans and design docs +``` + +## ๐Ÿ”’ Security Model + +- **Stateless JWT** โ€” no server-side sessions +- **Roles:** ADMIN (full access) ยท MEMBER (self-service) ยท STAFF (Sprint 3) +- **Multi-tenant isolation:** Hibernate @Filter activated per-request via AOP +- **Token rotation:** refresh tokens SHA-256 hashed, rotated on each use + +## ๐Ÿ“Š Quick Facts + +| Metric | Value | +|--------|-------| +| Target Market | 500โ€“3,000 German Anbauvereinigungen | +| Legal Basis | Konsumcannabisgesetz (CanG) ยงยง2, 15โ€“26 | +| Revenue Model | B2B SaaS subscription | +| Entities | 8 (Member, Distribution, MonthlyQuota, Batch, Strain, StockMovement, Club, User) | +| API Endpoints | 15+ across 5 controllers | +| Test Coverage | 37 automated tests (unit + integration) | + +## ๐Ÿ”— Links + +- **Repository:** [git.plate-software.de/pplate/cannamanage](https://git.plate-software.de/pplate/cannamanage) +- **Swagger UI:** `http://localhost:8080/swagger-ui.html` (local dev) +- **Branch:** `main` (current release) ยท `sprint/2-api` (feature branch)