Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .cursor/commands/implement.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ $ARGUMENTS

4. Execute implementation following the task plan:
- **Phase-by-phase execution**: Complete each phase before moving to the next
- **Respect dependencies**: Run sequential tasks in order, parallel tasks [P] can run together
- **Respect dependencies**: Run sequential tasks in order, parallel tasks [P] can run together
- **Follow TDD approach**: Execute test tasks before their corresponding implementation tasks
- **File-based coordination**: Tasks affecting the same files must run sequentially
- **Validation checkpoints**: Verify each phase completion before proceeding
Expand Down
25 changes: 25 additions & 0 deletions .cursor/rules/specify-rules.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# full-stack-fastapi-template Development Guidelines

Auto-generated from all feature plans. Last updated: 2025-10-03

## Active Technologies
- Python 3.11+ + SQLModel, Mermaid, Git hooks, pre-commit framework (001-as-a-first)

## Project Structure
```
backend/
frontend/
tests/
```

## Commands
cd src [ONLY COMMANDS FOR ACTIVE TECHNOLOGIES][ONLY COMMANDS FOR ACTIVE TECHNOLOGIES] pytest [ONLY COMMANDS FOR ACTIVE TECHNOLOGIES][ONLY COMMANDS FOR ACTIVE TECHNOLOGIES] ruff check .

## Code Style
Python 3.11+: Follow standard conventions

## Recent Changes
- 001-as-a-first: Added Python 3.11+ + SQLModel, Mermaid, Git hooks, pre-commit framework

<!-- MANUAL ADDITIONS START -->
<!-- MANUAL ADDITIONS END -->
28 changes: 10 additions & 18 deletions .github/workflows/add-to-project.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@
name: Add to Project

on:
pull_request_target:
issues:
types:
- opened
- reopened

jobs:
add-to-project:
name: Add to project
runs-on: ubuntu-latest
steps:
- uses: actions/add-to-project@v1.0.2
with:
project-url: https://github.com/orgs/fastapi/projects/2
github-token: ${{ secrets.PROJECTS_TOKEN }}
# This workflow has been disabled because it's specific to the FastAPI organization
# and requires a PROJECTS_TOKEN secret that doesn't exist in user repositories.
#
# Original workflow attempted to add PRs and issues to:
# https://github.com/orgs/fastapi/projects/2
#
# To re-enable for your own project board, you would need to:
# 1. Create a Personal Access Token with 'project' scope
# 2. Add it as PROJECTS_TOKEN secret
# 3. Update the project-url to your own project board
2 changes: 2 additions & 0 deletions .github/workflows/generate-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ jobs:
permissions:
contents: write
runs-on: ubuntu-latest
# Disabled - requires FULL_STACK_FASTAPI_TEMPLATE_REPO_TOKEN secret
if: false
steps:
# For PRs from forks
- uses: actions/checkout@v5
Expand Down
11 changes: 11 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,17 @@ repos:
language: system
types: [text]
files: ^frontend/
- id: erd-generation
name: ERD generation
entry: bash -c 'cd backend && python scripts/generate_erd.py --validate --verbose --force'
language: system
types: [python]
files: ^backend/app/.*\.py$
stages: [pre-commit]
always_run: false
pass_filenames: true
require_serial: false
description: "Generate and validate ERD diagrams from SQLModel definitions (Mermaid format)"

ci:
autofix_commit_msg: 🎨 [pre-commit.ci] Auto format from pre-commit.com hooks
Expand Down
9 changes: 7 additions & 2 deletions .specify/memory/constitution.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!--
<!--
Sync Impact Report:
Version change: 0.1.0 β†’ 1.0.0 (MAJOR: Initial constitution creation)
Modified principles: N/A (new constitution)
Expand Down Expand Up @@ -43,12 +43,16 @@ All new features MUST implement secure defaults: JWT authentication, password ha
- Integration tests MUST verify API endpoints and database interactions
- End-to-end tests MUST validate complete user workflows
- Contract tests MUST ensure API schema consistency
- ERD generation MUST have unit tests, integration tests, and performance tests
- ERD validation MUST include syntax validation and relationship verification

### Documentation Standards
- All new features MUST include API documentation via OpenAPI/Swagger
- User-facing features MUST have updated README sections
- Complex business logic MUST include inline documentation
- Deployment changes MUST update deployment.md
- Database schema changes MUST automatically update Entity Relationship Diagrams (ERD)
- ERD documentation MUST be generated from SQLModel definitions and kept in sync

## Quality Standards

Expand All @@ -57,6 +61,7 @@ All new features MUST implement secure defaults: JWT authentication, password ha
- Frontend pages MUST load within 2 seconds
- Database queries MUST be optimized and indexed appropriately
- Docker containers MUST start within 30 seconds
- ERD generation MUST complete within 30 seconds for schemas with up to 20 tables and 100 fields

