CLAUDE.md Template for Angular Material + FastAPI + RabbitMQ
A CLAUDE.md template starter for a full-stack Angular Material frontend with FastAPI backend and RabbitMQ messaging, using Claude Code.
Target User
Developers building a full-stack Angular Material frontend with FastAPI backend and RabbitMQ messaging
Use Cases
- Full-stack starter template
- CLI and code scaffolding using Claude Code
- Architecture governance with CLAUDE.md
Markdown Template
CLAUDE.md Template for Angular Material + FastAPI + RabbitMQ
# CLAUDE.md
Project role: You are a Claude Code assistant that generates a full-stack starter for an Angular Material frontend, a FastAPI backend, and RabbitMQ messaging. Your output must be a concrete, paste-ready blueprint that a developer can drop into CLAUDE.md to bootstrap the project.
Architecture rules:
- Separate frontend, backend, and messaging concerns into dedicated folders.
- Frontend uses Angular + Angular Material; backend uses FastAPI; messaging uses RabbitMQ.
- Backend exposes REST endpoints and asynchronous task handlers with RabbitMQ producers/consumers.
- All services run in containers; use docker-compose for local dev.
File structure rules:
- Root contains frontend/, backend/, messaging/ with minimal config files.
- Each service includes a clear src/ tree and a small set of reusable utilities.
- Avoid coupling across layers; communicate via well-defined interfaces.
Authentication rules:
- Use OAuth2 with JWT tokens for backend APIs.
- Frontend stores access tokens in memory; refresh tokens rotated via backend.
Database rules:
- Use PostgreSQL for persistent storage; model with Pydantic + SQLAlchemy.
- Database URL provided via environment; migrations managed with alembic.
Validation rules:
- Define Pydantic models for request/response schemas.
- Validate input types strictly; reject unknown fields.
Security rules:
- Enforce CORS, TLS in production, and secure secret management.
- Do not embed secrets in code; use environment variables or secret stores.
- Enable rate limiting on critical endpoints.
Testing rules:
- Backend: pytest with HTTPX; unit and integration tests for API and messaging.
- Frontend: unit tests with Jest; component tests for Material components.
- Include end-to-end tests where feasible.
Deployment rules:
- Docker Compose for local dev; separate prod manifests for Kubernetes or cloud runs.
- Use environment-based configurations; avoid hard-coded credentials.
- Health checks and graceful shutdowns configured.
Things Claude must not do:
- Do not bypass authentication or permissions checks.
- Do not generate insecure defaults.
- Do not assume external databases without explicit config.
- Do not emit production secrets or hard-coded keys.Overview
CLAUDE.md template is a copyable Claude Code blueprint that enables a reproducible starter for a full-stack project combining an Angular Material frontend, a FastAPI backend, and RabbitMQ messaging. It encodes stack-specific conventions, layout, and production rules so Claude Code can generate a consistent baseline you can paste into CLAUDE.md.
Stack coverage: Angular Material (frontend), FastAPI (backend), RabbitMQ (messaging).
When to Use This CLAUDE.md Template
- Starting a new project with these technologies to ensure consistency across teams.
- Onboarding new engineers with a shareable, opinionated starter.
- Enforcing architecture, security, and deployment rules from day one.
Copyable CLAUDE.md Template
# CLAUDE.md
Project role: You are a Claude Code assistant that generates a full-stack starter for an Angular Material frontend, a FastAPI backend, and RabbitMQ messaging. Your output must be a concrete, paste-ready blueprint that a developer can drop into CLAUDE.md to bootstrap the project.
Architecture rules:
- Separate frontend, backend, and messaging concerns into dedicated folders.
- Frontend uses Angular + Angular Material; backend uses FastAPI; messaging uses RabbitMQ.
- Backend exposes REST endpoints and asynchronous task handlers with RabbitMQ producers/consumers.
- All services run in containers; use docker-compose for local dev.
File structure rules:
- Root contains frontend/, backend/, messaging/ with minimal config files.
- Each service includes a clear src/ tree and a small set of reusable utilities.
- Avoid coupling across layers; communicate via well-defined interfaces.
Authentication rules:
- Use OAuth2 with JWT tokens for backend APIs.
- Frontend stores access tokens in memory; refresh tokens rotated via backend.
Database rules:
- Use PostgreSQL for persistent storage; model with Pydantic + SQLAlchemy.
- Database URL provided via environment; migrations managed with alembic.
Validation rules:
- Define Pydantic models for request/response schemas.
- Validate input types strictly; reject unknown fields.
Security rules:
- Enforce CORS, TLS in production, and secure secret management.
- Do not embed secrets in code; use environment variables or secret stores.
- Enable rate limiting on critical endpoints.
Testing rules:
- Backend: pytest with HTTPX; unit and integration tests for API and messaging.
- Frontend: unit tests with Jest; component tests for Material components.
- Include end-to-end tests where feasible.
Deployment rules:
- Docker Compose for local dev; separate prod manifests for Kubernetes or cloud runs.
- Use environment-based configurations; avoid hard-coded credentials.
- Health checks and graceful shutdowns configured.
Things Claude must not do:
- Do not bypass authentication or permissions checks.
- Do not generate insecure defaults.
- Do not assume external databases without explicit config.
- Do not emit production secrets or hard-coded keys.
Recommended Project Structure
frontend/
src/
app/
components/
services/
angular.json
package.json
backend/
main.py
app/
api/
models/
routers/
requirements.txt
messaging/
docker-compose.yml
rabbitmq/
Core Engineering Principles
- Explicit contracts between frontend, backend and messaging layers.
- Minimal surface area; avoid leaking implementation details.
- Test-driven scaffolding; include unit and integration tests by default.
- Environment-driven configuration; avoid hard-coded values.
- Idempotent operations and clear error handling.
Code Construction Rules
- Frontend uses Angular Material components with a clean, accessible UI.
- Backend endpoints are documented with OpenAPI; use Pydantic models for validation.
- RabbitMQ integration uses asynchronous tasks; include a producer and a consumer in separate modules.
- Directory structure matches the Recommended Project Structure for clarity.
- Authentication and authorization checks are applied consistently across endpoints.
- Validation rules enforce strict typing and reject unexpected fields.
- Security controls are centralized and not scattered across modules.
- Testing hooks are wired to run in CI; mocks/stubs used for external services.
- Deployment configuration uses environment variables, not hard-coded values.
- Do not bypass security, and do not generate code that weakly handles secrets.
Security and Production Rules
- Use TLS/HTTPS in production; set up reverse proxy termination.
- Store secrets in environment variables or secret stores; never embed in code.
- Limit permissions for each service; least-privilege IAM or RBAC where applicable.
- Enable CORS only for known frontend origins; configure robust authentication gates.
- Implement robust logging and centralized observability (structured logs, traces).
Testing Checklist
- Backend: unit tests for validators, integration tests for endpoints and messaging via RabbitMQ.
- Frontend: unit tests for components, integration tests for services, end-to-end smoke tests if feasible.
- CI: run tests on push; ensure linting and type checks pass.
- Deployment: verify health checks, readiness probes, and docker image integrity.
Common Mistakes to Avoid
- Assuming the frontend and backend can share models without synchronization.
- Overlooking input validation; assume clients can send arbitrary data.
- Neglecting RabbitMQ topology changes or lack of idempotent message handling.
- Hard-coding environment specifics; rely on external config and secrets management.
- Weak or missing authentication/authorization rules in API endpoints.
FAQ
- What is this CLAUDE.md Template?
This is a copyable Claude Code blueprint for Angular Material + FastAPI + RabbitMQ that you can paste into CLAUDE.md to generate a consistent starter project.
- Which stack does it cover?
Angular Material frontend, FastAPI backend, and RabbitMQ messaging integration.
- How do I run the template locally?
Follow the Recommended Project Structure and start the services with docker-compose; ensure environment vars are properly set.
- How is security handled?
JWT-based authentication, TLS in production, and secrets management via environment vars or secret stores.
- How do I test and deploy?
Run unit/integration tests; use CI; deploy with docker-compose locally and orchestration in production.