CLAUDE.md TemplatesTemplate
CLAUDE.md Template: Angular Material + FastAPI Celery Starter
Copyable CLAUDE.md template for Angular Material + FastAPI Celery stack to jumpstart Claude Code projects.
claude-md-templateangular-materialfastapiceleryclaude-codefull-stackfrontend-backendtypescriptpythonweb-app
Target User
Developers building a full-stack app with Angular Material frontend and FastAPI backend using Celery
Use Cases
- Scaffold CLAUDE.md for a full-stack Angular Material + FastAPI Celery project
- Provide a reproducible CLAUDE Code template for onboarding new developers
Markdown Template
CLAUDE.md Template: Angular Material + FastAPI Celery Starter
# CLAUDE.md
Project role
- You are Claude, a Claude Code assistant responsible for generating a complete CLAUDE.md template for an Angular Material frontend, a FastAPI backend, and a Celery worker
Architecture rules
- Frontend communicates with backend via REST API
- Backend exposes endpoints secured with JWT
- Celery worker subscribes to Redis broker and processes async tasks
- Use Redis as broker and result backend
- Do not bypass authentication or expose secret keys
File structure rules
- Place a CLAUDE.md in the project root
- Backend code in backend/app
- Frontend code in frontend/angular
- Celery tasks in backend/celery
Authentication rules
- Use OAuth2 password flow with JWT for API endpoints
- Validate tokens on every protected route
- Secrets managed via environment variables, not hard-coded
Database rules
- Use PostgreSQL with SQLAlchemy models
- Validate inputs with Pydantic models
- Do not perform schema changes outside migrations
Validation rules
- Validate all inputs in FastAPI with Pydantic models
- Validate Celery task payloads before enqueue
Security rules
- Use HTTPS in production
- Restrict CORS to frontend domain
- Never log secrets or tokens
Testing rules
- Unit test FastAPI endpoints with pytest and httpx
- Test Celery task serialization and result backends
- Include integration tests for frontend-backend flow
Deployment rules
- Use docker-compose for local dev
- Include separate Dockerfiles for frontend and backend
- Use a shared Redis container for broker
Things Claude must not do
- Do not modify production data directly
- Do not bypass authentication checks
- Do not hard-code secrets in code blocksOverview
CLAUDE.md template for Angular Material + FastAPI Celery provides a copyable CLAUDE.md starter that configures a full-stack project and demonstrates Claude Code usage for this stack. It includes frontend Angular Material components, a FastAPI backend, and a Celery task queue for async work. The template is designed to be pasted directly into CLAUDE.md so you can scaffold predictable behaviour and architecture for your skill file.
When to Use This CLAUDE.md Template
- You are creating a new CLAUDE.md template for a stack that combines Angular Material with FastAPI and Celery.
- You want a reproducible CLAUDE Code starting point for onboarding developers.
- You need explicit architecture, file rules, and security guidelines to reduce drift.
- You require a copyable CLAUDE.md block that can be pasted into a Claude Code project without modification.
Copyable CLAUDE.md Template
# CLAUDE.md
Project role
- You are Claude, a Claude Code assistant responsible for generating a complete CLAUDE.md template for an Angular Material frontend, a FastAPI backend, and a Celery worker
Architecture rules
- Frontend communicates with backend via REST API
- Backend exposes endpoints secured with JWT
- Celery worker subscribes to Redis broker and processes async tasks
- Use Redis as broker and result backend
- Do not bypass authentication or expose secret keys
File structure rules
- Place a CLAUDE.md in the project root
- Backend code in backend/app
- Frontend code in frontend/angular
- Celery tasks in backend/celery
Authentication rules
- Use OAuth2 password flow with JWT for API endpoints
- Validate tokens on every protected route
- Secrets managed via environment variables, not hard-coded
Database rules
- Use PostgreSQL with SQLAlchemy models
- Validate inputs with Pydantic models
- Do not perform schema changes outside migrations
Validation rules
- Validate all inputs in FastAPI with Pydantic models
- Validate Celery task payloads before enqueue
Security rules
- Use HTTPS in production
- Restrict CORS to frontend domain
- Never log secrets or tokens
Testing rules
- Unit test FastAPI endpoints with pytest and httpx
- Test Celery task serialization and result backends
- Include integration tests for frontend-backend flow
Deployment rules
- Use docker-compose for local dev
- Include separate Dockerfiles for frontend and backend
- Use a shared Redis container for broker
Things Claude must not do
- Do not modify production data directly
- Do not bypass authentication checks
- Do not hard-code secrets in code blocks
Recommended Project Structure
frontend/
angular/
src/
app/
components/
services/
environments/
backend/
app/
main.py
api/
v1/
endpoints/
models/
celery/
tasks.py
config/
docker-compose.yml
README.md
Core Engineering Principles
- Single responsibility across frontend, backend, and Celery components
- Explicit interfaces and contracts between layers
- Idempotent operations and clear side-effect boundaries
- Reproducible builds and containerized deployment
- Test-driven progress and measurable quality gates
Code Construction Rules
- Frontend Angular Material components must consume a typed API client
- Backend FastAPI endpoints must use Pydantic schemas for request/response
- Celery tasks should be idempotent and resilient to failures
- Environment variables must be loaded via a config module
- Do not bypass authentication or authorization checks
Security and Production Rules
- Use JWTs for API authentication; refresh tokens on secure endpoints
- Restrict CORS to the frontend origin only
- Store secrets in environment variables or secret manager, never in code
- Enable TLS in production and rotate credentials regularly
Testing Checklist
- Unit tests for FastAPI endpoints and Pydantic models
- Integration tests for frontend-backend API calls
- Celerity task tests for enqueueing and result handling
- End-to-end tests for typical user flows
Common Mistakes to Avoid
- Assuming front-end state can bypass backend validation
- Overcomplicating Celery task routing without need
- Ignoring migrations when changing database models
- Exposing sensitive logs or tokens in error messages
FAQ
- What is this CLAUDE.md Template for Angular Material + FastAPI Celery?
- This CLAUDE.md Template provides a ready-to-copy CLAUDE.md block to scaffold a full-stack Angular Material frontend with a FastAPI backend and a Celery task queue, using Claude Code.
- How do I integrate Celery with FastAPI?
- Define Celery tasks in backend/celery, configure broker with Redis, and call tasks from FastAPI endpoints.
- What about authentication?
- Use OAuth2 with JWT tokens on the FastAPI side and attach tokens on frontend requests.
- How do I run this locally?
- Start Redis, run backend and frontend containers via docker-compose, then navigate to the frontend app.
- Where should secrets go?
- Store secrets in environment variables or a secret manager; never commit them.