Nahj AI Assistant

How can I help you today?

Ask me anything about software development

Quick start ideas

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

project/
frontend/
src/
package.json
backend/
src/
package.json
shared/
types/
utils/
package.json
turbo.json

Keep frontend, backend, and shared code in a single repository for easier maintenance and deployment.

Benefits
  • Shared types and utilities
  • Atomic commits across packages
  • Simplified dependency management

Environment Variables

Manage configuration across different environments securely.

Environment Files
  • .env: Local development (git ignored)
  • .env.example: Template for required variables (committed)
  • Use platform secrets for production (Railway, Render, etc.)
Keep Keys Out of Git
Avoid
Never commit .env files with real keys to git.

Version Control

Git best practices for team collaboration.

Branching Strategy
  • main: Production-ready code
  • develop: Integration branch for features
  • feature/*: Individual feature branches
Commit Messages
Use conventional commits: feat:, fix:, docs:, refactor:, test:

GitHub Workflow

Leverage GitHub features for better collaboration and automation.

Pull Requests
Always use PRs for code changes. Enable required reviews and status checks before merging.
GitHub Actions(Optional)
Automate testing, linting, and deployments. Run CI on every push and PR. Using it early helps you learn best practices.
Issues & Projects(Optional)
Track bugs and features with Issues. Use Projects for sprint planning and roadmaps. Useful for organizing your work even in solo projects.
Branch Protection(Optional)
Protect main branch: require PR reviews, passing CI, and up-to-date branches. Useful for learning even in solo projects.

Environments

Separate environments for different stages of development.

Development
localhost:3000

Where you build new features, fix bugs, and experiment freely. Run your app locally with mock data and test services.

Staging
staging.yourapp.com

Test 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.

Production
yourapp.com

The 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.