Skip to content

Commit bf06565

Browse files
committed
Add workshop materials and technical architecture diagram
- Introduced a new technical architecture diagram for the platform in Mermaid format. - Expanded the table of contents to include a comprehensive workshop section with modules, labs, and checklists. - Created multiple lab documents covering various topics such as model creation, authorization, internationalization, and background jobs. - Added a commands cheat sheet for quick reference during workshops. - Developed a preflight checklist to ensure participants are prepared before the workshop. - Structured workshop modules to guide participants through local setup, data conventions, authorization, and more.
1 parent ba4eff7 commit bf06565

19 files changed

+492
-0
lines changed
80.5 KB
Loading

docs/diagrams/exports/svg/platform_technical_architecture.svg

Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
flowchart TB
2+
subgraph Client
3+
B[Browser]
4+
end
5+
6+
subgraph WebApp[Rails Engine]
7+
C[Controllers]
8+
V[Views & Stimulus]
9+
P[Policies & RBAC]
10+
M[Models]
11+
end
12+
13+
subgraph Jobs[Background Jobs]
14+
SJ[Sidekiq Workers]
15+
N[Notifications - Noticed]
16+
end
17+
18+
subgraph Data
19+
DB[(PostgreSQL + PostGIS)]
20+
ES[(Elasticsearch)]
21+
REDIS[(Redis)]
22+
AS[(Active Storage)]
23+
end
24+
25+
subgraph External
26+
SMTP[Email Service]
27+
GEO[Geocoding API]
28+
end
29+
30+
AC[Action Cable]
31+
32+
B -->|HTTP| C
33+
C --> P
34+
C --> M
35+
C --> V
36+
V --> B
37+
C --> AC
38+
39+
M --> DB
40+
M --> ES
41+
M --> AS
42+
SJ --> DB
43+
SJ --> ES
44+
SJ --> AS
45+
SJ --> N
46+
N --> SMTP
47+
AC --> REDIS
48+
SJ --> GEO
49+
50+
classDef web fill:#e3f2fd,stroke:#90caf9
51+
classDef jobs fill:#fff3e0,stroke:#ffb74d
52+
classDef data fill:#e8f5e9,stroke:#81c784
53+
classDef ext fill:#f3e5f5,stroke:#ba68c8
54+
55+
class C,V,P,M,AC web
56+
class SJ,N jobs
57+
class DB,ES,REDIS,AS data
58+
class SMTP,GEO ext

docs/table_of_contents.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,23 @@ Welcome to the comprehensive documentation for the Better Together Community Eng
102102
*Mermaid diagrams and visual system documentation*
103103
- [📝 README](diagrams/README.md) - Diagram system overview
104104

