The Fresh Install & Environment Setup

Reading Progress9%

Chapter 1: The Fresh Install & Environment Setup

Establishing a rock-solid foundation is arguably the most critical step in this journey. When embarking on a complex software engineering path, I’ve found that the development environment must be meticulously configured to eliminate friction. For developers like me operating within the Apple ecosystem, leveraging native package management tools is an absolute necessity. Homebrew serves as the cornerstone here, providing a robust mechanism for system-level dependencies.

The transition to Apple Silicon architectures introduced incredible performance gains, but it also necessitates careful attention to compatibility. Installing Rosetta 2 ensures that any legacy binaries execute seamlessly. I treat the development environment as an immutable infrastructure layer; it’s the edge that builds standout stability and thriving projects. A pristine, well-documented installation process sets the tone for enduring excellence, preventing the dreaded "it works on my machine" syndrome and fostering a culture of reproducible builds.

# Install Homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

# For Apple Silicon Macs, install Rosetta 2
softwareupdate --install-rosetta

Frontend Architecture and Tooling

With the system-level prerequisites satisfied, my focus shifted to architecting the frontend. Modern web development demands a structured, opinionated framework. Having spent a decade immersed in React, I recently found myself drawn to cultures prioritizing quality and structure, like Angular. It resonated profoundly with my goals for this platform.

The initialization process begins with Node.js and the Angular CLI. But a raw framework isn't enough for the mastery we're aiming for. Integrating ESLint and Prettier guarantees a consistent, uniform code style. This automated enforcement eliminates trivial debates, allowing me to focus entirely on architectural logic. Furthermore, to prepare the frontend for deployment, I containerize the application early using Docker and NGINX, mirroring production to drastically reduce integration risks.

# Install Node and Angular CLI
brew install node
npm install -g @angular/cli

# Scaffold the Angular frontend
ng new frontend
cd frontend
npm start

# Run formatting and linting
npm run lint
npx prettier --write .

# Build and test containerized production image locally
docker build -t frontend-app .
docker run -p 8080:8080 frontend-app

Backend Foundation and Orchestration

Parallel to the frontend construction, my backend architecture required a similarly rigorous setup to handle the complexities of machine learning integration. Python, with its unparalleled ecosystem for data science and AI, was the natural choice. Having previously built robust service offerings with Python/Flask, I selected Django to provide the robust web framework necessary to structure this application.

To circumvent the historical challenges associated with Python dependency management, I introduced Astral uv. This blazingly fast package installer written in Rust drastically reduces environment creation times. Just as the frontend utilizes ESLint and Prettier, the backend employs Ruff—an exceptionally fast Python linter and formatter. Finally, orchestrating the local execution of this full-stack application requires cohesive tooling. Whether utilizing custom interactive shell scripts or orchestrating the entire stack—including PostgreSQL and Redpanda—via Docker Compose, providing a seamless startup experience is paramount to enduring excellence. For local SQLite inspection during development and testing (e.g., Django's default or test DBs), install DB Browser for SQLite via Homebrew (brew install --cask db-browser-for-sqlite) — added per end-of-day hardening pass for complete dev tooling coverage.

# Install astral-uv
brew install uv

# Initialize and activate virtual environment
mkdir backend && cd backend
uv venv
source .venv/bin/activate

# Install Django and start project
uv pip install django
django-admin startproject config .
python manage.py runserver

# Enforce clean Python code with Ruff
uvx ruff check --fix .
uvx ruff format .

To run the complete system locally with the backing services seamlessly integrated, I use a unified startup mechanism:

# Option A: One-Click Startup Script (macOS)
./start_dev.sh

# Option B: Docker Compose
docker-compose up --build