Svelte Satoria - Industrial Process Management (v0.0.1)
Svelte Satoria is a web application designed for configuring, managing, and monitoring industrial processes, likely for ATV (Automated Test Vehicle or similar) lines. It provides a user-friendly interface for operators and administrators to interact with machine settings and oversee operations.
This application is built with SvelteKit and leverages modern web technologies to deliver a responsive and efficient user experience.
Tech Stack
- Framework: SvelteKit (
^2.21.5) - Language: TypeScript (
^5.8.3) - UI Library: Svelte (
^5.34.2) - Styling:
- Tailwind CSS (
^4.1.10) bits-ui(^2.7.0) - UI componentsclsx(^2.1.1) &tailwind-merge(^3.3.1) - Class name utilitiestailwind-variants(^1.0.0) - Variant managementtw-animate-css(^1.3.4) - Animationsmode-watcher(^1.0.8) - Dark mode / theme management
- Tailwind CSS (
- Forms:
sveltekit-superforms(^2.26.1)formsnap(^2.0.1)zod(^3.25.64) - Schema validation
- Authentication & Security:
jose(^6.0.11) - JWT (JSON Web Token) handlingbcrypt(^6.0.0) - Password hashing
- Database & ORM:
- PostgreSQL (inferred from
pgdriver and Drizzle config) drizzle-orm(^0.44.2)drizzle-kit(^0.31.1) - Drizzle ORM toolingpg(^8.16.0) - Node.js PostgreSQL client
- PostgreSQL (inferred from
- API & Server:
- SvelteKit server-side capabilities
@sveltejs/adapter-node(^5.2.12) - Node.js adapter for SvelteKit
- Charting:
echarts(^5.6.0)
- Linting & Formatting:
- ESLint (
^9.29.0) - Prettier (
^3.5.3) eslint-plugin-svelte(^3.9.2)prettier-plugin-svelte(^3.4.0)prettier-plugin-tailwindcss(^0.6.12)
- ESLint (
- Development Tools:
- Vite (
^6.3.5) svelte-check(^4.2.1)tsx(^4.20.3) - TypeScript execution
- Vite (
- Runtime Environment (likely): Bun (inferred from
bun.lock) - Other Notable Libraries:
dotenv(^16.5.0) - Environment variable managementnode-device-detector(^2.2.2) - Device detectionsvelte-sonner(^1.0.5) - Toast notifications@lucide/svelte(^0.515.0) - Icon library
Key Features
- User Authentication: Secure login, registration, and session management using JWT.
- Role-Based Access Control: Different views and capabilities for regular users and administrators.
- Device/Machine Configuration: Detailed forms for setting parameters for various process stages:
- Heating (
form-heating.svelte) - Preparation (
form-prepare.svelte) - Filling (
form-filling.svelte) - Sterilization (
form-sterilization.svelte)
- Heating (
- Process Monitoring: Includes a section for real-time monitoring of machine status, alarms, and potentially charts for temperature and other metrics.
- Account Management: Features for users to manage their credentials (e.g., password changes).
- Admin Panel: Capabilities for administrators to manage devices, user accounts, and potentially system-wide settings.
- Responsive UI: Utilizes Tailwind CSS for a modern and adaptable user interface across different devices.
- Dark Mode: Supports light and dark themes, configurable via CSS variables and
mode-watcher. - Toast Notifications: Provides user feedback for actions like saving configurations.
Project Structure Highlights
src/lib/server/db/: Contains database schema (schema.ts), Drizzle ORM setup (index.ts), and Zod schemas for validation (schemaZod.ts).src/lib/server/middleware/Authentication.ts: Handles JWT-based authentication logic.src/lib/utils/configuration/config-atv.ts: Defines types and potentially default values for ATV machine configurations.src/routes/(app)/configuration/lineX/atva/: Contains the Svelte components for different machine configuration forms (heating, prepare, filling, sterilization).src/routes/(app)/account/: User account management pages.src/routes/(admin)/: Admin-specific routes for user and device management.src/app.css: Defines global styles, Tailwind CSS setup, and oklch color variables for theming (light and dark modes).src/app.d.ts: TypeScript definitions for the application, including extendingApp.Localsfor JWT utilities.src/hooks.server.ts: Server-side hooks for initializing JWT utilities and handling other requests.drizzle/: Contains database migration files generated by Drizzle Kit.
Getting Started
-
Clone the repository (if applicable):
git clone <repository-url> cd svelte-satoria
-
Install dependencies:
Given the presence ofbun.lock, Bun is the recommended package manager.bun install
Alternatively, if you prefer npm or yarn, delete
bun.lockand runnpm installoryarn install. -
Set up environment variables:
Create a.envfile in the root directory. This file should contain necessary environment variables such as:DATABASE_URL: Connection string for your PostgreSQL database (e.g.,postgresql://user:password@host:port/database).JWT_SECRET: A strong secret key for signing JWTs.- Other environment-specific configurations.
(Refer to any.env.exampleif available, or check the code for required variables, e.g., insrc/lib/server/middleware/Authentication.ts).
-
Database Setup & Migrations:
- Ensure your PostgreSQL server is running and accessible.
- Apply database migrations using Drizzle Kit (scripts are available in
package.json):If you generate migration files, you might need to apply them using a separate command or ensure your application handles this.bun run db:push # Applies pending migrations directly # OR for generating migration files: # bun run db:migrate
db:pushis often simpler for development.
-
Run the development server:
bun run dev
The application should now be running, typically on
http://localhost:5173.
Available Scripts (from package.json)
dev: Starts the development server using Vite.build: Builds the application for production using Vite.preview: Previews the production build locally.prepare: SvelteKit sync script (ensures type safety and generates necessary files).check: Runs SvelteKit sync and performs type-checking usingsvelte-check.check:watch: Runs SvelteKit sync and type-checking in watch mode.format: Formats the codebase using Prettier.lint: Checks formatting with Prettier and lints with ESLint.db:start: Starts the database using Docker Compose (assumesdocker-compose.ymlis configured for PostgreSQL).db:push: Pushes schema changes directly to the database using Drizzle Kit.db:migrate: Generates SQL migration files based on schema changes using Drizzle Kit.db:studio: Opens Drizzle Studio to browse and manage your database.
Main Dependencies (dependencies in package.json)
@tailwindcss/language-server:^0.14.21bcrypt:^6.0.0dotenv:^16.5.0drizzle-orm:^0.44.2echarts:^5.6.0jose:^6.0.11node-device-detector:^2.2.2pg:^8.16.0postgres:^3.4.7(Note:pgis generally used with Drizzle for PostgreSQL;postgresmight be for a specific use or an alternative)svelte-language-server:^0.17.15svelte-sonner:^1.0.5sveltekit-superforms:^2.26.1typescript-svelte-plugin:^0.3.47zod:^3.25.64
Development Dependencies (devDependencies in package.json)
@eslint/compat:^1.3.0@eslint/js:^9.29.0@internationalized/date:^3.8.2@lucide/svelte:^0.515.0@sveltejs/adapter-node:^5.2.12@sveltejs/kit:^2.21.5@sveltejs/vite-plugin-svelte:^5.1.0@tailwindcss/forms:^0.5.10@tailwindcss/vite:^4.1.10@tanstack/table-core:^8.21.3@types/bcrypt:^5.0.2@types/node:^24.0.1@types/pg:^8.15.4bits-ui:^2.7.0clsx:^2.1.1drizzle-kit:^0.31.1eslint:^9.29.0eslint-config-prettier:^10.1.5eslint-plugin-svelte:^3.9.2formsnap:^2.0.1globals:^16.2.0mode-watcher:^1.0.8prettier:^3.5.3prettier-plugin-svelte:^3.4.0prettier-plugin-tailwindcss:^0.6.12svelte:^5.34.2svelte-check:^4.2.1tailwind-merge:^3.3.1tailwind-variants:^1.0.0tailwindcss:^4.1.10tsx:^4.20.3tw-animate-css:^1.3.4typescript:^5.8.3typescript-eslint:^8.34.0vite:^6.3.5
License
Refer to the LICENSE.md file for licensing information.
Release Information
This repository contains only the compiled version of the monitoring system. It is updated automatically via GitHub Actions.
Last updated: Wed Jun 18 01:59:33 UTC 2025