Skip to content

Commit 46f9f26

Browse files
committed
feat: initial fullstack starter template
- Next.js 16 + React 19 + TailwindCSS v4 web app - FastAPI + SQLAlchemy async backend - Flutter 3.32 + Riverpod 3 mobile app - Background worker with CloudTasks/PubSub - Terraform GCP infrastructure (Cloud Run, Cloud SQL, etc.) - GitHub Actions CI/CD with Workload Identity Federation - AI agent guidelines for Gemini/Claude - Multi-language support (ko, en, ja)
0 parents  commit 46f9f26

File tree

110 files changed

+5382
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

110 files changed

+5382
-0
lines changed

.agent/rules/GEMINI.md

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
# Fullstack Starter - Project Overview
2+
3+
## Description
4+
Modern fullstack monorepo template with Next.js 16, FastAPI, Flutter, and GCP infrastructure.
5+
6+
## Tech Stack
7+
8+
### Frontend (apps/web)
9+
- **Framework**: Next.js 16 with React 19
10+
- **Styling**: TailwindCSS v4 + shadcn/ui
11+
- **State**: Jotai (global), TanStack Query (server)
12+
- **Auth**: better-auth
13+
- **i18n**: next-intl
14+
- **API Client**: Orval (OpenAPI codegen)
15+
- **Testing**: Vitest + Playwright
16+
17+
### Backend (apps/api)
18+
- **Framework**: FastAPI with Python 3.13
19+
- **Database**: PostgreSQL 16 with SQLAlchemy async
20+
- **Cache**: Redis 7.2
21+
- **Migrations**: Alembic
22+
- **Storage**: GCS / MinIO
23+
- **Package Manager**: uv + poe tasks
24+
25+
### Worker (apps/worker)
26+
- **Framework**: FastAPI (HTTP-based worker)
27+
- **Queue**: Cloud Tasks / Pub/Sub
28+
- **Retry**: tenacity
29+
30+
### Mobile (apps/mobile)
31+
- **Framework**: Flutter 3
32+
- **State**: Riverpod
33+
- **Routing**: go_router
34+
- **API Client**: swagger_parser (OpenAPI codegen)
35+
- **l10n**: Flutter intl
36+
37+
### Infrastructure (apps/infra)
38+
- **IaC**: Terraform
39+
- **Cloud**: GCP (Cloud Run, Cloud SQL, Memorystore, GCS, Cloud Tasks, Pub/Sub)
40+
- **CI/CD**: GitHub Actions with Workload Identity Federation
41+
42+
## Project Structure
43+
```
44+
fullstack-starter/
45+
├── apps/
46+
│ ├── api/ # FastAPI backend
47+
│ ├── web/ # Next.js frontend
48+
│ ├── worker/ # Background worker
49+
│ ├── mobile/ # Flutter mobile app
50+
│ └── infra/ # Terraform infrastructure
51+
├── packages/ # Shared packages (if needed)
52+
├── docs/ # Documentation
53+
└── [config files] # Root configuration
54+
```
55+
56+
## Key Patterns
57+
58+
### API Layer
59+
- Feature-based module structure
60+
- Repository pattern for data access
61+
- Dependency injection via FastAPI Depends
62+
- Abstract base classes for AI and Storage providers
63+
64+
### Web Layer
65+
- App Router with Route Groups
66+
- Server Components by default
67+
- Client Components only when needed (interactivity, hooks)
68+
- Colocation of components with routes
69+
70+
### Mobile Layer
71+
- Feature-first architecture
72+
- Riverpod for DI and state
73+
- Freezed for immutable models
74+
75+
## Code Conventions
76+
77+
### Naming
78+
- Files: kebab-case (e.g., `user-profile.tsx`)
79+
- Components: PascalCase (e.g., `UserProfile`)
80+
- Functions/Variables: camelCase (e.g., `getUserProfile`)
81+
- Python: snake_case (e.g., `get_user_profile`)
82+
- Constants: SCREAMING_SNAKE_CASE (e.g., `MAX_RETRY_COUNT`)
83+
84+
### TypeScript
85+
- Prefer `interface` over `type` for object shapes
86+
- Use `type` for unions, intersections, and utility types
87+
- No `any` - use `unknown` and narrow types
88+
- Prefer named exports over default exports
89+
90+
### Python
91+
- Type hints required for all function signatures
92+
- Async/await for all I/O operations
93+
- Pydantic models for request/response schemas
94+
- ABC for extensible components (AI providers, Storage, etc.)
95+
96+
## Important Files
97+
- `mise.toml` - Runtime versions and task runner
98+
- `biome.json` - JS/TS linting and formatting
99+
- `apps/api/pyproject.toml` - Python dependencies and tasks
100+
- `apps/web/package.json` - Web dependencies and scripts
101+
- `apps/infra/variables.tf` - Infrastructure configuration

.agent/rules/build-guide.md

