Project Structure
The Scaffold Itself
Section titled “The Scaffold Itself”fullstack-starter/├── src/│ ├── index.ts # CLI entry: interactive selection of frontend / backend / project name│ └── generator.ts # Generator: copy templates + generate config and script files├── templates/│ ├── base/ # Shared files (.gitignore)│ ├── frontend-react/ # React frontend template│ ├── frontend-vue/ # Vue frontend template│ ├── frontend-svelte/ # Svelte frontend template│ ├── backend-python/ # FastAPI backend template│ └── backend-java/ # Spring Boot backend template├── package.json└── tsconfig.jsonThe files under templates/ are exactly what users end up with; the generator only copies templates and dynamically generates dev.sh, build.sh, Dockerfile, docker-compose.yml, .dockerignore, nginx.conf, and each project’s README.
The Generated Project
Section titled “The Generated Project”my-project/├── frontend/ # Frontend project├── backend/ # Backend project├── dev.sh # Development script: start / stop / restart / install├── build.sh # Build script: frontend build + backend check├── Dockerfile # Single image: frontend build + backend + Nginx├── docker-compose.yml # Docker orchestration├── .dockerignore # Docker build exclusions├── nginx.conf # Nginx config: static files + /api reverse proxy└── README.md # Project documentationFrontend Directory
Section titled “Frontend Directory”Directorysrc
Directoryapi
- client.ts fetch wrapper, auto logout on 401
- auth.ts user.ts role.ts permission.ts menu.ts
- system.ts dashboard.ts ai-model.ts audit-log.ts data-management.ts
Directorytypes
- common.ts auth.ts user.ts role.ts permission.ts menu.ts
- system.ts dashboard.ts ai-model.ts audit-log.ts
Directorycomponents
- admin-layout.tsx app-sidebar.tsx nav-main.tsx header.tsx
- brand-mark.tsx login-form.tsx user-menu.tsx error-boundary.tsx
- protected-route.tsx theme-provider.tsx theme-toggle.tsx pwa-manifest.tsx
- shared pagination / delete confirmation / table state / loading button
- ui 30 shadcn/ui components
Directorylib
- auth-context.tsx site-config.tsx toast.ts utils.ts
Directorypages
- auth login.tsx register.tsx
- dashboard index.tsx
Directorysettings
- user role permission menu system ai-model audit-log data-management profile
- not-found.tsx
- router.tsx
- App.tsx
- main.tsx
- components.json shadcn config
- vite.config.ts dev proxy /api → localhost:8088
- package.json
Directorysrc
- api same as React, split by business domain (client.ts + domain files)
- types split by business domain
Directorycomponents
- AppHeader.vue AppSidebar.vue NavMain.vue BrandMark.vue
- ThemeToggle.vue UserMenu.vue
- shared pagination / delete confirmation / table state / loading button / skeleton
- layouts AdminLayout.vue
Directorypages
- auth Login.vue Register.vue
- dashboard Index.vue
- settings AiModel / AuditLog / DataManagement / MenuManage / PermissionManage / Profile / RoleManage / System / UserManage
- NotFound.vue
- router index.ts
- stores auth.ts site-config.ts theme.ts
- composables use-toast.ts use-media-query.ts use-paged-list.ts use-url-list-state.ts
- App.vue
- main.ts
- vite.config.ts dev proxy /api → localhost:8088
- package.json
Directorysrc
Directoryroutes
- +layout.svelte +layout.ts +page.ts +error.svelte layout.css
- (auth) login register
Directory(app) +layout.svelte +layout.ts protected layout
- dashboard +page.svelte
- settings ai-model / audit-log / data / menu / permission / profile / role / system / user
- Pages are +page.svelte files; subcomponents live beside them
Directorylib
- api same as React, split by business domain (client.ts + domain files)
- types split by business domain
Directorycomponents
Directoryapp-shell
- app-header.svelte app-sidebar.svelte nav-main.svelte
- command-menu.svelte config-drawer.svelte theme-toggle.svelte user-menu.svelte
Directoryshared
- data-list.svelte column-driven table + cards + states
- page-header.svelte list-shell.svelte record-card.svelte table-pagination.svelte
- column-toggle.svelte density-toggle.svelte date-time-field.svelte
- row-actions.svelte form-dialog.svelte confirm-delete-dialog.svelte empty-state.svelte
- trend-chart.svelte hand-drawn SVG trend chart
- ui 31 shadcn-svelte components (including popover)
Directoryhooks
- use-paged-list.svelte.ts use-url-list-state.svelte.ts use-column-visibility.svelte.ts
- use-table-density.svelte.ts use-navigation.svelte.ts use-layout-config.svelte.ts
- use-command-menu.svelte.ts use-debounced-value.svelte.ts use-media-query.svelte.ts use-toast.ts
- stores auth.svelte.ts site-config.svelte.ts theme.svelte.ts
- utils.ts date-time.ts format.ts pwa.ts icons.ts routes.ts
- components.json shadcn config
- vite.config.ts dev proxy /api → localhost:8088
- package.json
Backend Directory
Section titled “Backend Directory”Directoryapp
- main.py FastAPI app, CORS, middleware, routes, startup migration
Directorycore
- config.py database.py security.py deps.py exceptions.py
- pagination.py audit.py models.py app_state.py seed.py schemas.py
Directorycatalogs
- permissions.py menus.py permission codes and built-in menus (single source)
- auth user role permission menu
- system ai_model audit data_management dashboard public
- each domain contains models / schemas / service / router
- migrations Alembic migration scripts
- tests contract tests
- alembic.ini
- pyproject.toml
- .env.example
Domain-modular organization: one package per business domain, infrastructure kept together under core/, routers only map HTTP.
Directorysrc/main/java/com/hmilyld/fullstack
- FullstackApplication.java
- common ApiResponse / PageResult / domain exceptions / global handler
- config Spring configuration: CORS, Sa-Token, OpenAPI, audit properties
- catalog permission and menu catalogs (plain data)
- bootstrap startup sync runners
- web interceptors and filters
- data import job runtime state
- controller
- dto request objects and *Response records
- entity
- repository
- security RateLimiter / StpInterfaceImpl
- service
Directorysrc/main/resources
- application.yml
- db/migration/V1__init.sql Base tables plus role/user seed data
- db/migration/V2__menu_and_app_state.sql Menu tables and runtime state
- db/migration/V3__menu_hidden.sql Sidebar visibility
- db/migration/V4__align_with_python.sql Indexes aligned with Python
- db/migration/V5__remove_seed_permissions.sql Removes the permission seed
- src/test/java/com/hmilyld/fullstack/ContractTest.java Contract tests
- pom.xml
Organized by layer: controller / service / repository / entity / dto, with infrastructure split by responsibility across common/ (envelope and exceptions), config/ (Spring configuration), catalog/ (catalog data), bootstrap/ (startup tasks), web/ (interceptors and filters), data/ (import runtime), and security/ (rate limiting and permission source). Responses use dto/*Response records.
Key Files
Section titled “Key Files”| File | Purpose |
|---|---|
dev.sh |
Development script; installs dependencies and starts frontend and backend together |
build.sh |
Frontend build + backend code check |
Dockerfile |
Multi-stage build producing a single image with Nginx and the backend |
nginx.conf |
Listens on 5173, serves frontend static files, and proxies /api/ to the backend |
frontend/vite.config.ts |
Proxies /api to localhost:8088 during development |
For more detail, see Frontend Structure, Python Backend, and Java Backend.