### Accessibility Standards
- All UI components MUST meet WCAG 2.1 AA standards
Expand Down Expand Up @@ -94,4 +99,4 @@ This constitution supersedes all other development practices and guidelines. Ame

All pull requests and code reviews MUST verify compliance with constitutional principles. Complexity additions MUST be justified with clear business value and technical necessity. Use development.md and deployment.md for runtime development guidance.

**Version**: 1.0.0 | **Ratified**: 2024-12-19 | **Last Amended**: 2024-12-19
**Version**: 1.0.0 | **Ratified**: 2024-12-19 | **Last Amended**: 2024-12-19
14 changes: 7 additions & 7 deletions .specify/scripts/bash/check-prerequisites.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ OPTIONS:
EXAMPLES:
# Check task prerequisites (plan.md required)
./check-prerequisites.sh --json

# Check implementation prerequisites (plan.md + tasks.md required)
./check-prerequisites.sh --json --require-tasks --include-tasks

# Get feature paths only (no validation)
./check-prerequisites.sh --paths-only

EOF
exit 0
;;
Expand Down Expand Up @@ -147,20 +147,20 @@ if $JSON_MODE; then
json_docs=$(printf '"%s",' "${docs[@]}")
json_docs="[${json_docs%,}]"
fi

printf '{"FEATURE_DIR":"%s","AVAILABLE_DOCS":%s}\n' "$FEATURE_DIR" "$json_docs"
else
# Text output
echo "FEATURE_DIR:$FEATURE_DIR"
echo "AVAILABLE_DOCS:"

# Show status of each potential document
check_file "$RESEARCH" "research.md"
check_file "$DATA_MODEL" "data-model.md"
check_dir "$CONTRACTS_DIR" "contracts/"
check_file "$QUICKSTART" "quickstart.md"

if $INCLUDE_TASKS; then
check_file "$TASKS" "tasks.md"
fi
fi
fi
24 changes: 12 additions & 12 deletions .specify/scripts/bash/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,21 @@ get_current_branch() {
echo "$SPECIFY_FEATURE"
return
fi

# Then check git if available
if git rev-parse --abbrev-ref HEAD >/dev/null 2>&1; then
git rev-parse --abbrev-ref HEAD
return
fi

# For non-git repos, try to find the latest feature directory
local repo_root=$(get_repo_root)
local specs_dir="$repo_root/specs"

if [[ -d "$specs_dir" ]]; then
local latest_feature=""
local highest=0

for dir in "$specs_dir"/*; do
if [[ -d "$dir" ]]; then
local dirname=$(basename "$dir")
Expand All @@ -47,13 +47,13 @@ get_current_branch() {
fi
fi
done

if [[ -n "$latest_feature" ]]; then
echo "$latest_feature"
return
fi
fi

echo "main" # Final fallback
}

Expand All @@ -65,19 +65,19 @@ has_git() {
check_feature_branch() {
local branch="$1"
local has_git_repo="$2"

# For non-git repos, we can't enforce branch naming but still provide output
if [[ "$has_git_repo" != "true" ]]; then
echo "[specify] Warning: Git repository not detected; skipped branch validation" >&2
return 0
fi

if [[ ! "$branch" =~ ^[0-9]{3}- ]]; then
echo "ERROR: Not on a feature branch. Current branch: $branch" >&2
echo "Feature branches should be named like: 001-feature-name" >&2
return 1
fi

return 0
}

Expand All @@ -87,13 +87,13 @@ get_feature_paths() {
local repo_root=$(get_repo_root)
local current_branch=$(get_current_branch)
local has_git_repo="false"

if has_git; then
has_git_repo="true"
fi

local feature_dir=$(get_feature_dir "$repo_root" "$current_branch")

cat <<EOF
REPO_ROOT='$repo_root'
CURRENT_BRANCH='$current_branch'
Expand Down
14 changes: 7 additions & 7 deletions .specify/scripts/bash/setup-plan.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ ARGS=()

for arg in "$@"; do
case "$arg" in
--json)
JSON_MODE=true
--json)
JSON_MODE=true
;;
--help|-h)
--help|-h)
echo "Usage: $0 [--json]"
echo " --json Output results in JSON format"
echo " --help Show this help message"
exit 0
exit 0
;;
*)
ARGS+=("$arg")
*)
ARGS+=("$arg")
;;
esac
done
Expand Down Expand Up @@ -53,7 +53,7 @@ if $JSON_MODE; then
"$FEATURE_SPEC" "$IMPL_PLAN" "$FEATURE_DIR" "$CURRENT_BRANCH" "$HAS_GIT"
else
echo "FEATURE_SPEC: $FEATURE_SPEC"
echo "IMPL_PLAN: $IMPL_PLAN"
echo "IMPL_PLAN: $IMPL_PLAN"
echo "SPECS_DIR: $FEATURE_DIR"
echo "BRANCH: $CURRENT_BRANCH"
echo "HAS_GIT: $HAS_GIT"
Expand Down
Loading
Loading