Skip to content

Instantly share code, notes, and snippets.

@DavidKloucek
Created February 23, 2026 21:24
Show Gist options
  • Select an option

  • Save DavidKloucek/d536649659d5c45c4d9fc25762df8d71 to your computer and use it in GitHub Desktop.

Select an option

Save DavidKloucek/d536649659d5c45c4d9fc25762df8d71 to your computer and use it in GitHub Desktop.

Project Overview

Information system for Czech electricians (ERP). UI language: Czech only. Architecture: SPA (React frontend) + REST API (Symfony backend).


Modules

Module Route Description
Přehled /dashboard Stats dashboard
Zákazníci /customers Customer list + create form
Zakázky /orders Order list (sortable, paginated) + create form with location
Zaměstnanci /users User list (sortable) + edit drawer

Backend

  • Language: PHP 8.4
  • Framework: Symfony 7
  • API: API Platform 4 (REST only, JSON)
  • ORM: Doctrine ORM
  • Database: MariaDB
  • Dependency management: Composer

Authentication

  • lexik/jwt-authentication-bundle — access token (Bearer)
  • gesdinet/jwt-refresh-token-bundle — silent refresh via HttpOnly cookie

Architecture pattern

  • Resources exposed via custom DTO classes in src/ApiResource/
  • Data reading via custom State Providers (*CollectionProvider, *ItemProvider)
  • Data writing via custom State Processors (*CreateProcessor, *UpdateProcessor)
  • No generic Doctrine-based providers — all mapping is explicit
  • Validation via Symfony Validator constraints on DTO properties
  • Locale forced to cs globally (Czech validation messages)

Rules

  • No Docker
  • No GraphQL
  • Follow best practices: SOLID, DDD (lightweight/pragmatic), KISS, DRY
  • Prefer Symfony & API Platform defaults
  • Avoid overengineering

Frontend

  • Framework: React 18 (hooks only, no class components)
  • Language: TypeScript
  • Build tool: Vite

Libraries

  • Refine — resource/routing abstraction, useList for data fetching, auth provider, notification provider
  • MUI v5 (@mui/material, @mui/icons-material, @mui/x-date-pickers) — UI components
  • Zod v4 — form validation schemas (src/lib/schemas.ts), hand-written with Czech error messages
  • Orval — codegen: generates typed axios functions + Zod schemas from /api/docs.json
  • dayjs — date handling, Czech locale adapter for MUI date pickers
  • axios — HTTP client with JWT interceptor + silent refresh logic (src/api.ts)
  • Zustand
  • react-hook-form
  • TanStack Query
  • TanStack Table

Architecture pattern

  • Forms: controlled useState + Zod safeParse before submit — no form library
  • Tables: MUI Table + TableSortLabel + TablePagination, data via useList (Refine)
  • Drawers: consistent pattern — fixed header + scrollable flex:1 content + fixed footer
  • schemaRequired(schema) utility derives required prop on inputs directly from Zod schema

Codegen

  • Run npm run generate (backend must be running at localhost:8000)
  • Output: src/generated/ — typed API functions + Zod schemas
  • VS Code task: Frontend: generate API types (orval)

Rules

  • Keep UI simple and functional
  • No unnecessary abstractions
  • Prefer clarity over cleverness
  • MUI theme: blue primary (#1976D2), no shadows (borders instead), Czech date locale

Current state

  • JWT authentication fully implemented
  • MariaDB + Doctrine migrations running
  • All 4 modules implemented and connected to backend
  • No unit/integration tests yet
  • No advanced permissions yet (all endpoints require IS_AUTHENTICATED_FULLY)
  • No external integrations yet
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment