Add repository scaffolding: .gitignore, README, CONTRIBUTING, MIT license, pre-push quality hook, and documentation covering branching, file conventions, and commit style. Establish the main/develop branching strategy. This is project setup only; no application functionality is included.
2.9 KiB
2.9 KiB
File Structure & Naming Conventions
This document defines the repository layout and naming rules for newzy.
Project Structure
project-root/
├── .gitignore # Files/directories excluded from version control
├── LICENSE # MIT License
├── README.md # Project overview and quick start
├── CONTRIBUTING.md # Contribution guidelines
├── docs/ # Project documentation
│ ├── branching.md # Branch strategy, merge and rebase workflows
│ ├── conventions.md # This file: structure and naming rules
│ └── commits.md # Commit message format and examples
├── hooks/ # Versioned Git hooks (install via core.hooksPath)
│ └── pre-push # Code quality checks before pushing
└── milestones/ # Milestone prompts and progress tracking
└── m1-setup-git-project-prompt.md
As the application grows, the following top-level entries are expected (added in later milestones):
project-root/
├── src/ # Application source code
│ ├── components/ # Reusable UI components
│ ├── pages/ # Route-level views
│ ├── lib/ # Shared utilities and helpers
│ └── ...
├── public/ # Static assets (images, favicon, ...)
├── tests/ # Test suites (if not colocated)
├── scripts/ # Build/automation scripts
└── .env.example # Documented, example environment variables
Naming Conventions
| Item | Convention | Examples |
|---|---|---|
| Directories | kebab-case, plural where they hold many items | components/, news-articles/ |
| Source files | kebab-case | article-card.tsx, feed-service.ts |
| Test files | *.test.* or *.spec.* suffix, colocated with source or in tests/ |
article-card.test.tsx |
| Docs | kebab-case .md |
branching.md, commits.md |
| Branches | type/kebab-name |
feature/reader-view |
| Tags | vX.Y.Z (SemVer) |
v1.0.0 |
| Env files | .env.example committed, .env* ignored |
.env.example |
General Rules
- One file, one concern. If a file grows beyond ~300 lines, consider splitting it.
- Colocate related files (component + its tests + its styles) in the same directory.
- No committed secrets. Secrets belong in
.env(ignored);.env.exampledocuments required variables with placeholder values. - Docs live in
docs/unless they are root-level standards (README, CONTRIBUTING, LICENSE). - Milestones live in
milestones/, namedm<#>-<kebab-name>-prompt.md. - Avoid absolute paths and machine-specific settings in committed files.