From Idea to Architecture
Jump to section
Start with a problem, not a technology
The biggest mistake people make when building with AI is jumping straight into code. They ask 'build me a Next.js app' instead of 'I need a website that sells online courses in two languages.' The technology is a means to an end. When you describe the problem clearly, AI can propose a much better solution than when you dictate the stack.
This course documents how PraktickAI — the very site you are reading this on — was built entirely with AI agents. Every line of code, every deployment script, every database migration was written by Claude Code. A human made the architecture decisions and validated the output. AI did the rest.
This is not a toy project or a demo. PraktickAI is a production application with real users, real payments, and real data. If AI can build this, it can build your project too — as long as you know how to guide it.
How to describe your project to AI
Think of your first conversation with AI as a project brief. You are the client, AI is the consultant. Describe what you need, who it is for, and what constraints you have. The more specific you are about the problem, the better the architecture proposal will be.
I need a website for my AI training and consulting business.
Requirements:
- Bilingual (Czech + English), with easy addition of more languages later
- Sell online courses with payment gateway
- Blog with SEO-optimized pages
- Social login (Google, LinkedIn)
- Admin panel for managing content
- Must be cheap to host (under EUR 10/month total)
- Must be fast to build (one developer + AI)
Constraints:
- I know Python and some JavaScript
- I want to deploy to my own infrastructure, not be locked into a platform
- Content should be easy to update without redeployingNotice there is no mention of Next.js, Django, or any specific technology. You describe the problem. AI proposes the solution. This is a critical mindset shift: you are the architect, AI is the builder.
Let AI propose the architecture
When you give AI a clear problem description, it can propose a surprisingly good architecture. For PraktickAI, Claude suggested a split frontend/backend approach: Next.js for the frontend (great SEO, built-in i18n, Vercel hosting), and Django for the backend (mature ORM, admin panel, Python ecosystem). This was the right call.
claude "Based on my requirements, propose an architecture.
Include: tech stack, hosting strategy, database,
CI/CD approach, and cost estimate.
Explain WHY you chose each technology."The key phrase is 'explain WHY.' Without it, AI just lists technologies. With it, you get reasoning you can evaluate. For PraktickAI, the reasoning was: Next.js because Vercel offers free hosting for frontends and has excellent i18n support. Django because its ORM and admin panel save weeks of work, and Django Ninja provides type-safe APIs with automatic OpenAPI docs.
Do not accept the first proposal blindly. Challenge it. Ask 'what are the downsides?' and 'what alternatives did you consider?' AI will often propose what is most popular, not what is best for your specific case. Push back and you get a better architecture.
The CLAUDE.md file: your project's brain
Once you have an architecture, the single most important file you will create is CLAUDE.md. This is a markdown file at the root of your project that tells AI agents everything they need to know: how to run the project, how tests work, what the API looks like, deployment details, and hard-won lessons (gotchas).
Think of CLAUDE.md as institutional memory. Every time AI discovers something the hard way — a Kubernetes gotcha, a quirk of the payment gateway, an important environment variable — it goes into CLAUDE.md. Future AI sessions read this file first and avoid repeating mistakes.
# MyProject Backend
Django + Django Ninja REST API.
## Quick Start
docker compose up -d db
uv run python manage.py migrate
uv run python manage.py runserver 0.0.0.0:8008
uv run pytest
## Architecture Notes
- Frontend proxies /api/* to backend via vercel.json rewrites
- Social auth: code must be injected into request.POST BEFORE
calling load_strategy() — social_core caches request data at init
## K8s Gotchas (learned the hard way)
- DATABASE_URL must be URL-encoded — passwords with / break django-environ
- SECURE_SSL_REDIRECT must be off until TLS is set up
- Health probes need Host: localhost headerThe CLAUDE.md file for PraktickAI's backend is over 300 lines. It includes every API endpoint, every environment variable, every deployment gotcha. When a new AI session starts, it reads this file and immediately has the full context. Without it, AI would make the same mistakes over and over.
The README as a contract
Beyond CLAUDE.md, your README serves as a contract between you and AI. Write what you want the project to become, not just what it is. Include your goals, your timeline, your non-negotiables. AI reads this and aligns its work accordingly.
For PraktickAI, the README includes the business context (AI training consultancy), the target audience (technical teams), pricing strategy, and deployment targets. When AI creates a new feature, it has all this context and makes better decisions — like keeping the UI professional rather than playful, or prioritizing Czech content over English.
The real PraktickAI stack (and what it costs)
- Frontend: Next.js (App Router), TypeScript, Tailwind CSS — hosted on Vercel (free tier)
- Backend: Django + Django Ninja REST API — hosted on k3s (Kubernetes) on Hetzner VPS
- Database: PostgreSQL — on the same Hetzner VPS
- AI tools: Claude Code (primary), GitHub Copilot (secondary)
- CI/CD: GitHub Actions — lint, type-check, test, deploy on every push
- Total monthly cost: EUR 3.49 (just the Hetzner VPS)
That is not a typo. A full production web application with bilingual support, payment processing, social authentication, and automated deployments runs for EUR 3.49 per month. The frontend is free (Vercel), the database runs on the same VPS as the backend, and GitHub Actions are free for public repos.
Open Claude Code (or any AI coding tool) and describe a web application you want to build. Do NOT mention any specific technologies. Focus on: 1. What problem does it solve? 2. Who are the users? 3. What are the core features (max 5)? 4. What are your constraints (budget, skills, timeline)? Then ask AI to propose an architecture with reasoning. Compare its suggestion with what you would have chosen yourself.
Hint
If AI proposes a stack you are unfamiliar with, ask it to explain the learning curve and whether there are simpler alternatives. The best stack is the one you can actually ship with, not the theoretically optimal one.
Create a CLAUDE.md file for your project (even if the project does not exist yet). Include: 1. A one-line project description 2. Quick Start section with commands to run the project 3. Architecture Notes section with key decisions and their reasoning 4. At least one 'gotcha' or lesson learned Use this command to start: claude "Create a CLAUDE.md file for my project. The project is [your description]. Include quick start commands, architecture decisions with reasoning, and a section for gotchas we discover along the way."
Hint
CLAUDE.md is a living document. Start small and add to it every time you learn something new about your project. The most valuable entries are the ones that save you from repeating mistakes.
Take your app idea and ask AI to propose 3 different architecture approaches: 1. Ask AI: 'Propose 3 different architectures for this app: [your idea]. For each: tech stack, pros, cons, estimated complexity (1-5), and deployment options.' 2. For each architecture, ask follow-up questions: 'What would the database schema look like?' 'What are the main API endpoints?' 3. Pick the architecture that best fits your constraints (budget, timeline, skills) 4. Ask AI to create a detailed implementation plan for your chosen architecture 5. Review the plan and identify 2-3 things AI got wrong or over-complicated Document your decision and reasoning in CLAUDE.md.
Hint
AI often over-engineers architecture for simple apps. A blog does not need microservices. Push back when AI suggests complexity that does not match your scale. The best architecture is the simplest one that meets your requirements.
- Start with a clear problem description, not a technology choice — let AI propose the architecture
- Challenge AI's proposals: ask for reasoning, downsides, and alternatives
- CLAUDE.md is the most important file in your project — it is institutional memory for AI agents
- The README is a contract: write what you want the project to become, not just what it is
- A production web app can run for under EUR 10/month — AI makes this achievable for solo developers
- You are the architect, AI is the builder — this division of labor is the key to success