4.2 KiB
4.2 KiB
description
| description |
|---|
| Guides through standardized project initialization following team conventions |
Project Setup Standards
You are helping set up a new project following our team's standardized conventions. Guide the developer through the following setup steps:
1. Project Structure
Create a well-organized project structure based on the project type:
For Backend Projects:
project-name/
├── src/
│ ├── api/
│ ├── services/
│ ├── models/
│ ├── utils/
│ └── config/
├── tests/
│ ├── unit/
│ └── integration/
├── docs/
├── .github/
│ └── workflows/
├── .gitignore
├── README.md
├── package.json (or equivalent)
└── .env.example
For Frontend Projects:
project-name/
├── src/
│ ├── components/
│ ├── pages/
│ ├── hooks/
│ ├── utils/
│ ├── styles/
│ └── assets/
├── tests/
├── public/
├── docs/
├── .github/
│ └── workflows/
├── .gitignore
├── README.md
├── package.json
└── .env.example
2. Essential Configuration Files
.gitignore
Include standard ignores for:
- Dependencies (node_modules, venv, etc.)
- Environment files (.env, .env.local)
- Build outputs (dist, build, *.log)
- IDE-specific files (.vscode, .idea)
- OS-specific files (.DS_Store, Thumbs.db)
README.md Template
# Project Name
## Description
Brief description of what this project does
## Prerequisites
- List required software/tools
- Minimum versions
## Installation
Step-by-step installation instructions
## Usage
How to run the project
## Testing
How to run tests
## Contributing
Link to contribution guidelines
## License
License information
3. Dependency Management
For Node.js Projects:
- Initialize with
npm initoryarn init - Set up package.json with proper scripts:
start,dev,build,test,lint
- Include commonly used dependencies and devDependencies
- Set up a lockfile (package-lock.json or yarn.lock)
For Python Projects:
- Create requirements.txt or use Poetry/Pipenv
- Set up virtual environment
- Include common dependencies with pinned versions
- Create requirements-dev.txt for development dependencies
4. Code Quality Tools
Set up the following tools:
- Linter: ESLint (JS/TS), Pylint/Flake8 (Python), etc.
- Formatter: Prettier (JS/TS), Black (Python), etc.
- Pre-commit Hooks: Use Husky or pre-commit framework
- Type Checking: TypeScript or mypy for Python
5. Testing Setup
Initialize testing framework:
- JavaScript/TypeScript: Jest, Vitest, or Mocha
- Python: pytest or unittest
- Create initial test structure
- Set up test coverage reporting
6. CI/CD Pipeline
Create .github/workflows/ci.yml with:
- Automated testing on pull requests
- Linting and formatting checks
- Build verification
- Optional: deployment workflows
Example workflow:
name: CI
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup
uses: actions/setup-node@v3
with:
node-version: '18'
- run: npm ci
- run: npm test
- run: npm run lint
7. Environment Variables
Create .env.example with:
- All required environment variables (without values)
- Comments explaining each variable
- Example values where appropriate
8. Documentation
Set up:
- API documentation (Swagger/OpenAPI for backends)
- Component documentation (Storybook for frontends)
- Architecture decision records (ADR) in docs/adr/
9. Git Setup
- Initialize git repository if not already done
- Create initial commit with project structure
- Set up branch protection rules on main/master
- Create development branch
10. Team-Specific Conventions
Apply team-specific standards:
- Naming conventions (camelCase, snake_case, etc.)
- Code organization patterns
- Commit message format (Conventional Commits)
- PR template in
.github/pull_request_template.md
After gathering project requirements, guide the developer through each applicable section, creating necessary files and configurations. Explain the reasoning behind each standard to promote understanding.