Skip to content
Public template

About

Start a First Draft application with Claude Code and Codex

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

136 Commits

Folders and files

Repository files navigation

First Draft workshop in a Codespace

Use this if you cannot install programs on your laptop. Everything happens in a GitHub Codespace: VS Code in your browser, with every tool already installed. You type a request to Claude in its terminal, and Claude does the work.

If you can install one program, install VS Code first and open the Codespace in it (step 2). Its terminal is much smoother than the browser's, and sign-ins are more likely to work on the first try. Your privacy stays the same: VS Code is only the window, and Claude and your app still run in the Codespace, with no access to your laptop's files.

Plan on:

  • Setting up your Codespace: about 5 minutes.
  • Setting up the services your app needs: allow about 20 minutes during the lab.
  • Building, launching and previewing your app: about 45 minutes, or longer for a bigger idea.

You need a personal GitHub account and a Claude account that includes Claude Code. To use Codex instead, see Using Codex.

Taking the First Draft workshop? Use Part 1 to open Drawing Board and sign in to your agent. Then start the app interview in that Codespace and follow the workshop guide. Parts 2–4 below walk you through a standalone Codespace lab.

Part 1: Set up your Codespace

  1. Sign in to GitHub, open firstdraft/drawing-board, and choose Use this template → Open in a codespace.

    On the repo page, click Use this template, then Open in a codespace.

  2. If VS Code asks, choose Trust Folder & Continue. Wait until the terminal at the bottom says Drawing Board setup complete.

    If you installed VS Code: open the ☰ menu and choose Open in VS Code Desktop. Let your browser open VS Code, and if VS Code asks, install the GitHub Codespaces extension and sign in to GitHub. When the Codespace opens in VS Code, close the browser tab and do the rest there. Open a terminal with Terminal → New Terminal.

  3. Click in the terminal, type claude and press Enter. If the terminal shows no $ prompt, first open a new one from the ☰ menu: Terminal → New Terminal.

    The Codespace in your browser. Click Terminal at the bottom, type claude at the $ prompt, then press Enter.

    Claude first asks you to choose a theme (dark or light), not to sign in. Press Return to accept the default. If it asks anything else before showing a link, press Return again.

    Then sign in with your Claude account. Claude shows a long link in the terminal: select all of it, copy it, and paste it into a new browser tab.

    Claude may also open a sign-in tab by itself. In the browser Codespace, close that tab without clicking anything: it ends at "This site can't be reached". If you already clicked Authorize there, just use the terminal's link now. In VS Code Desktop, that tab may work: if it signs you in, skip the rest of this step.

    In the terminal, select the whole sign-in link that starts with https://claude.com, copy it, and paste it into a new browser tab.

    Click Authorize.

    Claude's page asking to connect Claude Code to your Claude account. Click Authorize.

    Click Copy code.

    The Authentication code page. Click Copy code below the code.

    Go back to the Codespace tab, paste the code into the terminal after Paste code here if prompted >, and press Enter. The code shows as stars. If pasting does nothing, press Ctrl+C, run claude auth login, and then claude again.

    Back in the terminal, paste the code after Paste code here if prompted. It shows as stars. Then press Enter.

Part 2: Get ready to build

  1. Continue to Part 3 with the agent you just signed in to. Your agent helps you sign in to First Draft when you start the app. Later, the reviewed Project's Setup list shows which other services you need.
Optional full sign-in walkthrough

If you want to set up every account first, type /workshop-signin in Claude or $workshop-signin in Codex. Your agent helps with one account at a time. If VS Code asks whether to open a sign-in page, choose Open. Choose free or Hobby plans. Approve in the browser, then tell your agent you are done.

  • GitHub stores your app's code. You're already signed in; Claude only sets the name and email on your commits.

  • Render puts your app on the internet.

  • Neon runs your app's database on the internet. If the page after you approve says "This site can't be reached" (it always does in the browser Codespace), tell Claude. You then make a personal Neon API key (profile menu at the top right, Account settings, API keys; not the organization's API keys) and paste it into a private file, the same way as Cloudinary below.

  • Cloudinary stores the photos people upload to your app. Claude opens a private file in the editor. Copy the three values shown below from Cloudinary's website into it, one after each =, and save it (Ctrl+S, or Cmd+S on a Mac); Claude saves them without showing them. Before it shows the API Secret, Cloudinary may ask for your password or a code it emails you.

    Cloudinary's API Keys page. Copy 1, the cloud name; 2, the API Key; 3, the API Secret, after clicking the eye to show it.

  • Revyl shows your iPhone and Android app on a phone in your browser.

  • First Draft plans and builds your app. Sign in with GitHub and approve the code shown by the agent.

When you finish the walkthrough, start a fresh conversation for Part 3.

Part 3: Build your app

