| 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 projectpnpx openapi-generator-cli generate- Generate the API client
To get started with development, you will need to have Node.js and pnpm installed.
We recommend using a version manager like Volta to manage your Node.js versions.
Install on Linux:
curl https://get.volta.sh | bashInstall on Windows:
winget install Volta.VoltaThen you can install the required Node.js and pnpm version by running a single command in the repository root directory:
volta install node
volta install pnpmWith 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.openapitools.jsonโ Codegen config from OpenAPI spec.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.
You can support the openshock dev team here: Sponsor OpenShock
For self hosting support consider supporting us via the link above.