What You Will Build
A production-ready Django + Django REST Framework codebase for a B2B SaaS, generated from a paragraph. The generated app includes:
- Django ORM models with migrations (
manage.py migrateready) - DRF serializers and viewsets for every entity
- JWT authentication with httpOnly cookies
- Organisation-scoped multi-tenancy via a custom model manager
- The Django admin, wired for every model
- A working
docker-compose.yml
You write zero boilerplate models.py, serializers.py, or views.py.
Prerequisites
- An Archiet account (free at archiet.com/register)
- Docker installed locally
- 10 minutes
Step 1: Write a Minimal PRD
HelpDesk is a B2B SaaS for support teams. Organisations sign up and invite
agents. Agents create tickets with a subject, body, priority (low / normal /
high / urgent), status (open / pending / resolved), and assignee. Customers
can be linked to tickets. Only agents in an organisation see that
organisation's tickets. We need registration, login, email verification, and
password reset. A staff admin should be able to browse all data.
Archiet extracts the entities (Organisation, Agent/User, Ticket, Customer), the relationships, the auth flow, and the "staff admin should browse all data" requirement that maps cleanly to Django's admin.
Step 2: Open the Blueprint Wizard
- Log in at archiet.com/login
- Click New Blueprint, paste your PRD, click Analyse
- Review the proposed model and correct any entity before generating
Step 3: Choose Django
On the Generate screen, select Django as the stack, optionally check a compliance overlay (SOC 2 / GDPR), and click Generate.
Step 4: What You Get
helpdesk/
├── config/ # settings, urls, wsgi
├── apps/
│ ├── accounts/ # User, Organisation, auth
│ ├── tickets/
│ │ ├── models.py
│ │ ├── serializers.py
│ │ ├── views.py # DRF viewsets
│ │ ├── admin.py
│ │ └── migrations/
│ └── customers/
├── docker-compose.yml
└── manage.py
The model and the tenant-scoped viewset are idiomatic Django/DRF:
# apps/tickets/models.py
class TicketQuerySet(models.QuerySet):
def for_org(self, org_id):
return self.filter(org_id=org_id)
class Ticket(models.Model):
class Priority(models.TextChoices):
LOW = "low"; NORMAL = "normal"; HIGH = "high"; URGENT = "urgent"
org = models.ForeignKey("accounts.Organisation", on_delete=models.CASCADE)
subject = models.CharField(max_length=255)
priority = models.CharField(max_length=10, choices=Priority.choices, default=Priority.NORMAL)
assignee = models.ForeignKey("accounts.User", null=True, on_delete=models.SET_NULL)
objects = TicketQuerySet.as_manager()
# apps/tickets/views.py
class TicketViewSet(viewsets.ModelViewSet):
serializer_class = TicketSerializer
permission_classes = [IsAuthenticated]
def get_queryset(self):
return Ticket.objects.for_org(self.request.user.org_id)
Every list and detail view is filtered to the requesting user's organisation through get_queryset.
Step 5: Run It Locally
cd helpdesk
cp .env.example .env
docker compose up -d
docker compose exec web python manage.py createsuperuser
The API is at http://localhost:8000/api/. The Django admin is at http://localhost:8000/admin/ — log in with the superuser you just created and browse every model.
What to Do Next
Use the admin as your internal tool: Django's admin is generated for every model, so your support or ops team has a working back office on day one.
Extend with DRF: add custom actions to the generated viewsets, or add filtering with django-filter — the structure follows DRF conventions so any Django tutorial applies.
Other Python stacks: choose FastAPI for an async API-first service, or Flask for a microframework.
The generated ARCHITECTURE.md documents the decisions (why DRF viewsets, why the custom manager for tenancy). Hand it to a reviewer or an auditor.