Skip to content

hoprodev/pybiz

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

#PyBiz-001 — Python-to-Production (micro-projects ladder)

You and I are going to learn by shipping. Each rung is a tiny, useful business tool you can deploy the same day. I’ll teach top-down (what/why/how/when), keep cognitive load low, and bake in spaced repetition + active recall so you lock skills fast.

Below is the curriculum (beginner → advanced) and, right after, I’m giving you Project 1 as a ready-to-run, production-deployable repo you can download now.


Ladder of 12 micro-projects (each is shippable)

Beginner → Intermediate

  1. #PBA-001 ROI API — FastAPI service that computes rental property ROI (cap rate, cash-on-cash). Deploy on Render (free) with Docker + CI.
  2. #PBA-002 Lead Scraper — Requests/Playwright scraper that collects local SMB leads (category + city) and emails you a CSV daily via GitHub Actions.
  3. #PBA-003 Price Watcher — Monitors product prices, alerts on drops (webhook/Telegram). Adds retries, logging, and simple SQLLite.
  4. #PBA-004 Invoice Maker — Flask + Jinja templates, generates branded PDFs and emails them via SendGrid.
  5. #PBA-005 Contact CRM API — FastAPI + Postgres + SQLModel; CRUD contacts, tags, notes; JWT auth; deployed to Railway.

Intermediate → Advanced 6) #PBA-006 Booking Micro-SaaS — Django + Stripe test mode; calendar slots, email confirmations, admin dashboard; one-click deploy. 7) #PBA-007 ETL to Dashboard — Ingest CSV/Google Sheets → clean → store in Postgres → serve metrics via a small Dash/Plotly app. 8) #PBA-008 Forecast Service — Statsmodels/Prophet microservice forecasting monthly revenue; scheduled retrains; exposes /predict. 9) #PBA-009 LLM Triage — Streamlit app that drafts replies to customer emails and classifies urgency; OpenAI/Anthropic API, human-in-the-loop. 10) #PBA-010 RPA Form Filler — Playwright automation that submits routine vendor forms; secrets via GitHub Actions; audit logs. 11) #PBA-011 Observability Pack — Sentry + structured logging + health checks + uptime monitor for all micro-services. 12) #PBA-012 Multi-Tenant Patterns — Django/FastAPI tenant isolation, separate Postgres schemas, role-based permissions, background jobs.

Why this ladder works: each step maps to a real SMB need (lead-gen, billing, pricing, bookings, dashboards, forecasts, replies, automation). You’ll touch HTTP, data, async, Docker, CI/CD, auth, payments, jobs, and monitoring—everything that makes code “production.”


Neuro-optimized learning loop (built into every project)

  • Active recall: 5 quick Qs at the end of each project (“explain to a 12-year-old…”, “draw the request flow…”, “what breaks first in prod?”).
  • Interleaving: mix HTTP, data, tests, and deploy each time (small surface, repeated often).
  • Spaced repetition: we recycle the same patterns (env vars, Dockerfiles, health checks, CI) so they become muscle memory.
  • Feynman: you’ll teach each project in a 60-second Loom to your “future teammate” (you). Script outline included.

Project 1 is ready now: #PBA-001 ROI API (FastAPI + Docker + CI + Render)

Job-to-be-done: a simple ROI calculator your phone or spreadsheet can call—use it in deal screens, sharable with clients, and embeddable in your future apps.

What you’ll learn (essentials):

  • FastAPI request/response modeling with Pydantic v2
  • Mortgage math (amortization) and core RE metrics (NOI, cap, CoC)
  • Health checks, tests (pytest), Docker image, Render deployment
  • CI via GitHub Actions (runs tests on push/PR)

Download the starter repo (zip): Download #PBA-001 ROI API

Endpoints

  • GET /health{"status":"ok"}
  • POST /roi → metrics from: price, rent_monthly, expenses_monthly, down_payment, interest_rate_annual, term_years

Local run

pip install -r requirements.txt
uvicorn app.main:app --reload
# open http://127.0.0.1:8000/docs

Docker run

docker build -t roi-api .
docker run -p 8000:8000 roi-api

Deploy (Render free tier)

  1. Create a new public GitHub repo and push the unzipped folder.
  2. On render.com: New → Web Service → connect the repo (it detects render.yaml and builds Docker).
  3. Grab the URL: https://<your-app>.onrender.com/health.

CI included .github/workflows/ci.yml runs pytest on every push/PR to keep you honest.

Quick test payload

{
  "price": 200000,
  "rent_monthly": 1600,
  "expenses_monthly": 450,
  "down_payment": 40000,
  "interest_rate_annual": 3.8,
  "term_years": 30
}

60-day mastery plan (top 2%)

  • Weeks 1–2: Ship #PBA-001 → #PBA-003. Same deploy pattern each time (tests, Docker, Render).
  • Weeks 3–4: Ship #PBA-004 → #PBA-006. Add auth, payments, emails.
  • Weeks 5–6: Ship #PBA-007 → #PBA-009. Data pipelines, forecasting, LLMs.
  • Week 7: Ship #PBA-010 and add observability across everything (#PBA-011).
  • Week 8: Do #PBA-012 multi-tenant patterns and refactor weakest service.

Weekly cadence

  • Mon: Design & skeleton
  • Tue: Core feature
  • Wed: Tests & CI
  • Thu: Docker & deploy
  • Fri: Observability + “Demo Friday” (record a 2-min Loom)
  • Sat: Refactor & write a 200-word “Feynman” explanation
  • Sun: Rest / spaced review flashcards

Active-recall for #PBA-001 (answer aloud)

  1. What’s the difference between cap rate and cash-on-cash ROI?
  2. In deployment, where do you store secrets and why?
  3. What causes a non-finite result in the API, and how did we guard against it?
  4. Sketch the request flow: client → FastAPI → Pydantic validation → compute → response.
  5. If you doubled expenses, which output changes most and why?

Your next move (fastest path)

  • Unzip the repo, run it locally, hit /docs and try the sample payload.
  • Create a public GitHub repo and deploy to Render with the included Dockerfile + render.yaml.
  • Ping me the live URL; I’ll review perf, logging, and error handling, then hand you #PBA-002 Lead Scraper pre-scaffolded.

About

No description, website, or topics provided.

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors