|
1 | | -# create-svelte |
| 1 | +# Feldera Web Console |
2 | 2 |
|
3 | | -Everything you need to build a Svelte project, powered by [`create-svelte`](https://github.com/sveltejs/kit/tree/main/packages/create-svelte). |
| 3 | +This is the GUI for managing the Feldera deployment. |
4 | 4 |
|
5 | | -## Creating a project |
6 | | - |
7 | | -If you're seeing this, you've probably already done this step. Congrats! |
| 5 | +## Setup |
8 | 6 |
|
9 | 7 | ```bash |
10 | | -# create a new project in the current directory |
11 | | -npm create svelte@latest |
| 8 | +# Install Node on Ubuntu (optional) |
| 9 | +sudo apt-get update |
| 10 | +sudo apt-get install -y ca-certificates curl gnupg |
| 11 | +sudo mkdir -p /etc/apt/keyrings |
| 12 | +curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg |
| 13 | +NODE_MAJOR=20 |
| 14 | +echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list |
| 15 | +sudo apt-get update |
| 16 | +sudo apt-get install nodejs -y |
| 17 | +# If you don't run Ubuntu: [other binary distributions for node.js](https://github.com/nodesource/distributions) |
| 18 | + |
| 19 | +# Install Bun |
| 20 | +sudo apt-get update |
| 21 | +sudo apt-get install -y ca-certificates curl gnupg unzip |
| 22 | +sudo curl -fsSL https://bun.sh/install | bash |
12 | 23 |
|
13 | | -# create a new project in my-app |
14 | | -npm create svelte@latest my-app |
| 24 | +# Install OpenAPI typings generator |
| 25 | +sudo bun install --global @hey-api/openapi-ts |
| 26 | + |
| 27 | +# Clone the repo for the UI |
| 28 | +git clone https://github.com/feldera/feldera.git |
| 29 | +cd dbsp/web-console-sveltekit |
15 | 30 | ``` |
16 | 31 |
|
17 | | -## Developing |
| 32 | +## Development |
18 | 33 |
|
19 | | -Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server: |
| 34 | +Install dependencies (needs to be done whenever package.json depencies change): |
20 | 35 |
|
21 | 36 | ```bash |
22 | | -npm run dev |
| 37 | +bun install |
| 38 | +``` |
23 | 39 |
|
24 | | -# or start the server and open the app in a new browser tab |
25 | | -npm run dev -- --open |
| 40 | +Start the development server: |
| 41 | + |
| 42 | +```bash |
| 43 | +bun run dev |
26 | 44 | ``` |
27 | 45 |
|
28 | | -## Building |
| 46 | +Build & export static website: |
| 47 | + |
| 48 | +```bash |
| 49 | +bun build |
| 50 | +``` |
| 51 | + |
| 52 | +Format the code & linting: |
| 53 | + |
| 54 | +```bash |
| 55 | +bun run format |
| 56 | +bun run lint |
| 57 | +bun run check |
| 58 | +``` |
| 59 | + |
| 60 | +## OpenAPI bindings |
| 61 | + |
| 62 | +The bindings for OpenAPI (under $lib/services/manager) are generated using |
| 63 | +[openapi typescript codegen](https://www.npmjs.com/package/@hey-api/openapi-ts). |
29 | 64 |
|
30 | | -To create a production version of your app: |
| 65 | +If you change the API, execute the following steps to update the bindings: |
31 | 66 |
|
32 | 67 | ```bash |
33 | | -npm run build |
| 68 | +bun run build-openapi # If you need to generate a new openapi.json |
| 69 | +bun run generate-openapi |
34 | 70 | ``` |
35 | 71 |
|
36 | | -You can preview the production build with `npm run preview`. |
| 72 | +## File Organization |
37 | 73 |
|
38 | | -> To deploy your app, you may need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment. |
| 74 | +- `src/assets/`: Static assets referenced in UI components, but not served as-is |
| 75 | +- `src/hooks.server.ts`: Point of injection of HTTP request and page load middleware |
| 76 | +- `src/lib/`: Imported modules |
| 77 | +- `src/lib/components/`: Reusable Svelte components |
| 78 | +- `src/lib/compositions/`: Stateful functions that app state management |
| 79 | +- `src/lib/functions/`: Pure functions, or functions that perform side effects through dependency injection |
| 80 | +- `src/lib/functions/common`: Utility functions that are not specific to this project |
| 81 | +- `src/lib/services/`: Functions that describe side effects (persistent storage, networking etc.) |
| 82 | +- `src/lib/types/`: Types used throughout the app |
| 83 | +- `src/routes/`: Web app pages used in file-based routing |
| 84 | +- `static/`: Static assets served as-is |
0 commit comments