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.
58 lines
2.9 KiB
Markdown
58 lines
2.9 KiB
Markdown
# 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
|
|
|
|
1. **One file, one concern.** If a file grows beyond ~300 lines, consider splitting it.
|
|
2. **Colocate** related files (component + its tests + its styles) in the same directory.
|
|
3. **No committed secrets.** Secrets belong in `.env` (ignored); `.env.example` documents required variables with placeholder values.
|
|
4. **Docs live in `docs/`** unless they are root-level standards (README, CONTRIBUTING, LICENSE).
|
|
5. **Milestones live in `milestones/`**, named `m<#>-<kebab-name>-prompt.md`.
|
|
6. Avoid absolute paths and machine-specific settings in committed files.
|