Optikt App is an optical store management system built to support real day-to-day operations in a single place. It centralizes inventory, products, lenses, quotes, sales, suppliers, and role-based workflows so the business does not depend on disconnected spreadsheets or generic admin tools.
Optical stores usually need more than a simple stock tracker. They work with products, lenses, supplier pricing, prescriptions, quotes, and sales flows that have to stay consistent across the business. This project was created to cover those operational needs with a web application designed for actual store usage, not as a generic demo.
- Product and inventory management
- Lens catalog management
- Customer and supplier management
- Quote and sales workflows
- Pricing and operational tracking
- Role-based access and business logic
- SvelteKit 2 + Svelte 5
- TypeScript
- Tailwind CSS + Flowbite-Svelte
- Drizzle ORM + PostgreSQL
- Zod for validation
- Playwright + Vitest for testing
- Docker for containerized deployment
- Node.js 20+
- pnpm
- A PostgreSQL database
pnpm installCreate a local environment file from the example:
cp .env.example .envCurrent required variables:
DATABASE_URL="postgres://user:password@host:port/db-name"
DATABASE_URL_DOCKER="postgres://user:password@host.docker.internal:port/db-name"
ORIGIN="localhost:3000"Update them with real values for your local setup.
If you want the project to apply migrations and seed the initial admin user, run:
pnpm db:bootstrapOther useful database commands:
pnpm db:push
pnpm db:generate
pnpm db:migrate
pnpm db:studiopnpm devThe app will be available at http://localhost:5173 by default.
Run the main validation commands before shipping changes:
pnpm check
pnpm lint
pnpm testYou can also build and preview a production bundle locally:
pnpm build
pnpm previewThis project uses @sveltejs/adapter-node and ships a multi-stage production image.
docker build -t optikt-app .The image build injects a temporary DATABASE_URL only for the build step so pnpm build does not need a live database connection.
The repository includes two compose files for running the app container with environment variables from a file:
docker-compose.ymluses.envdocker-compose-dev.ymluses.env.dev
Example:
docker build -t optikt-app .
docker compose -f docker-compose-dev.yml up -dIn that mode, the app container connects to the database defined by DATABASE_URL_DOCKER.
For a self-contained deployment with the app and PostgreSQL together:
docker compose -f docker-compose-prod.yml up -dThis stack starts:
postgreson PostgreSQL 16optikt-appon port3000
The production container entrypoint waits for the database, applies migrations, and runs the bootstrap script automatically.
- Set
ORIGINto the real public URL - Use a strong
DB_PASSWORD - Review the default bootstrap behavior before exposing the app publicly
Publishing to Docker Hub is handled manually from GitHub Actions through .github/workflows/docker-build.yml.
Typical flow:
- Open GitHub Actions and run the Docker workflow.
- Select the
mainbranch. - Choose the version bump:
patch,minor, ormajor. - The workflow updates
package.json, creates the release commit and tag, then builds and pushes the image.
Required repository secrets:
DOCKER_USERNAMEDOCKER_PASSWORD
src/routes- app routes and pagessrc/lib/components- reusable UI and domain componentssrc/lib/remote- remote queries, forms, and commandssrc/lib/server- server-side auth, guards, database, and audit logicsrc/lib/schemas- Zod validation schemasdrizzle- database schema and migrations
- Package manager for this repository is
pnpm - Styling is done with Tailwind CSS
- The app is intended for business workflows and operational management, not fiscal invoicing