CSC-105

LibraryHow your app is built

How your app is built

Your agent starts every project the same simple way, so your app works on any phone and stays easy to change. These are defaults, not rules: your taste and your users decide. Tell your agent when you want something different.

A prototype first, then the real thing

Your first version was a prototype you could test with real people, built from docs/project.md:

  • It looks real: a name, a style, and sample data that sounds like your users.
  • The core task works from start to finish: people can tap, type, save and see the result.
  • It faked the hard parts, such as sample data instead of a database and no accounts, but never the experience.

From The hard part on, build those parts for real: real answers where the hard part is, a server when people share data, accounts when they need them. Anything still made up says so in the app, so testers don't mistake it for the real thing. See Testing with users.

Files

  • index.html at the top of your repo is the page your app opens on.
  • styles.css holds the look, and app.js the behavior, loaded with <script type="module" src="app.js">.
  • Sample data goes in data.js, exported as an array, until real people add their own.
  • No framework and no build step. A library you really need loads from a CDN such as https://esm.sh, with its version in the address.
  • Paths are relative (styles.css, ./app.js), never starting with /.

Games, 3D, sound, maps and charts start from Picking a setup for your app.

Where it runs

Your app goes online at its own address, csc105-<your id>.onpaths.net, from the latest commit on main. The course's host decides how to run it from your files:

  • index.html at the top and no package.json: it's served as files. Most apps stay this way until Demo Day.
  • A package.json: it's a Bun app. The host installs from bun.lock, then runs the start script, which must start a server. See A server for your app.

So a package.json added only for a tool turns a working site into a server that can't start, and the App tab says so at once. bun test needs no package.json. The Studio's App tab runs your app the way the host will: a static app from its files, and a Bun app from a preview on the host.

Look

Before the first real styling, your agent asks you one question about the feel you want: a mood, a few colors, or an app you like the look of. Until you answer, it uses these defaults:

  • One stylesheet with the choices at the top, as custom properties on :root: colors, one accent, spacing steps, corner radius and the font.
  • The system font (system-ui) at 16 px or more, with comfortable line spacing.
  • One column about 40 rem wide, centered, with generous space between sections.
  • Contrast you can read: text at least 4.5 : 1 against its background.
  • A background of its own, so the page never depends on the browser's default.

Phones first

Most of your users will open your app on a phone.

  • The page has <meta name="viewport" content="width=device-width, initial-scale=1">.
  • Everything works at 390 px wide, with no sideways scrolling.
  • Buttons and links are at least 44 px tall, easy to tap.
  • Your agent looks at every change at phone size before it commits, and tries what's behind a button or a turn of a game the way you would. It works on a copy of your saved data, so it never changes yours.
  • A game played with the phone held sideways works at 844 × 390. Tell your agent, and it looks at that size too. Sideways in the App tab shows it.

Behavior

  • Real HTML: a <button> for every action, a <label> for every input, and headings in order.
  • Feedback for every action: something on screen changes right away.
  • Every state designed: what people see with no data yet, while something loads, and when something goes wrong.
  • Data that stays: what people add is saved in localStorage under one key, as JSON, until your project needs a server.

Small steps

Your agent builds one change at a time, tries it in the app, and commits it when it works. Each commit says what changed for the person using the app, so your history reads like a story, and any step can be undone.