CLAUDE.md TemplatesCLAUDE.md Template

CLAUDE.md Template: Angular Material + Django Admin Dashboard

CLAUDE.md Template page for Angular Material + Django Admin Dashboard for Claude Code.

CLAUDE.md templateAngular MaterialDjango AdminClaude CodeAngularDjangoAdmin DashboardREST APIJWTDRFPostgreSQLFrontend-Backend

Target User

Frontend + Backend developers building admin dashboards with Angular Material and Django Admin

Use Cases

  • Scaffold a CLAUDE.md template for a stack-specific Angular Material + Django Admin Dashboard
  • Document architecture, authentication, and deployment rules for Claude Code
  • Provide a copyable CLAUDE.md block ready to paste into CLAUDE.md

Markdown Template

CLAUDE.md Template: Angular Material + Django Admin Dashboard

# CLAUDE.md

Project role: You are Claude Code assistant for building an Angular Material frontend integrated with a Django Admin (DRF) backend. 

Architecture rules:
- Use Django REST Framework for API endpoints
- Frontend is an Angular Material SPA communicating with REST endpoints
- Use JWT (e.g., django-rest-framework-simplejwt) for authentication
- Separate frontend and backend deployment boundaries
- Prefer API-first development and clear CORS configuration

File structure rules:
- backend/ and frontend/ at repo root
- backend/django_project/ with settings.py, urls.py, wsgi.py
- backend/apps/ with authentication/ and dashboard/ apps
- frontend/src/app/ with modules, components, services
- Dockerfile and docker-compose.yml for local dev and prod builds

Authentication rules:
- Token-based auth via DRF JWT; login at /api/auth/login/
- Refresh tokens at /api/auth/token/; access at /api/auth/verify/
- Do not rely on session authentication for API endpoints

Database rules:
- PostgreSQL as the primary database
- Use Django ORM migrations; seed initial data via fixtures or migrations

Validation rules:
- DRF serializers validate required fields, constraints, and uniqueness where needed
- Angular reactive forms enforce client-side validation aligned with serializers

Security rules:
- Do not expose secret keys; use environment variables
- Enable CSRF protection for state-changing requests when using session auth; otherwise rely on JWT
- Enforce HTTPS in production and strict CORS policies for SPA domain

Testing rules:
- Backend: pytest-django tests for serializers, viewsets, and authentication
- Frontend: Jasmine/Karma tests for components and services; end-to-end tests where feasible

Deployment rules:
- Docker Compose with separate services for backend and frontend
- Use production-ready settings, env vars, and proper static file handling
- CI/CD hooks to run unit/integration tests on merge

Things Claude must not do:
- Do not generate server-side code in ways that bypass authentication
- Do not depend on insecure defaults or hard-coded secrets
- Do not mix frontend and backend routing in a single server path

Overview

Direct answer: This CLAUDE.md template provides a complete, copyable CLAUDE.md block for an Angular Material + Django Admin Dashboard stack, with stack-specific rules and conventions to guide Claude Code from start to deployment.

This page is a copyable CLAUDE.md template page tailored to the Angular Material + Django Admin Dashboard setup. It helps you generate consistent Claude Code instructions for both frontend (Angular Material) and backend (Django Admin with DRF) in a single cohesive CLAUDE.md file.

When to Use This CLAUDE.md Template

  • You are starting a new Angular Material + Django Admin Dashboard project.
  • You need a stack-specific CLAUDE.md blueprint for Claude Code workflows.
  • You want to document architecture, authentication, database, validation, security, tests, and deployment rules in a repeatable format.
  • You require a concise, production-oriented CLAUDE.md that can be pasted into Claude Code immediately.

Copyable CLAUDE.md Template

# CLAUDE.md

Project role: You are Claude Code assistant for building an Angular Material frontend integrated with a Django Admin (DRF) backend. 

Architecture rules:
- Use Django REST Framework for API endpoints
- Frontend is an Angular Material SPA communicating with REST endpoints
- Use JWT (e.g., django-rest-framework-simplejwt) for authentication
- Separate frontend and backend deployment boundaries
- Prefer API-first development and clear CORS configuration

File structure rules:
- backend/ and frontend/ at repo root
- backend/django_project/ with settings.py, urls.py, wsgi.py
- backend/apps/ with authentication/ and dashboard/ apps
- frontend/src/app/ with modules, components, services
- Dockerfile and docker-compose.yml for local dev and prod builds

