Build Your First Application
A guided walkthrough that takes a simple task manager from idea to a deployed application on a custom domain.
This walkthrough applies the complete method to a simple task management application called TaskTrail — from an idea to a live application on a custom domain. It follows the same low-prompt, LOW GAS approach used to build this website: a plan, a handful of consolidated sprint prompts, human testing after every sprint and a review loop through ChatGPT.
Every prompt and command on this page has a copy button. Work through the steps in order and tick the checklists as you go — your progress is saved in your browser.
1. Application idea and business problem
Idea: a fast, simple personal task list that works equally well on a laptop and a phone.
Business problem: busy professionals track tasks across sticky notes, email flags and chat messages. Nothing shows in one place what is due soon, so deadlines are missed and time is wasted searching.
Success looks like: a user can capture a task in seconds, see what is due today and this week, and mark work done from any device.
2. Target users
| Persona | Goal | Technical comfort |
|---|---|---|
| Busy professional (primary) | Capture tasks quickly and see what is due | Low to moderate |
| Freelancer | Track client deliverables by due date | Moderate |
There is no administrator role in the MVP. Every user manages only their own tasks — a deliberate simplification that keeps authorization rules easy to test.
3. MVP feature definition
| In scope (MVP) | Out of scope (later) |
|---|---|
| Email-based sign up, sign in, sign out | Social sign-in, teams, sharing |
| Create, edit, complete, reopen and delete tasks | Recurring tasks, subtasks, attachments |
| Optional due date and notes | Reminders and notifications |
| Filter: open, done, due this week | Search, tags, analytics |
| Responsive layout for phone and desktop | Native mobile apps, offline mode |
Acceptance criteria (sample):
- A signed-in user can create a task with a title of 1 to 200 non-whitespace characters.
- A user cannot read or change another user's task, even by editing the URL or API request.
- The task list is usable at 375 pixels wide.
- Tests, type checking and the production build pass.
4. Recommended architecture
| Layer | Choice | Why |
|---|---|---|
| Application | Next.js (App Router) with TypeScript | Front end and server logic in one deployable service |
| Styling | Tailwind CSS | Fast, consistent responsive UI |
| Database | PostgreSQL on Railway | Structured, related records (users and tasks) |
| Data access | Prisma ORM | Type-safe queries and versioned migrations |
| Authentication | An established authentication library | Avoids hand-written security code |
| Hosting | Railway, deployed from a private GitHub repository | App and database in one project, private networking |
Railway application and database architecture
Users
GitHub
Railway project · production environment
Application service
PostgreSQL
Redis (optional)
Redis, background workers and an email service were considered and deliberately left out of the MVP.
5. Project directory setup
Open the macOS Terminal (or the VS Code integrated terminal) and run:
mkdir -p ~/projects/tasktrail
cd ~/projects/tasktrail
code .VS Code opens the empty folder. Open the integrated terminal inside VS Code and confirm you are in the right place:
pwd
# /Users/yourname/projects/tasktrail6. GitHub repository setup
Confirm the GitHub CLI is authenticated:
gh auth statusYou will create the private repository as part of the Sprint 0 prompt in step 8, so there is nothing else to do yet. If you prefer to do it manually, follow Getting Started.
0 of 3 complete
7. ChatGPT planning prompt
Open a new ChatGPT conversation and paste this prompt. It is the library's Application Planning prompt with TaskTrail's details filled in.
Act as an experienced product manager and software architect. Help me plan a web application
that I will build with Claude Code (an AI coding agent) and deploy to Railway from a private
GitHub repository.
## My idea
TaskTrail: a fast, simple personal task list for desktop and phone.
## Target users
Busy professionals and freelancers who want one place to see what is due.
## Problem being solved
Tasks are scattered across notes, email and chat; deadlines are missed.
## Must-have features
Email sign up/sign in/sign out; create, edit, complete, reopen and delete tasks; optional due
date and notes; filters for open, done and due this week; responsive layout.
## Constraints
Low monthly cost, mainstream stable technologies, no unnecessary services, MVP in about a week
of part-time work.
## Produce the following plan
Product summary, business requirements, personas, use cases, MVP in/out of scope, recommended
stack with justification, architecture, data model, database recommendation, screens and user
flows, security requirements, environment variable names (no values), testing approach,
measurable acceptance criteria, risks and open questions, and what to avoid to prevent
overengineering.
Ask up to five clarifying questions first if anything critical is ambiguous.Plan excerpt (illustrative)
Data model
User: id, email, name, created_at
Task: id, user_id → User, title (1–200), notes, status (open | done),
due_date (nullable), created_at, updated_at
Environment variables: DATABASE_URL, AUTH_SECRET, APP_URL
Avoid for MVP: Redis, background jobs, email reminders, team featuresReview the plan with the checklist in Application Planning. In this example ChatGPT first suggested Redis for caching; asking "what can be removed without hurting the MVP?" removed it.
Then ask ChatGPT for the sprint prompts, using the Sprint Planning prompt with three sprints:
Sprint 0 — Foundation: repository, scaffold, database schema, CLAUDE.md, first push
Sprint 1 — Core: accounts, task features, authorization, validation, tests
Sprint 2 — Launch readiness: health check, PORT, docs, production polish (written after review)8. Claude Code Sprint 0 prompt
Paste the whole prompt into Claude Code from the tasktrail folder. Notice that it consolidates repository setup, scaffolding, the schema and project documentation into one prompt instead of four.
# Sprint 0 — Foundation
## Operating instructions
Use LOW GAS throughout this task. Minimize token consumption, unnecessary analysis, repetitive
audits, readiness checks and intermediate reports. Consolidate related implementation
activities. Do not create additional planning phases or request approval for routine
implementation decisions. Run essential tests, type checking and production builds. Do not
compromise security or functionality to reduce model usage.
## Scope
1. Initialize Git with a main branch and a .gitignore that excludes .env files, node_modules
and build output.
2. Scaffold a Next.js (App Router) + TypeScript + Tailwind CSS application in this folder.
3. Add Prisma with PostgreSQL. Create User and Task models per the approved data model and an
initial migration.
4. Add .env.example with placeholder values for DATABASE_URL, AUTH_SECRET and APP_URL.
5. Add a minimal responsive layout and a placeholder task list page that reads from the database.
6. Add a test runner with one passing smoke test.
7. Create README.md (setup, commands, environment variables) and CLAUDE.md (architecture,
commands, conventions, LOW GAS rule, never force-push, never commit secrets).
8. Create a PRIVATE GitHub repository named tasktrail with the GitHub CLI if it does not exist,
set it as origin, commit and push main. Never force-push.
## Completion
Run tests, typecheck and the production build. Provide a concise completion report: features,
files, results, how to run locally, commit hash, limitations, manual actions, remaining work.
Do not proceed to the next sprint until instructed.Local database for development
Sprint 0 needs a PostgreSQL database on your computer for development. One option with Homebrew (check the current PostgreSQL version available):
brew install postgresql@16
brew services start postgresql@16
createdb tasktrail_devThen copy the example environment file and set the local connection string — never your production database:
cp .env.example .env
# edit .env: DATABASE_URL="postgresql://localhost:5432/tasktrail_dev"
npx prisma migrate dev9. Core functionality implementation prompt
After Sprint 0 is reviewed (step 11), ChatGPT produces the Sprint 1 prompt. This one prompt covers accounts, every task feature, authorization, validation and tests.
# Sprint 1 — Core functionality
## Operating instructions
Use LOW GAS throughout this task. Minimize token consumption, unnecessary analysis, repetitive
audits, readiness checks and intermediate reports. Consolidate related implementation
activities. Do not create additional planning phases or request approval for routine
implementation decisions. Run essential tests, type checking and production builds. Do not
compromise security or functionality to reduce model usage.
## Context
Read CLAUDE.md and README.md first.
## Scope
1. Email sign up, sign in and sign out using an established authentication library.
Protect all task pages and server actions.
2. Task features: create, edit, complete, reopen, delete; optional due date and notes.
3. Filters: open, done, due this week. Sensible empty states.
4. Authorization: every query is scoped to the signed-in user. Requests for another user's
task return not found.
5. Server-side validation: title 1–200 characters and not whitespace-only; valid due date.
Friendly error messages; never show stack traces.
6. Responsive layout usable at 375px wide.
7. Tests for validation, authorization (cross-user access is rejected) and task actions.
8. Update README.md, CLAUDE.md and .env.example for any new variables.
## Acceptance criteria
All MVP acceptance criteria in the approved plan.
## Completion
Run tests, typecheck and the production build. Commit and push to main without force-pushing.
Provide a concise completion report. Do not proceed to the next sprint until instructed.10. Example completion report
Sprint 1 completion report (hypothetical)
1. Features: email auth, protected routes, task CRUD with complete/reopen, due dates, notes,
filters (open/done/this week), empty states, responsive layout
2. Files: app/(auth)/*, app/tasks/*, lib/auth.ts, lib/tasks.ts, lib/validation.ts,
tests/validation.test.ts, tests/authorization.test.ts, README.md, CLAUDE.md
3. Results: 24 tests passed · typecheck passed · production build passed
4. Run locally: npm install → npx prisma migrate dev → npm run dev
5. Commit: 9c2e4b1 (main)
6. Known limitations: no pagination; no password reset
7. Manual actions: set AUTH_SECRET in .env (openssl rand -base64 32)
8. Remaining: health check, PORT handling review, deployment documentation11. ChatGPT review and iteration prompt
Before reviewing, test the application yourself (step 12). Then paste the report and your observations into the same ChatGPT conversation:
Claude Code has completed Sprint 1. Review its completion report against the approved plan and
the Sprint 1 prompt in this conversation.
## Completion report
[PASTE THE FULL COMPLETION REPORT]
## My own local testing observations
- Creating a task whose title is only spaces is accepted.
- On my phone the "Delete" button is very close to "Complete".
- Everything else in the acceptance criteria worked.
## Please provide
1. Verdict: complete, complete with minor gaps, or incomplete.
2. Material gaps and risks, including security concerns.
3. Claims I should verify manually and how.
4. ONE consolidated next prompt for Claude Code: fix the gaps AND include Sprint 2 launch
readiness (health check, PORT, deployment docs) so we do not need a separate corrective
cycle. Start it with the LOW GAS operating instructions, require tests, typecheck and a
production build, require commit and push without force-push, and end with a request for a
concise completion report.In this example ChatGPT judged Sprint 1 "complete with minor gaps" and folded both fixes into the Sprint 2 prompt — saving a full cycle. That is the low-prompt approach in practice: fix forward in the next consolidated prompt instead of sending many small corrective prompts.
12. Local application testing
Start the application and test as a real user:
npm run dev
# open http://localhost:30000 of 8 complete
Also confirm the automated checks yourself rather than relying only on the report:
npm test
npx tsc --noEmit
npm run build13. Database setup
TaskTrail needs a database because tasks must persist and belong to users. Locally you used tasktrail_dev. In production you will add PostgreSQL as a Railway service in step 14; Railway provisions it and exposes its connection variables.
Migrations created during development (in the prisma/migrations folder) are committed to Git and applied to production with a deploy-safe command:
npx prisma migrate deployNever run development reset commands against production.
14. Railway deployment
First ask ChatGPT for configuration using the Railway Deployment Configuration prompt, pasting README.md, package.json and .env.example. Then in Railway:
- Log in with GitHub and create a New Project → deploy from the
tasktrailGitHub repository. Grant the Railway GitHub app access to this repository only. - Add a PostgreSQL database service to the project.
- Configure the application service's variables (step 15).
- Set the pre-deploy command to
npx prisma migrate deploy. - Set the health check path to
/api/health. - Deploy and read the build logs, then the deploy logs.
A deployment failure (illustrative)
Error: Environment variable not found: DATABASE_URLPasted into ChatGPT with the Railway Troubleshooting prompt, the root cause was clear: the reference variable had been added to the database service instead of the application service. Moving it fixed the deployment — no code change needed. Reading the logs first saved a needless Claude Code cycle.
15. Environment variable configuration
Set these on the application service (values are illustrative or placeholders):
DATABASE_URL=${{Postgres.DATABASE_URL}} # reference variable — match your database service's name
AUTH_SECRET=[generate a new value with: openssl rand -base64 32]
APP_URL=https://[your-domain] # set after step 160 of 4 complete
16. Custom domain setup
- In the service's networking settings, generate a Railway domain and confirm the application works on it (illustrative:
tasktrail-production.up.railway.app). - Add the custom domain — in this example the owner used the subdomain
tasks.example.com. - Railway displays the DNS records to create. Illustrative values:
| Type | Name | Value |
|---|---|---|
| CNAME | tasks | abc123.up.railway.app |
| TXT | name shown by Railway | value shown by Railway |
- At the DNS provider, add only these records. Existing MX and TXT records for email are left untouched.
- Wait for verification and automatic HTTPS certificate issuance; check progress with
dig tasks.example.com +short. - Update
APP_URLand any authentication callback URLs tohttps://tasks.example.com.
DNS and custom domain configuration
1. Railway networking
2. DNS provider
3. Verification + HTTPS
4. Users
| Type | Name | Value (illustrative) |
|---|---|---|
| CNAME | app | example-value.up.railway.app |
| TXT | verification name from Railway | verification value from Railway |
17. Production validation
Run the production smoke test on the custom domain and on a real phone, then complete the production launch checklist. For a one-time deeper review, use the Production Readiness Validation prompt.
0 of 7 complete
18. Further enhancements
TaskTrail is live. New features follow Maintenance and Optimization: plan the change with ChatGPT, implement it on a feature branch with the Application Enhancement prompt, test, merge and smoke test.
Candidate enhancements, each a single consolidated prompt:
- Email reminders for tasks due tomorrow (adds an email service and a scheduled job — review the cost first with the Cost Calculator).
- Search and tags for larger task lists.
- Password reset flow using the authentication library's built-in support.
- Shared lists for small teams (requires new authorization rules and careful testing).
Ongoing application enhancement lifecycle
1. Feedback and ideas
Users, logs, metrics2. Plan with ChatGPT
Scope, risks, prompt3. Feature branch
Claude Code implements and tests4. Validate
Local and staging testing5. Merge and deploy
Main → production6. Monitor
Logs, errors, costs, backups
What this example demonstrates
- A clear plan with an explicit out-of-scope list kept the build to three consolidated sprints.
- Every Claude Code prompt carried the LOW GAS instructions and requested a concise completion report.
- Human testing caught gaps that automated tests missed.
- Fixing forward in the next consolidated prompt avoided extra cycles.
- Reading logs first turned a deployment failure into a configuration fix.
- Using Railway's own DNS values — and preserving existing records — made the domain setup safe.