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 | bash
Install on Windows:
winget install Volta.Volta
Then 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 pnpm
With Node.js installed, you can run the following commands to get started:
pnpm i
pnpm run build
Running the frontend locally is as simple as this:
pnpm run dev
If 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)
β βββ (authenticated)/ # 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).
.env
,.env.development
,.env.production
,.env.test
β Environment-specific config files (e.g., API keys, endpoints).
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.