Authentication rules:
- Token-based auth via DRF JWT; login at /api/auth/login/
- Refresh tokens at /api/auth/token/; access at /api/auth/verify/
- Do not rely on session authentication for API endpoints

Database rules:
- PostgreSQL as the primary database
- Use Django ORM migrations; seed initial data via fixtures or migrations

Validation rules:
- DRF serializers validate required fields, constraints, and uniqueness where needed
- Angular reactive forms enforce client-side validation aligned with serializers

Security rules:
- Do not expose secret keys; use environment variables
- Enable CSRF protection for state-changing requests when using session auth; otherwise rely on JWT
- Enforce HTTPS in production and strict CORS policies for SPA domain

Testing rules:
- Backend: pytest-django tests for serializers, viewsets, and authentication
- Frontend: Jasmine/Karma tests for components and services; end-to-end tests where feasible

Deployment rules:
- Docker Compose with separate services for backend and frontend
- Use production-ready settings, env vars, and proper static file handling
- CI/CD hooks to run unit/integration tests on merge

Things Claude must not do:
- Do not generate server-side code in ways that bypass authentication
- Do not depend on insecure defaults or hard-coded secrets
- Do not mix frontend and backend routing in a single server path

Recommended Project Structure

angular-material-django-admin-dashboard/
├── backend/
│   ├── manage.py
│   ├── django_project/
│   │   ├── settings.py
│   │   ├── urls.py
│   │   └── wsgi.py
│   ├── apps/
│   │   ├── authentication/
│   │   │   ├── __init__.py
│   │   │   ├── models.py
│   │   │   ├── serializers.py
│   │   │   └── views.py
│   │   └── dashboard/
│   │       ├── __init__.py
│   │       ├── models.py
│   │       ├── serializers.py
│       └── views.py
│   └── requirements.txt
├── frontend/
│   ├── src/
│   │   ├── app/
│   │   │   ├── core/
│   │   │   ├── features/
│   │   │   └── app.module.ts
│   │   ├── assets/
│   │   └── index.html
│   ├── angular.json
│   └── package.json
└── docker-compose.yml

Core Engineering Principles

  • Clear separation between frontend and backend responsibilities
  • API-first design with well-documented endpoints
  • Security by design: proper authentication, authorization, and input validation
  • Automated testing for backend and frontend components
  • Repeatable deployment with Docker Compose or equivalent

Code Construction Rules

  • Frontend uses Angular Material components following a unified design system
  • Backend uses Django ORM with DRF viewsets and serializers
  • Use environment-driven configuration for secrets and endpoints
  • Code must be linted and formatted; follow project-wide style guides
  • Do not import non-essential libraries; keep dependencies minimal

Security and Production Rules

  • JWT-based authentication; avoid insecure session-based API access
  • CSRF-based protections are only used where appropriate; for token-auth endpoints rely on JWT
  • HTTPS in prod, strict CORS, and proper allowed origins
  • Secret keys and DB credentials stored in environment variables
  • Regular dependency updates and vulnerability scanning

Testing Checklist

  • Backend: serializer and viewset tests; auth flow tests
  • Frontend: unit tests for components and services
  • End-to-end tests for login, data fetch, and CRUD operations
  • CI/CD pipeline runs lint, tests, and builds on commit

Common Mistakes to Avoid

  • Bypassing authentication or exposing secrets in code
  • Neglecting API versioning and backward compatibility
  • Overly coupled frontend and backend routing
  • Ignoring input validation on both client and server sides

FAQ

Q1: What is this CLAUDE.md Template for?

A1: A copyable CLAUDE.md template for Angular Material + Django Admin Dashboard to guide Claude Code.

Q2: Which stack does it cover?

A2: Angular Material frontend with a Django Admin (DRF) backend using JWT authentication.

Q3: What should Claude avoid with this template?

A3: Do not bypass authentication, expose secrets, or mix frontend/backend routing.

Q4: How is the project structure organized?

A4: Backend Django apps (authentication, dashboard) and a frontend Angular app under a shared repo.

Q5: What must be included in the Copyable CLAUDE.md Template?

A5: Project role, architecture rules, file structure, authentication, database, validation, security, testing, deployment, and Things Claude must not do.

Related Links