Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

9 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸŽ“ SYJ EDUCATE

An open-source engineering education engine β€” real, tested, working code instead of isolated tutorials.

Eight learning tracks. Three full applied examples. 151 passing tests. Zero mockups.

License: MIT Python Tests Tracks Applied Examples Termux Ready PRs Welcome

Every claim on this page is backed by a real test run or a real live demo β€” not marketing copy. See Verification Philosophy below.

Quick Start β€’ Features β€’ Architecture β€’ Tracks β€’ Applied Examples β€’ Termux / Android β€’ Roadmap


🎬 See It Run

Every clip below is a genuine recording of real commands against real, running code in this repository β€” captured while building it, not staged afterward.

DNS reconnaissance, live, against a real domain
The osint/ track resolving real records in real time β€” no mocked responses.

OSINT DNS reconnaissance demo

The full test suite, run fresh
151 tests across 8 tracks passing from a clean install β€” no cached state.

Full test suite passing

A real recorded uptime incident
The automation/ track catching and logging a genuine HTTP failure β€” not a fabricated demo.

Automation incident demo

Sales pipeline reporting, hand-verified
The small-business-crm/ example's win-rate math, checked against the source data.

CRM pipeline report demo


✨ Key Features

  • 🧩 Eight complete learning tracks β€” backend, database, frontend, AI, security, OSINT, automation, and applied examples, each buildable and testable in isolation
  • βœ… 151 passing tests, verified from a clean install β€” no cached state, no "works on my machine"
  • πŸ–₯️ Live-verified, not just unit-tested β€” real servers started, real HTTP requests sent, real responses checked against real domains and real endpoints
  • πŸ› Real bugs, documented in the open β€” a path-traversal exploit, an operator-precedence bug, a broken test-isolation hook β€” each written up with cause and fix, not swept under the rug
  • πŸ€– Local-first AI β€” Ollama, Qwen, and DeepSeek by default; no dependency on closed-source APIs
  • πŸ“± Termux / Android-aware β€” dependency choices and setup docs account for constrained mobile environments from day one
  • 🏭 Three full applied examples β€” restaurant ordering, livestock tracking, and a small-business CRM, each combining multiple tracks into one working product
  • πŸ”“ MIT licensed β€” fork it, teach with it, ship it

🎯 Why This Repository Is Different

Most example repositories show code that looks correct. This one is held to a stricter bar:

  • Every track has a real test suite that passes from a fresh install, not just in one developer's already-configured environment.
  • Most tracks were also live-verified, not just unit-tested: a real backend server started, real HTTP requests sent, real responses checked by hand against expected values.
  • Real bugs were found and documented, not hidden. A path-traversal vulnerability in a file-upload endpoint. A Python operator-precedence bug that silently dropped a function argument. A FastAPI startup hook that broke test isolation. Each is written up β€” what it was, how it was caught, how it was fixed β€” in the relevant track's docs/ARCHITECTURE.md or security/reviews/.
  • Limitations are stated, not glossed over. Where something wasn't (or couldn't be) fully verified in the environment this was built in β€” WHOIS lookups needing a network port that's often firewalled, PostgreSQL not being available to test against everywhere β€” that's written down explicitly instead of implied to work.

πŸ—οΈ Architecture

The diagrams below are pattern/lineage maps, not literal shared code β€” livestock-tracker/ and small-business-crm/, for example, reuse the patterns backend/ and database/ establish, implemented independently, not by importing those tracks' code.

Applied Example Request Flow

The pattern every applied example (restaurant-ordering/, livestock-tracker/, small-business-crm/) follows, end to end:

flowchart TD
    A["Client<br/>Browser / Mobile"] -->|HTTP Request| B["FastAPI Backend"]
    B --> C{"Authenticated<br/>Route?"}
    C -->|Yes| D["JWT Verification"]
    C -->|No| E["Public Handler"]
    D --> F["Business Logic<br/>State Machine + Validation"]
    E --> F
    F --> G[("SQLite / PostgreSQL<br/>via SQLAlchemy")]
    G --> F
    F --> H["JSON Response"]
    H --> A
Loading

Component Overview

How a single track β€” client, runtime, and storage β€” fits together:

