| master | ||
| develop |
This is the frontend for the OpenShock project that interfaces with the OpenShock API.
pnpm i- Install dependenciespnpm run dev- Start the development serverpnpm run build- Build the projectpnpm run preview- Preview the built projectpnpm run regen-api- Generate the API client
To clone the project you may need to rewrite git HTTPS urls to SSH for the submodule checkout to work on your machine.
You can do this with git config --global url."[email protected]:".insteadOf "https://github.com/"
To get started with development, you will need to have Node.js and pnpm installed. We recommend using a node version manager of your choice.
With Node.js installed, you can run the following commands to get started:
pnpm i
pnpm run buildRunning the frontend locally is as simple as this:
pnpm run devIf you do not have a hosts file config for your domain and try to run the project you will get the following example message:
Please ensure that local.openshock.app resolves to 127.0.0.1 in your hosts file
On macOS and Linux, you can do this by running the following command:
echo "127.0.0.1 local.openshock.app" | sudo tee -a /etc/hosts
On Windows, you can do this by running the following command in PowerShell as an administrator:
Add-Content -Path "C:\Windows\System32\drivers\etc\hosts" -Value "127.0.0.1 local.openshock.app"
Then restart your development server
This action is required because of cookie policy, once you have done this you should be set!
Try closing and re-opening your development environment or console to refresh its cached system config.
.changestes/ # Versioning and changelog automation
.github/ # GitHub workflows
e2e/ # End-to-end tests (Playwright)
patches/ # Manual patches to npm dependencies (used with patch-package)
static/ # Public assets served directly (e.g., images, icons)
src/ # Application source code
βββ lib/ # Shared modules and utilities
β βββ api/ # API clients
β β βββ internal/ # Autogenerated API client (DO NOT EDIT MANUALLY)
β βββ components/ # UI components
β β βββ metadata/ # Meta helpers for SEO and accessibility
β β βββ svg/ # Customizable SVG icons
β β βββ ui/ # Shadcn UI components (Do not add custom components here)
β βββ constants/ # Global constants
β βββ errorhandling/ # Error handling utilities
β βββ hooks/ # Svelte hooks
β βββ inputvalidation/ # Input validators for usage with input fields
β βββ signalr/ # SignalR real-time communication logic
β βββ stores/ # Svelte stores for global state management
β βββ typeguards/ # Type guard helpers for runtime type checking
β βββ types/ # Global TypeScript types
β βββ utils/ # General utilities
βββ params/ # SvelteKit route parameter matchers
βββ routes/ # Application routes (file-based routing)
β βββ (app)/ # Protected routes (everything under this folder requires authentication)
β β βββ +layout.svelte # Authentication boundary and layout
β βββ +error.svelte # Global error fallback
β βββ +layout.svelte # Root layout and entrypoint
βββ app.css # Global styles
βββ app.d.ts # Global type declarations
βββ app.html # HTML root template
βββ error.html # Fallback HTML error page (for critical errors)
.npmrcβ npm configuration..nvmrcβ Node.js version manager file.package.json,pnpm-lock.yamlβ Project dependencies and lockfile.
.editorconfigβ Editor formatting consistency across IDEs..prettierrc,.prettierignoreβ Code formatting rules (Prettier).eslint.config.jsβ Linting setup (ESLint).tsconfig.jsonβ TypeScript compiler configuration.vite.config.tsβ Vite bundler config.svelte.config.jsβ SvelteKit configuration.components.jsonβ Component metadata for shadcn.playwright.config.tsβ End-to-end testing configuration (Playwright).
This project leverages Vite's environment handling, following SvelteKit's default convention: publicly accessible variables must be prefixed with PUBLIC_, while non-prefixed variables remain server-side and secure.
Environment variables are loaded in this priority:
- System environment variables
.env.{mode}.local.env.{mode}.env.local.env
With this import order, system environment variables will override any .env files, making sure CI/CD and production environments can set their own variables without needing to modify the codebase.
Any file ending with .local are meant for setting local development variables and should not be committed to Git.
Dockerfileβ Container definition for deployment or local dev..dockerignoreβ Files to exclude from Docker build context.
A guide to selfhost can be found on the wiki. Alternatively you can deploy it to cloudflare workers using wrangler (or forking it).
You can support the openshock dev team here: Sponsor OpenShock
For self hosting support consider supporting us via the link above.