105+
#### 🧭 **Workshop** - [`workshop/`](workshop/)
106+
- [📘 Index](workshop/index.md) - Course overview and materials
107+
- [🧭 Module 00: Orientation](workshop/module_00_orientation.md)
108+
- [🏗️ Module 01: Big Picture Architecture](workshop/module_01_big_picture_architecture.md)
109+
- [💻 Module 02: Local Setup (Docker)](workshop/module_02_local_setup.md)
110+
- [🧱 Module 03: Data & Conventions](workshop/module_03_data_and_conventions.md)
111+
- [🔐 Module 04: Authorization & Privacy](workshop/module_04_authorization_and_privacy.md)
112+
- [🌍 Module 05: I18n & UI](workshop/module_05_i18n_and_ui.md)
113+
- [📣 Module 06: Jobs, Notifications, Search](workshop/module_06_jobs_notifications_search.md)
114+
- [✅ Preflight Checklist](workshop/checklists/preflight_checklist.md)
115+
- [⌨️ Commands Cheat Sheet](workshop/cheat_sheets/commands_cheat_sheet.md)
116+
- [🧪 Lab 01: Hello Engine](workshop/labs/lab_01_hello_engine.md)
117+
- [🧪 Lab 02: Model + Migration](workshop/labs/lab_02_model_and_migration.md)
118+
- [🧪 Lab 03: Policy & Token Access](workshop/labs/lab_03_policy_and_token_access.md)
119+
- [🧪 Lab 04: I18n Add Strings & Health](workshop/labs/lab_04_i18n_add_strings_and_health.md)
120+
- [🧪 Lab 05: Notifier + Job + ES Query](workshop/labs/lab_05_notifier_and_job_with_es_query.md)
121+
105122
##### **Diagram Sources** - [`diagrams/source/`](diagrams/source/)
106123
*Mermaid (.mmd) source files*
107124
- [👤 Accounts Flow](diagrams/source/accounts_flow.mmd)
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Commands Cheat Sheet
2+
3+
Use these commands during workshops and daily development.
4+
5+
## Core
6+
- Run tests: `bin/dc-run bin/ci`
7+
- RSpec (file): `bin/dc-run bundle exec rspec spec/path/to/file_spec.rb`
8+
- RSpec (line): `bin/dc-run bundle exec rspec spec/path/to/file_spec.rb:123`
9+
- Lint: `bin/dc-run bundle exec rubocop`
10+
- Security: `bin/dc-run bundle exec brakeman --quiet --no-pager`
11+
- I18n normalize: `bin/dc-run bin/i18n normalize`
12+
- I18n health: `bin/dc-run bin/i18n health`
13+
14+
## Docker & Services
15+
- Up services: `./bin/dc-up`
16+
- Restart: `./bin/dc-restart`
17+
- Logs: `./bin/dc-logs`
18+
19+
## Diagrams
20+
- Render all: `./bin/render_diagrams --force`
21+
- Render specific: `./bin/render_diagrams events_flow.mmd`
22+
23+
## Rails (Dummy App Context)
24+
- Console: `bin/dc-run-dummy rails console`
25+
- Migrate: `bin/dc-run-dummy rails db:migrate`
26+
27+
## Notes
28+
- Always use `bin/dc-run` for commands that need DB/Redis/ES
29+
- RSpec does not support hyphenated line ranges
30+
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Preflight Checklist
2+
3+
Use this checklist before attending Module 02.
4+
5+
## System
6+
- Docker Desktop (or equivalent) installed and running
7+
- 8 GB RAM free (recommended), 4 CPU cores available (recommended)
8+
- Git installed; SSH keys configured (optional)
9+
- Code editor with Markdown and Ruby support
10+
11+
## Repository
12+
- Clone repository
13+
- Install pre‑commit hooks (optional)
14+
- Read `AGENTS.md` command guide and testing rules
15+
16+
## Network & Ports
17+
- Ensure Elasticsearch, Postgres, Redis default ports are free if used directly
18+
- Corporate proxies configured (if applicable)
19+
20+
## Quick Verification
21+
- `./bin/dc-up` starts without errors
22+
- `bin/dc-run bin/ci` runs and reports spec progress
23+
- `bin/dc-run bin/i18n health` reports healthy or lists actionable items
24+