flowchart TB
    subgraph Client["πŸ–₯️ Client"]
        A["Vanilla JS Frontend<br/>Fetch API, no build step"]
    end
    subgraph Runtime["βš™οΈ Runtime"]
        B["FastAPI App<br/>app/main.py"]
        C["SQLAlchemy Models<br/>app/models.py"]
        D["Alembic Migrations"]
    end
    subgraph Storage["πŸ’Ύ Storage"]
        E[("SQLite (dev)<br/>PostgreSQL (prod)")]
    end
    A -->|"REST / JSON"| B
    B --> C
    C --> E
    D --> E
Loading

Tracks β†’ Applied Examples

How the eight standalone tracks combine to produce the three full applications (a track box with no arrow out β€” ai, security, osint, automation β€” is a complete, independently runnable track that simply hasn't been folded into an applied example yet):

flowchart LR
    subgraph Tracks
        T1["backend"]
        T2["database"]
        T3["frontend"]
        T4["ai"]
        T5["security"]
        T6["osint"]
        T7["automation"]
    end
    subgraph Examples["Applied Examples"]
        E1["restaurant-ordering"]
        E2["livestock-tracker"]
        E3["small-business-crm"]
    end
    T1 --> E1
    T2 --> E1
    T3 --> E1
    T1 --> E2
    T2 --> E2
    T1 --> E3
    T2 --> E3
Loading

πŸ“š Learning Tracks

Track Focus Tests Status
backend/ Python, FastAPI, JWT auth, REST APIs, async, middleware 28 βœ…
database/ SQLAlchemy 2.0, real Alembic migrations, indexing, SQLite β†’ PostgreSQL 10 βœ…
frontend/ Vanilla HTML/CSS/JS, Fetch API, responsive design, PWA offline shell β€” βœ…
ai/ Local AI via Ollama, RAG pipeline, no proprietary API dependency 11 βœ…
security/ OWASP-style review of backend/, threat modeling, secrets management β€” βœ…
osint/ DNS/WHOIS/subdomain recon, email spoofing analysis β€” defensive use only 23 βœ…
automation/ URL uptime monitoring: web automation, scheduling, reporting 16 βœ…
examples/ Industry-inspired full applications combining the tracks above 63 βœ…

🏭 Applied Examples

Real, multi-part applications that combine several tracks against one domain:

Example Industry Demonstrates Tests
restaurant-ordering/ Restaurants / Cloud Kitchens Public + authenticated access on one API, an order-status state machine, CORS, full frontend 21
livestock-tracker/ Agriculture Cumulative-constraint validation, real feed-conversion-ratio math 20
small-business-crm/ Small Business / SaaS A validated sales-pipeline state machine, win-rate and time-to-close reporting 22

πŸ—‚οΈ Repository Structure

syj-educate/
β”œβ”€β”€ ai/                        Local AI (Ollama) + RAG β€” FastAPI, 11 tests
β”œβ”€β”€ backend/                   JWT-auth REST API β€” FastAPI + SQLite, 28 tests
β”œβ”€β”€ database/                  SQLAlchemy ORM + real Alembic migrations, 10 tests
β”œβ”€β”€ frontend/                  Vanilla JS + PWA, consumes backend/
β”œβ”€β”€ security/                  OWASP review of backend/, threat model, secrets tools
β”œβ”€β”€ osint/                     DNS/WHOIS/subdomain/email analysis, 23 tests
β”œβ”€β”€ automation/                Site Watch: uptime monitor + scheduler, 16 tests
β”œβ”€β”€ examples/
β”‚   β”œβ”€β”€ restaurant-ordering/   backend + database + frontend together, 21 tests
β”‚   β”œβ”€β”€ livestock-tracker/     Agriculture batch tracking, 20 tests
β”‚   └── small-business-crm/    Sales pipeline CRM, 22 tests
β”œβ”€β”€ docs/
β”‚   └── ROADMAP.md             Build history and what's next
β”œβ”€β”€ assets/                    Demo GIFs (this README's screenshots)
β”œβ”€β”€ setup.sh                   Base environment bootstrap
└── LICENSE                    MIT

Every track is self-contained β€” its own requirements.txt, virtual environment, and tests. There's no single shared dependency list to keep in sync; that's a deliberate choice, documented in each track's docs/ARCHITECTURE.md.


πŸš€ Quick Start

Prerequisites

Requirement Needed For Check
Python 3.9+ Every track python3 --version
pip + venv Every track python3 -m venv --help
Git Cloning the repo git --version
Ollama ai/ track only ollama --version
Node.js (optional) Nothing β€” all frontends are build-step-free node --version

If python3 -m venv --help fails on Debian/Ubuntu, install it first: sudo apt install python3-venv. On Termux, see the dedicated section below before you start.

1. Clone and bootstrap

git clone https://github.com/SHalimoosavi/syj-educate.git
cd syj-educate
./setup.sh

setup.sh checks for a working Python 3.9+ toolchain, creates a base virtual environment, and installs shared dev tooling (pytest, black, ruff). It does not install every track's dependencies β€” each track manages its own, so you only install what you're actually going to run.

2. Pick a track and follow its own quick start

Expand whichever track you want to run:

πŸ”§ backend/ β€” JWT-authenticated REST API
cd backend
python3 -m venv .venv
.venv/bin/pip install -r requirements.txt
cp .env.example .env

# Generate a real secret key instead of using the placeholder:
python3 -c "import secrets; print(secrets.token_hex(32))"
# β†’ paste the result into .env as SECRET_KEY=...

.venv/bin/uvicorn app.main:app --reload
# API docs: http://localhost:8000/docs

πŸ“– Full guide: backend/docs/SETUP.md

πŸ—„οΈ database/ β€” SQLAlchemy + real Alembic migrations
cd database
python3 -m venv .venv
.venv/bin/pip install -r requirements.txt
cp .env.example .env
.venv/bin/alembic upgrade head
.venv/bin/python -m scripts.seed

πŸ“– Full guide: database/docs/SETUP.md

🌐 frontend/ β€” consumes backend/, no build step
# Terminal 1 β€” start backend/ first (see above)

# Terminal 2
cd frontend
python3 -m http.server 8080
# Open http://localhost:8080/index.html

πŸ“– Full guide: frontend/docs/SETUP.md

πŸ€– ai/ β€” local AI with Ollama + RAG
# Install Ollama separately, then:
ollama serve
ollama pull qwen2.5:7b
ollama pull nomic-embed-text

cd ai
python3 -m venv .venv
.venv/bin/pip install -r requirements.txt
.venv/bin/python -m scripts.ingest
.venv/bin/uvicorn app.main:app --reload

πŸ“– Full guide: ai/docs/SETUP.md

πŸ•΅οΈ osint/ β€” DNS, WHOIS, subdomain, and email analysis

⚠️ Read osint/docs/ETHICS.md first β€” every tool here is for domains and infrastructure you own or are authorized to assess.

cd osint
python3 -m venv .venv
.venv/bin/pip install -r requirements.txt

.venv/bin/python cli.py dns yourdomain.com
.venv/bin/python cli.py email fixtures/sample_suspicious.eml

πŸ“– Full guide: osint/docs/SETUP.md

πŸ“‘ automation/ β€” Site Watch (URL uptime monitor)
cd automation
python3 -m venv .venv
.venv/bin/pip install -r requirements.txt
.venv/bin/python cli.py check-all urls.example.txt
.venv/bin/python cli.py report

πŸ“– Full guide: automation/docs/SETUP.md

🍽️ examples/restaurant-ordering/ β€” full-stack applied example
cd examples/restaurant-ordering/backend
python3 -m venv .venv
.venv/bin/pip install -r requirements.txt
.venv/bin/alembic upgrade head
.venv/bin/python -m scripts.seed
.venv/bin/uvicorn app.main:app --reload

# Second terminal:
cd examples/restaurant-ordering/frontend
python3 -m http.server 8080
# Customer view: http://localhost:8080/customer.html
# Staff/kitchen view: http://localhost:8080/staff.html (admin / changeme123)

πŸ“– Full guide: examples/restaurant-ordering/README.md

πŸ„ examples/livestock-tracker/ & πŸ“ˆ examples/small-business-crm/

Same pattern for both:

cd examples/livestock-tracker   # or examples/small-business-crm
python3 -m venv .venv
.venv/bin/pip install -r requirements.txt
.venv/bin/python -m scripts.init_db
.venv/bin/uvicorn app.main:app --reload

πŸ“– Guides: livestock-tracker/docs/SETUP.md Β· small-business-crm/docs/SETUP.md

Troubleshooting

Problem Likely Cause Fix
python3: command not found Python isn't installed, or is aliased to python Try python --version; if that works, use python in place of python3 throughout
ModuleNotFoundError after install The virtual environment isn't activated, or the wrong one is Confirm you're running .venv/bin/python/.venv/bin/pip, not a global install
Address already in use on port 8000/8080 Another process (maybe a previous run) is still bound to it Stop the old process, or run with --port 8001 and adjust the URL you open
pip install fails building a C extension Missing build tools (common on Termux/minimal Linux) Install a compiler toolchain (pkg install clang make on Termux, apt install build-essential on Debian/Ubuntu) β€” see Termux notes
CORS error in the browser console (frontend tracks) The backend's CORS_ORIGINS doesn't include the origin you're serving the frontend from Check that track's .env β€” defaults match the exact commands in this README

πŸ§ͺ Running the Tests

Every track follows the same pattern:

cd <track-directory>
python3 -m venv .venv
.venv/bin/pip install -r requirements.txt
.venv/bin/python -m pytest -v

πŸ“± Running on Termux (Android)

This project is developed with constrained mobile environments in mind β€” SQLite over a heavier database, raw Python over native-extension-heavy libraries where reasonable, and dependency-injected clients throughout are partly a reflection of that. A few things to know if you're running this on Termux:

  • Base tools β€” pkg install python git gets you Python 3, pip, and venv. If any dependency needs to compile a C extension, also run pkg install clang make.
  • uvicorn[standard] β€” the [standard] extra pulls in uvloop and httptools, both C extensions without reliable prebuilt Termux wheels. If installation stalls or fails, drop the extra: pip install uvicorn. It falls back to the pure-Python asyncio loop, which works fine for local development.
  • database/'s PostgreSQL path β€” psycopg[binary] may not have a prebuilt Termux wheel either. The pure-Python pg8000 driver is a drop-in alternative for testing the Postgres connection string; the SQLite path (the default) needs nothing special.
  • Alembic, SQLAlchemy, FastAPI, Pydantic, httpx, dnspython β€” all pure Python or ship broad wheel support, so these install without issue.
  • Frontends β€” deliberately framework-free with no build step, so Node/npm isn't required to run them; Python's own http.server is enough. pkg install nodejs works if you want Node for something else.
  • Long-running processes β€” automation/'s watch command (or any dev server) can get suspended when Termux loses foreground focus. Run termux-wake-lock first, or prefer the check-all + Termux:Boot/cron pattern in automation/docs/SETUP.md for background use.
  • Networking β€” binding to localhost/127.0.0.1 on ports 8000/8080 works the same as anywhere else; no Termux-specific networking setup needed.

None of this is guaranteed for every Termux version or device β€” if something above is out of date, please open an issue with what you found.


πŸ”’ Security

The backend/ track went through a dedicated OWASP-style review: 13 findings, 7 fixed in code β€” including a genuinely exploitable path-traversal vulnerability in a file-upload endpoint, found by reading the code and confirmed fixed by actually attempting the exploit against a live running server, not just asserting on a mock.

If you find a security issue in this repository, please open an issue describing it. This is a learning project, not a monitored production service, so there's no formal disclosure program β€” but reports are genuinely welcome.


🧠 AI Philosophy

AI features in this project default to open-source, locally runnable models β€” Ollama, Qwen, DeepSeek β€” rather than closed-source APIs. Where a proprietary API would normally be used, an open-source alternative is documented alongside it instead.


πŸ—ΊοΈ Roadmap

See docs/ROADMAP.md for build history, what's implemented, and what's planned next β€” currently: further applied examples covering logistics, retail, healthcare intake, and education.


🀝 Contributing

Issues and pull requests are welcome. If you're adding a track or applied example, the established pattern is:

  1. βœ… Real tests
  2. πŸ“„ A docs/ARCHITECTURE.md explaining why each non-obvious decision was made
  3. πŸ”¬ Verification against a real running instance where practical, not just mocks

Look at any existing track's docs/ folder for the shape this takes.


πŸ“„ License

MIT β€” see LICENSE.


πŸ‘€ Author

Syed Ali Hasan Moosavi (@SHalimoosavi)

Founder & Managing Director, Sayanjali Nexus Private Limited

🌐 Portfolio: shalimoosavi.github.io/moosavi

About

SYJ EDUCATE is an open-source software engineering learning platform that teaches modern backend development, AI engineering, cybersecurity, OSINT, automation, SaaS architecture, and real-world application development through production-quality projects powered by open-source AI.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages