BlogCraftAI is a teaching-ready reference implementation that mirrors the 30-hour training program outlined in the curriculum. It provides a production-grade Django stack with AI integrations, responsive templates, automation samples, and exhaustive tests so that learners can explore every branch with confidence.
- Feature Overview
- Architecture
- Getting Started
- Use Case Outcomes
- Key API Endpoints
- AI Prompt Engineering Toolkit
- Automation Blueprints
- Testing Strategy
| Branch | Highlights |
|---|---|
| Main | Onboarding template, resource checklist, communication guidelines. |
| Django | Modular project (accounts, blog, ai), PostgreSQL-ready config, JWT auth, audited logging. |
| Prompt Engineering | AiSuggestionService with structured prompts, timeout handling, schema validation, unit tests. |
| Frontend | Responsive Django templates, accessibility support, SEO insights panel, pagination, dashboards. |
| BlogCraftAI | Unified architecture diagram, environment configuration, observability hooks, deployment-ready static handling. |
| AI Agents | n8n and Make.com automation JSON blueprints for editorial workflows. |
- Backend: Django 5 + Django REST Framework powering authentication, blog CRUD, and AI endpoints. Custom user model enforces email logins and profile metadata.
- Database: Ships with SQLite for local development and environment-driven PostgreSQL configuration for staging/production.
- Frontend: Server-rendered templates styled with a responsive utility sheet. Components are WCAG-conscious, keyboard navigable, and optimised for Lighthouse/PageSpeed budgets.
- AI Layer:
AiSuggestionServiceencapsulates prompt engineering contracts, input validation, resilience strategies, and JSON parsing intoSeoSuggestiondataclasses. - Automation: Reusable workflow definitions demonstrate how to orchestrate BlogCraftAI APIs from n8n and Make.com for scheduling, enrichment, and notifications.
- Install dependencies
pip install -r requirements.txt
- Apply migrations
cd backend python manage.py migrate - Create a superuser (optional but recommended)
python manage.py createsuperuser
- Run the development server
python manage.py runserver
- Access the app at
http://127.0.0.1:8000/
Environment variables such as POSTGRES_DB, AI_PROVIDER_URL, and JWT lifetimes can be configured via the shell or a .env file to align with deployment targets.
- ✅ Learners can register, authenticate via JWT, and manage their profile through the
/accountsendpoints and UI flows. - ✅ Editors create, publish, edit, and archive posts with tag management, reaction tracking, and permissioned API access.
- ✅ Visitors browse, search, and filter posts, while responsive templates guarantee accessible navigation and descriptive SEO metadata.
- ✅ AI-assisted SEO suggestions surface on post detail pages and through the
/api/seo-suggestions/endpoint with graceful degradation on provider errors. - ✅ Automation teams can plug BlogCraftAI into scheduling systems using the provided n8n and Make.com workflow blueprints.
| Endpoint | Method | Description |
|---|---|---|
/accounts/register/ |
POST | Create a new user account. |
/accounts/token/ |
POST | Obtain JWT access and refresh tokens. |
/accounts/profile/ |
GET/PATCH | Retrieve or update the authenticated user profile. |
/api/posts/ |
GET/POST | List or create blog posts (supports filtering, search, ordering). |
/api/posts/{slug}/publish/ |
POST | Publish a draft post (author/staff only). |
/api/comments/ |
POST | Add a public comment to a post. |
/api/reactions/ |
POST | Upsert user reactions (like/dislike) on posts. |
/api/seo-suggestions/ |
POST | Generate AI SEO suggestions for content drafts. |
Authenticated requests use Bearer tokens issued by SimpleJWT. Throttling, pagination, and filtering follow DRF conventions to stay predictable for learners.
backend/ai/services.pyencodes the guardrails, schema validation, retry-safe HTTP access, and structured responses required to integrate large language models responsibly.backend/ai/prompts/seo_optimization.mddocuments the canonical prompt, guardrails, and testing checklist used in class to critique prompt design decisions.- Comprehensive tests in
backend/tests/test_ai_service.pysimulate success, timeout, and malformed payload scenarios to encourage defensive programming.
automations/n8n_content_publish.jsonschedules daily reviews of draft posts, publishes approved entries, and sends Slack notifications.automations/make_scenario_blueprint.jsonshows how to receive Airtable briefs, seed drafts, request AI suggestions, and push a Teams update—all without writing custom code.
Run the full suite with:
pytestThe suite covers API contracts, permission boundaries, AI error handling, and HTML rendering smoke tests. Test fixtures rely on factory_boy for expressive setup and include negative as well as failure simulations (timeouts, validation errors).