Skip to content

Getting Started

  1. You’ll need node.js 20 or higher.

  2. Create a directory for your site:

    mkdir mysite && cd mysite
  3. Set up the starter project template:

    npx prettynice init
  4. Start the dev server:

    npm run dev

    and open http://localhost:3000/.

    The dev server will watch for changes and rebuild/restart automatically.

Directory Structure

The important files and directories in a prettynice site are:

  • Directoryclient
    • Directorysrc
      • DirectoryComponents # Your client-side components will live here.
        • Counter.gren # An example client-side component.
  • Directorypublic # Public assets (images, css, etc) live here.
  • Directoryserver
    • Directorysrc
      • Main.gren # The server. Entry point for all requests.

All of your client-side code lives under client/ and will be compiled into a bundle that targets the browser.

All of your server-side code lives under server/ and will be compiled into a bundle that targets node.

When you start your app, it runs the server bundle. The browser bundle and anything under public/ will be served from that server as static files.

Read on for a detailed explanation of all those files.