Build your own idea. No idea yet? Step 6 has a family social network you can build instead.

  1. Bring what you have. Drag any materials for your idea from your computer onto the Explorer on the left side of VS Code, into the top folder: wireframes, Figma or Claude Design exports, photos of hand-drawn sketches, or sample data as CSV files. Use sample or anonymized data, not real people's information.

    • Already built a version in Lovable? On its GitHub repository, choose Code → Download ZIP, drag the ZIP into the Explorer, and ask Claude to unzip it into a folder named lovable. Don't git clone it here: Claude saves your new app with Git, and could push it to your Lovable repository.
    • Designed it in Claude Design? Choose Export → Hand off to Claude Code there, and keep what it gives you for step 6.

    When Claude builds your app, it moves these materials into .firstdraft/design.

  2. Describe your idea in a sentence or two after the app-building command:

    /firstdraft:create-full-stack-app A place for my book club to pick the next book and vote on meeting dates. Read the materials in this folder first.
    

    Leave out the last sentence if you didn't bring any materials, and paste a Claude Design handoff after your idea. No idea yet? Type this instead:

    /firstdraft:create-full-stack-app Help me build a social network for just my family. It should work and look like Instagram so that it's familiar.
    
  3. Sign in to First Draft if your agent asks. Open its link, sign in with GitHub, check that the displayed code matches, and approve. Tell your agent when you're done. Then answer its questions in your own words or say "you pick". If you're taking the workshop, include an iPhone client for the Revyl preview. Choose Android if you also want it.

  4. Claude explains which parts of your idea First Draft can build. Continue with those parts or switch to the family social network from step 6. Open the Project link and try your screens in the Desktop and Mobile views of the Screens tab. Check the sample records, who can do what, and any gaps. Ask for changes in the same conversation. Once Analysis is valid, open Setup and walk through it with your agent. Enter credentials in the provider's private fields or your app's private environment when needed. When the screens and Plan look right, tell your agent to build that revision.

  5. Start the web app:

    Start the web app.
    

    Run setup and tests as the app's README describes, then open forwarded port 3000 in your browser. If your app has demo accounts, use one to try the first feature.

  6. Save your work to GitHub:

    Commit the app and push it to a new private repository on my GitHub account. Give me the link.
    

    Open the new repository and check that .firstdraft/design/sketches/ contains the Screens you reviewed. Pushing starts the configured GitHub builds for the phone clients you selected.

  7. Follow First deploy in your app's generated DEPLOY.md with your agent. Use Render's dashboard to connect your private repository, create a free web service from the Blueprint, and supply the direct connection to your free Neon database. Try the deployed app from its live URL. If you need an account to test it, follow the generated app's account instructions. Demo records and logins from your Codespace are development data.

    In Render, click the workspace name at the top left, then New Workspace. Choose the free Hobby plan and name it after your app.

  8. In the workshop, everyone tries their iPhone app in Revyl. Follow IOS_PREVIEW.md if your Plan selected iPhone, and ANDROID_PREVIEW.md if you also chose Android. Use the Revyl account you set up for the preview. If the device connects to your Codespace, use disposable data and make port 3000 private again after stopping the preview.

  9. Make it yours. Ask for one change at a time, then try it in your Codespace. Some ideas, with the examples swapped for your own:

    Style it similar to Airbnb.
    
    Limit how many posts each person can create to 50.
    
    Only allow sign-ups from @MYCOMPANY.com email addresses.
    

    When you like a change, say Commit and push. Render updates the live app a minute or two later.

Part 4: Try another idea

Each Codespace holds one app and saves it to one GitHub repository, so another idea gets a new Codespace.

  1. Repeat Part 1 to open a new Codespace from firstdraft/drawing-board.
  2. Follow the workshop app lab or repeat steps 5 to 13 for a standalone lab. Start with the app Skill and use the new Project's reviewed Setup tab to see which services need you to sign in again or supply settings in the new Codespace.

If something goes wrong

  • If reopening a Codespace gives you HTTP ERROR 502, ask your agent to check whether the app answers /ready on port 3000. If it does, open Ports, right-click 3000, and choose Stop Forwarding Port. Choose Add Port, enter 3000, and open its Private address again.
  • The page stopped loading: type Restart the web app.
  • Claude seems stuck: press Esc, then type continue.
  • Building seems stuck for more than five minutes: type Cancel the stuck compile and try again.
  • Claude asks you to approve something: it checks before risky steps, such as deploying. Approve it if it is what you asked for.
  • The Codespace stopped or you closed its tab: open your codespaces and choose the same one, not a new one. In its terminal, type claude --continue to pick up where you left off.
  • The same step fails twice: raise your hand, and leave the error on screen for the instructor.

After the workshop

  • To come back to a project, open your codespaces, choose its Codespace, and type claude --continue in the terminal. Your sign-ins stay while the Codespace exists.
  • Continue editing your saved Rails app in its repository. For a deployed app, follow the maintenance steps with your agent. Use a separate runner for scheduled maintenance, because the Codespace can stop when idle.
  • A Codespace stops after 30 minutes without use, and GitHub deletes a stopped Codespace after 30 days. Your app is safe on GitHub once you have pushed it. Delete Codespaces you no longer need: free GitHub accounts include a limited amount of Codespaces use each month.
  • Render's free plan sleeps when nobody visits, so the first visit afterwards takes about a minute.
  • To remove an app from the internet, ask Claude: Delete this app's Render service and its Neon project.

Using a plain terminal

If you have the GitHub CLI, gh codespace ssh connects your own terminal to your Codespace instead. Sign-in pages don't open by themselves there: Claude prints each link, and you open it in your browser.

Using Codex

Codex is also installed. In step 3, run codex login --device-auth: open the link it shows, sign in to ChatGPT, and enter the code from the terminal. Then run codex. Start the app with $firstdraft:create-full-stack-app. The optional full sign-in walkthrough is $workshop-signin. Use /new to start a fresh conversation or codex resume to pick up later.

Maintaining this template? Read the maintainer guide.

About

Start a First Draft application with Claude Code and Codex

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages