Files
AI/preferences/project-structure.md
2026-04-03 00:56:48 -07:00

2.4 KiB

Standard Project Structures

PowerShell / WPF Application

For IT tooling and local GUI applications.

ProjectName/
├── ProjectName.ps1           # Main entry point — UI, startup, STA check
├── company-settings.psd1     # External config — no credentials
├── README.md
├── Modules/
│   └── ProjectName.psm1     # Shared functions, config loading, helpers
└── Release-Notes/
    ├── v1.0.md
    └── v1.1.md

Rules:

  • Entry .ps1 handles: STA check, assembly loading, module import, config load, show window
  • All reusable logic lives in the .psm1 module, not inline in the entry point
  • Config file is always in the same directory as the script
  • Release-Notes/ uses one file per version: v{major}.{minor}.md

FastAPI Web Application (Docker Compose)

For self-hosted web apps running behind Nginx.

project-name/
├── docker-compose.yml
├── .env.example              # Always committed — placeholder values only
├── .gitignore                # Must include .env
├── README.md
├── nginx/
│   └── default.conf
└── backend/
    ├── Dockerfile
    ├── requirements.txt
    └── app/
        ├── main.py
        ├── config.py
        ├── database.py
        ├── dependencies.py
        ├── models/
        │   └── user.py
        ├── schemas/
        │   └── user.py
        ├── routers/
        │   ├── auth.py
        │   └── [resource].py
        └── utils/

Rules:

  • .env is never committed — .env.example always is
  • Each resource (users, items, etc.) gets its own model, schema, and router file

Hugo Blog (chns.tech)

See preferences/articles.md for the canonical post template, front matter, and formatting conventions.


Git Conventions

  • Branch: Commit directly to main (solo projects)
  • Commit messages: Short imperative summary — Add user auth, Fix config loading, Update README
  • Never commit: .env, credentials, compiled binaries, node_modules, __pycache__
  • Always include a .gitignore appropriate for the project type

Standard .gitignore entries

PowerShell projects:

*.exe
company-settings.psd1   # If it contains org-specific paths

Python projects:

.env
__pycache__/
*.pyc
.pytest_cache/