Architecture & Infrastructure
Project structure and infrastructure
Architecture and infrastructure define how your project is organized and managed. This section covers project structure (monorepo), version control with Git and GitHub, environment management, and deployment pipelines - the foundation that keeps your codebase maintainable as it grows.
Monorepo Structure
Keep frontend, backend, and shared code in a single repository for easier maintenance and deployment.
- Shared types and utilities
- Atomic commits across packages
- Simplified dependency management
Environment Variables
Manage configuration across different environments securely.
- .env - Local development (git ignored)
- .env.example - Template for required variables (committed)
- Use platform secrets for production (Railway, Vercel, etc.)
Version Control
Git best practices for team collaboration.
- main - Production-ready code
- develop - Integration branch for features
- feature/* - Individual feature branches
GitHub Workflow
Leverage GitHub features for better collaboration and automation.
Environments
Separate environments for different stages of development.
localhost:3000Local environment for active development. Uses local database and mock services.
staging.yourapp.comPre-production environment that mirrors production. Test features before release.
yourapp.comLive environment for end users. Never test directly here.
Use separate databases and API keys for each environment. Never share production credentials.