|
| 1 | +# Stratos — Cloud Foundry Web Console |
| 2 | + |
| 3 | +## Identity |
| 4 | + |
| 5 | +Web-based management console for Cloud Foundry and Kubernetes. Angular 20 |
| 6 | +frontend, Go backend (Echo v4), plugin architecture. |
| 7 | + |
| 8 | +## Plans |
| 9 | + |
| 10 | +All plans MUST be stored in the **repository's** `plans/` directory. |
| 11 | + |
| 12 | +**Naming**: Descriptive kebab-case (e.g., `stratos-developer-environment.md`). |
| 13 | + |
| 14 | +**Authority**: The repo plan file is the single source of truth for any task. |
| 15 | + |
| 16 | +## Development Rules |
| 17 | + |
| 18 | +### Commit Rules |
| 19 | + |
| 20 | +| Rule | Constraint | |
| 21 | +|------|------------| |
| 22 | +| Subject | Max 48 characters | |
| 23 | +| Body | Max 72 characters wide | |
| 24 | +| Scope | Single atomic concept | |
| 25 | +| Format | Imperative mood | |
| 26 | +| Style | Never mix with functional changes | |
| 27 | + |
| 28 | +DO NOT use `<type>: <summary>` format in subjects. |
| 29 | + |
| 30 | +### Branch Rules |
| 31 | + |
| 32 | +All changes go to **feature branches** off `develop`. Never push directly |
| 33 | +to `develop` or `master`. |
| 34 | + |
| 35 | +### Code Style |
| 36 | + |
| 37 | +- **Frontend**: Prefer Tailwind over SCSS for new code. Use semantic color |
| 38 | + classes (`text-content-text`, `text-content-muted`) not raw grays. |
| 39 | +- **Backend**: Standard Go conventions. `go fmt` and `go vet` must pass. |
| 40 | +- **Testing**: Vitest for frontend, Go `testing` for backend, Playwright for E2E. |
| 41 | + |
| 42 | +### AI Tool Usage |
| 43 | + |
| 44 | +Cloud Foundry RFC-0047 requires disclosure of AI tooling in contributions. |
| 45 | +Disclose in PR description, commit messages, or co-author line. |
| 46 | + |
| 47 | +## Build System |
| 48 | + |
| 49 | +Makefile uses **verb + target** pattern: `make build frontend`, `make test backend`. |
| 50 | + |
| 51 | +### Key Commands |
| 52 | + |
| 53 | +```bash |
| 54 | +make build # frontend + backend (native platform) |
| 55 | +make build PLATFORM=linux/amd64 # cross-compile backend |
| 56 | +make build all # all platforms (OS/arch suffix on binary) |
| 57 | +make test # all tests |
| 58 | +make lint # ESLint + go fmt + go vet |
| 59 | +make release cf # package for CF (validates Linux binary) |
| 60 | +make dump version # show version info |
| 61 | +make help # all targets |
| 62 | +``` |
| 63 | + |
| 64 | +### Version Resolution |
| 65 | + |
| 66 | +Source of truth: `package.json` `version` field. Override with `VERSION=` on |
| 67 | +make command line. `version.mk` parses semver and generates frontend |
| 68 | +`build-info.ts` + Go ldflags. |
| 69 | + |
| 70 | +### CF Deploy Process |
| 71 | + |
| 72 | +1. `make build PLATFORM=linux/amd64` — cross-compile for CF |
| 73 | +2. `make release cf` — validates Linux ELF binary, packages zip |
| 74 | +3. `cf target -o system -s stratos` — ALWAYS before push |
| 75 | +4. `cf push -f dist/cf-package/manifest.yml -p dist/stratos-cf-*.zip` |
| 76 | + |
| 77 | +IMPORTANT: `make release cf` uses `dist/bin/jetstream` (no OS/arch suffix). |
| 78 | +Must be a Linux binary or packaging fails with clear error. Never use |
| 79 | +`--no-route` on `cf push` — it drops route mappings. |
| 80 | + |
| 81 | +## Architecture |
| 82 | + |
| 83 | +### Frontend |
| 84 | + |
| 85 | +- Angular 20, NgRx state, Tailwind CSS |
| 86 | +- Packages: `core/`, `store/`, `cloud-foundry/`, `kubernetes/`, `shared/` |
| 87 | +- Build: `@stratos/builders:prebuild-application` custom builder |
| 88 | +- Path aliases: `@stratosui/core`, `@stratosui/store`, etc. |
| 89 | + |
| 90 | +### Backend |
| 91 | + |
| 92 | +- Go 1.24.2, Echo v4, plugin architecture |
| 93 | +- Plugins: `cfapppush/`, `kubernetes/`, `monocular/`, `analysis/`, `userinvite/` |
| 94 | +- Database: PostgreSQL (recommended), MySQL/MariaDB, SQLite |
| 95 | +- Migrations: Goose (dialect-aware, auto-runs on startup) |
| 96 | +- Config: 5-tier lookup: DB store > env vars > CF UPS > .env file > /etc/secrets |
| 97 | + |
| 98 | +### Runtime Versions |
| 99 | + |
| 100 | +Pinned in `.tool-versions` (use `mise install` or `asdf install`): |
| 101 | + |
| 102 | +| Tool | Version | |
| 103 | +|------|---------| |
| 104 | +| Node.js | 24.11.0 | |
| 105 | +| Bun | 1.3.2 | |
| 106 | +| Go | 1.24.2 | |
| 107 | + |
| 108 | +`build/check-versions.cjs` validates versions before tests (pretest hook). |
| 109 | + |
| 110 | +## Key Files |
| 111 | + |
| 112 | +| File | Purpose | |
| 113 | +|------|---------| |
| 114 | +| `Makefile` | Build orchestration (verb+target) | |
| 115 | +| `version.mk` | Version resolution, ldflags, fe-version | |
| 116 | +| `package.json` | Version source of truth | |
| 117 | +| `.tool-versions` | Runtime version specs | |
| 118 | +| `build/release-cf.sh` | CF packaging with Linux validation | |
| 119 | +| `build/check-versions.cjs` | Runtime version validation | |
| 120 | +| `proxy.conf.cjs` | Dev server proxy config | |
| 121 | + |
| 122 | +## Documentation |
| 123 | + |
| 124 | +| Doc | Audience | |
| 125 | +|-----|----------| |
| 126 | +| `docs/contributing_guide.md` | New contributors | |
| 127 | +| `docs/developer-environment.md` | Experienced developers | |
| 128 | +| `docs/pagination-architecture.md` | List/table internals | |
| 129 | +| `plans/ui-enhancement-analysis.md` | 44-item UI priority list | |
| 130 | +| `plans/stratos-developer-environment.md` | Dev environment plan | |
| 131 | + |
| 132 | +## Jira |
| 133 | + |
| 134 | +- **FWT**: FiveTwenty project for Stratos UI work |
| 135 | +- **FWT-840**: Build system improvement ideas |
| 136 | +- **FWT-811**: UI enhancement umbrella (44 items) |
| 137 | +- **FWT-834**: Apps list regression (under investigation) |
| 138 | + |
| 139 | +## Knowledge Store |
| 140 | + |
| 141 | +Obsidian vault: `/Users/norm/Projects/Tools/obsidian-knowledge-store/stratos/` |
0 commit comments