Lines changed: 202 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,202 @@
1+
# Build Guide
2+
3+
## Quick Start
4+
5+
### Prerequisites
6+
Ensure you have `mise` installed for runtime management.
7+
8+
```bash
9+
# Install all runtimes
10+
mise install
11+
12+
# Verify versions
13+
mise current
14+
```
15+
16+
## Build Commands
17+
18+
### Root (All Apps)
19+
```bash
20+
# Install all dependencies
21+
pnpm install # JS/TS packages
22+
uv sync --frozen # Python packages (in apps/api and apps/worker)
23+
flutter pub get # Flutter packages (in apps/mobile)
24+
25+
# Build all
26+
pnpm build
27+
```
28+
29+
### API (apps/api)
30+
```bash
31+
cd apps/api
32+
33+
# Install dependencies
34+
uv sync --frozen
35+
36+
# Run development server
37+
poe dev
38+
39+
# Run with auto-reload
40+
poe dev:reload
41+
42+
# Build Docker image
43+
docker build -t api .
44+
```
45+
46+
### Web (apps/web)
47+
```bash
48+
cd apps/web
49+
50+
# Install dependencies
51+
pnpm install
52+
53+
# Development server
54+
pnpm dev
55+
56+
# Production build
57+
pnpm build
58+
59+
# Start production server
60+
pnpm start
61+
62+
# Generate API client from OpenAPI
63+
pnpm generate:api
64+
65+
# Build Docker image
66+
docker build -t web .
67+
```
68+
69+
### Worker (apps/worker)
70+
```bash
71+
cd apps/worker
72+
73+
# Install dependencies
74+
uv sync --frozen
75+
76+
# Run development server
77+
poe dev
78+
79+
# Build Docker image
80+
docker build -t worker .
81+
```
82+
83+
### Mobile (apps/mobile)
84+
```bash
85+
cd apps/mobile
86+
87+
# Install dependencies
88+
flutter pub get
89+
90+
# Generate code (Freezed, Riverpod, etc.)
91+
flutter pub run build_runner build --delete-conflicting-outputs
92+
93+
# Generate l10n
94+
flutter gen-l10n
95+
96+
# Generate API client
97+
dart run swagger_parser:generate
98+
99+
# Run app
100+
flutter run
101+
102+
# Build APK
103+
flutter build apk --release
104+
105+
# Build iOS
106+
flutter build ios --release
107+
```
108+
109+
### Infrastructure (apps/infra)
110+
```bash
111+
cd apps/infra
112+
113+
# Initialize Terraform
114+
terraform init -backend-config="bucket=your-tfstate-bucket"
115+
116+
# Plan changes
117+
terraform plan -var-file="terraform.tfvars"
118+
119+
# Apply changes
120+
terraform apply -var-file="terraform.tfvars"
121+
122+
# Destroy (careful!)
123+
terraform destroy -var-file="terraform.tfvars"
124+
```
125+
126+
## Docker Compose (Local Development)
127+
128+
### Start Infrastructure
129+
```bash
130+
cd apps/api
131+
docker compose -f docker-compose.infra.yml up -d
132+
```
133+
134+
This starts:
135+
- PostgreSQL (port 5432)
136+
- Redis (port 6379)
137+
- MinIO (ports 9000, 9001)
138+
139+
### Stop Infrastructure
140+
```bash
141+
docker compose -f docker-compose.infra.yml down
142+
```
143+
144+
### Reset Infrastructure (with data)
145+
```bash
146+
docker compose -f docker-compose.infra.yml down -v
147+
```
148+
149+
## Database Migrations
150+
151+
### Create Migration
152+
```bash
153+
cd apps/api
154+
poe migration "description of changes"
155+
```
156+
157+
### Apply Migrations
158+
```bash
159+
cd apps/api
160+
poe migrate
161+
```
162+
163+
### Rollback Migration
164+
```bash
165+
cd apps/api
166+
alembic downgrade -1
167+
```
168+
169+
## Common Build Issues
170+
171+
### Python Import Errors
172+
```bash
173+
# Ensure virtual environment is activated
174+
source .venv/bin/activate # or let mise handle it
175+
176+
# Reinstall dependencies
177+
uv sync --frozen
178+
```
179+
180+
### Node Module Issues
181+
```bash
182+
# Clear node_modules and reinstall
183+
rm -rf node_modules pnpm-lock.yaml
184+
pnpm install
185+
```
186+
187+
### Flutter Build Issues
188+
```bash
189+
# Clean and rebuild
190+
flutter clean
191+
flutter pub get
192+
flutter pub run build_runner build --delete-conflicting-outputs
193+
```
194+
195+
### Terraform State Issues
196+
```bash
197+
# Refresh state from cloud
198+
terraform refresh -var-file="terraform.tfvars"
199+
200+
# Import existing resource
201+
terraform import -var-file="terraform.tfvars" google_storage_bucket.uploads your-bucket-name
202+
```

0 commit comments

Comments
 (0)