Urban-Analytics-Technology-Platform / web-app-template

https://urban-analytics-technology-platform.github.io/web-app-template/
2 stars 0 forks source link

UA web template

This repo contains several packages:

User guide

If you're reading this because you want to use the web template, i.e. make a new app according to what's here, this section is for you.

Getting started

Firstly, make sure you have both npm and pnpm installed. (You will need it to work on your web app anyway.)

npm create @uatp/web@latest

Working with your new app

TODO

Developer guide

If you are looking to develop the UA web template, i.e. make changes to the components, the app template, or the template generation script, this section is for you.

Overview of repository structure

Initial setup

To get started, you'll need:

The first time you clone this repository, run from the top-level directory:

pnpm install
pnpm --filter @uatp/components build
pnpm --filter uatp_template wasm
pnpm --filter uatp_template build

The --filter ... flag is used to run a command in a specific package. This allows you to run the pnpm commands from anywhere inside the repository. If you are already in the same directory as the package you want to run a command in, you can omit the --filter ... flag.

In each of the subsequent sections, it is assumed that you are in the directory of the corresponding packages. If you are not, you can always run the command with the --filter flag.

@uatp/components library

If the dependencies change: pnpm install

If the library changes: pnpm build

Note that you have to build the library before you can see changes in the template app.

@uatp/template template app

If the dependencies change: pnpm install

If any code in the Rust backend is changed: pnpm rust. (You will have to restart your dev server if it's running.)

If any code in the Python backend is changed: pnpm python.

To run the template app locally (which'll auto-reload any Svelte/TS changes within, but not Rust changes): pnpm dev

@uatp/create-web script

If the dependencies change: pnpm install

To run the script: npm exec .

(There's no build step for this script.)