docs/workshop/index.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Community Engine Developer/IT Workshop
2+
3+
Welcome! This workshop series orients developers and IT operators from local development through production operations with the Community Engine.
4+
5+
## Audience & Format
6+
- Audience: mixed developers and IT operators
7+
- Format: 8 modules (2–3 hours each) + optional office hours
8+
- Prereqs: Docker Desktop (or compatible), Git, a modern code editor, and basic terminal skills
9+
10+
## Learning Outcomes
11+
- Run the full stack locally with Docker, and validate services
12+
- Understand the architecture: web, jobs, search, storage, privacy/policies
13+
- Build and test features using the project’s TDD patterns
14+
- Internationalize UI, deliver notifications, and index/search content
15+
- Deploy to Dokku, operate day‑2 tasks (monitoring, backups, incidents)
16+
17+
## Structure
18+
- Modules: overview lectures + guided demos + labs
19+
- Labs: bite‑sized tasks to apply concepts
20+
- Checklists: preflight, deployment, and incident response
21+
- Cheat sheets: commands, testing, i18n, Docker
22+
23+
## Quick Links
24+
- Checklist: Preflight Environment — ./checklists/preflight_checklist.md
25+
- Cheat Sheet: Commands — ./cheat_sheets/commands_cheat_sheet.md
26+
- Lab 01: Hello Engine — ./labs/lab_01_hello_engine.md
27+
- Big‑Picture Diagram — ../diagrams/source/platform_technical_architecture.mmd
28+
29+
## Modules
30+
- Module 00: Orientation — ./module_00_orientation.md
31+
- Module 01: Big Picture Architecture — ./module_01_big_picture_architecture.md
32+
- Module 02: Local Setup (Docker) — ./module_02_local_setup.md
33+
- Modules 03–08: See syllabus in Module 00
34+
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Lab 01 — Hello Engine
2+
3+
A short lab to verify your environment and get familiar with core commands.
4+
5+
## Objectives
6+
- Verify services start and tests run
7+
- Render diagrams once to ensure tooling works
8+
9+
## Steps
10+
1. Start services: `./bin/dc-up`
11+
2. Run test suite: `bin/dc-run bin/ci`
12+
3. Check lint/security: `bin/dc-run bundle exec rubocop`; `bin/dc-run bundle exec brakeman --quiet --no-pager`
13+
4. i18n health: `bin/dc-run bin/i18n health`
14+
5. Render diagrams: `./bin/render_diagrams --force`
15+
16+
## Expected Results
17+
- Tests run without infrastructure connection errors
18+
- i18n health reports OK or actionable missing keys
19+
- Diagram exports present in `docs/diagrams/exports/{png,svg}`
20+
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Lab 02 — Model + Migration with Tests
2+
3+
Create a simple model using migration helpers, add string enums, and write request‑first tests.
4+
5+
## Objectives
6+
- Create a `create_bt_table` migration using helpers
7+
- Define a string enum on the model
8+
- Write a request spec to exercise basic create/show
9+
10+
## Steps
11+
1. Generate migration and model skeleton (manual or via Rails generator inside dc‑run)
12+
2. In the migration:
13+
- Use `create_bt_table :example_items` block
14+
- Add `t.string :status, default: "pending"`
15+
- Add `t.bt_references :person, null: false`
16+
3. In the model:
17+
- `enum :status, { pending: "pending", active: "active" }`
18+
- Validations for required fields
19+
4. Write a request spec for `POST /example_items` and `GET /example_items/:id`
20+
5. Run tests: `bin/dc-run bin/ci` (or targeted rspec command)
21+
22+
## Tips
23+
- Follow naming and engine prefix conventions in routes/controllers
24+
- Prefer request specs over controller specs to avoid engine routing pitfalls
25+
- Add missing translations with `bin/dc-run bin/i18n add-missing`
26+
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Lab 03 — Policy & Token Access
2+
3+
Practice adding an authorization rule and verifying event access via an invitation token.
4+
5+
## Objectives
6+
- Update or add a Pundit policy rule
7+
- Verify token‑scoped access to a private event
8+
- Exercise policy scope to include events visible via token
9+
10+
## Steps
11+
1. Identify a read rule to tighten (e.g., restrict show without token)
12+
2. Update the corresponding policy and scope
13+
3. Create a pending `EventInvitation` in a spec and pass its token as a param
14+
4. Write a request spec asserting:
15+
- Without token: 302 to sign‑in or 404 (depending on platform privacy)
16+
- With valid token: 200 OK and content present
17+
5. Run tests: `bin/dc-run bin/ci`
18+
19+
## Tips
20+
- Use request specs so engine routing and privacy hooks are exercised
21+
- Reuse factories for Person, Event, and EventInvitation if available
22+
- Review `EventsController` privacy override for token handling
23+

0 commit comments

Comments
 (0)