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, Render, 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.
Video Tutorials
Environments
Separate environments for different stages of development.
localhost:3000Where you build new features, fix bugs, and experiment freely. Run your app locally with mock data and test services.
staging.yourapp.comTest your changes on a real server before going live. Share the link with your team for review. Catches issues that only appear in production-like environments.
yourapp.comThe live app your users see. Deploy here after completing a sprint or release. Contains only tested, approved code. Rollback quickly if something breaks.
Use separate databases and API keys for each environment. Never share production credentials.