How taranjyots/portfolio works
Project Type and Purpose
• Type: Full-stack web application (personal portfolio)
• Frontend: React SPA (create-react-app + shadcn/ui + Tailwind)
• Backend: Python web service (likely Flask or FastAPI)
• Database: Relational (configured via backend/.env)
• Purpose: Serve static content (About, Projects, Contact) and dynamic API endpoints for form submissions and data seeding.
Main Components
a. Client Browser (User)
b. CDN / Static File Host (optional) – serves build/compiled React assets
c. Frontend Application
– React components (pages, UI primitives, contexts, hooks, services/api.js)
– Environment config (.env, tailwind.config.js, craco.config.js)
d. Backend Application
– server.py (HTTP API endpoints)
– database.py (DB connection)
– models.py (ORM models)
– seed_data.py (initial data population)
– backend/.env (DB credentials, secrets)
e. Database
– PostgreSQL/MySQL/SQLite (as specified in .env)
f. External Services (if any)
– Email service for contact form (SMTP or third-party)
– Analytics or CDN providers
Relationships and Data Flows
1. Client Browser → (1) HTTP GET / → CDN → index.html + JS bundles
2. React App in Browser → (2) fetch(‘/api/projects’) → Backend
3. Backend server.py → (3) Query via database.py/models.py → Database
4. Database → (4) Result → Backend → (5) JSON response → Frontend
5. Frontend → (6) POST /api/contact → Backend → (7) Send email or store data → Response
6. seed_data.py (offline) → (8) Writes initial records → Database
Architectural Patterns & Principles
• Separation of concerns: UI layer (React) vs. business logic (Python API) vs. persistence (DB).
• MVC-like in backend: models.py (Model), server.py (Controller), responses (View).
• Component-driven UI with context providers/hooks for state management.
• Environment isolation via .env files in both frontend/backend.
Final Checklist
– [ ] Client browser and static asset host
– [ ] React SPA (split into UI components, contexts, hooks, services)
– [ ] Backend service (server.py, models, DB connector)
– [ ] Database (with credentials from .env)
– [ ] External services (email, analytics)
– [ ] Deployment annotations (optional: Docker, CI/CD, hosting)