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│ ├── 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 header.tsx login-form.tsx
- protected-route.tsx theme-provider.tsx theme-toggle.tsx
- shared pagination / delete confirmation / table state / loading button
- ui 24 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 ThemeToggle.vue
- ToastContainer.vue UnsupportedViewport.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
- App.vue
- main.ts
- vite.config.ts dev proxy /api → localhost:8088
- package.json
Backend Directory
Section titled “Backend Directory”Directoryapp
- main.py FastAPI app, CORS, audit middleware, route registration
Directorycore
- config.py database.py security.py deps.py
- audit.py permissions_catalog.py menu_catalog.py
- app_state.py seed.py schemas.py
- auth user role permission menu
- system ai_model audit data_management dashboard public
- each domain contains models / schemas / crud / router
- pyproject.toml
- .env.example
Domain-modular organization: one package per business domain, with infrastructure kept together under core/.
Directorysrc/main/java/com/hmilyld/fullstack
- FullstackApplication.java
- common ApiResponse / PageResult / global exception handling
- config audit, CORS, Sa-Token, permission catalog and sync task
- controller
- dto
- entity
- repository
- security RateLimiter / StpInterfaceImpl
- service
Directorysrc/main/resources
- application.yml
- db/migration/V1__init.sql Base tables and seed data
- db/migration/V2__menu_and_app_state.sql Menu tables and runtime state
- pom.xml
Organized by layer: controller / service / repository / entity / dto, with infrastructure under common/, config/, and security/.
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.