How omkarok2510/omkar_portfolio works
Project Type and Purpose
• This is a single‐page React application (Create React App) used to generate a developer portfolio site. It runs entirely in the browser as a static SPA but fetches dynamic data (GitHub repos, Medium posts, Twitter timeline) at runtime. It also includes a Dockerfile and GitHub Actions workflows for CI/CD and deployment to GitHub Pages or Netlify.
File Structure
• Top‐level files & folders:
• Dockerfile – containerizes the build & serve process
• .github/workflows – CI/CD definitions (deploy, prettier checks)
• public/ – static HTML, manifest, robots.txt
• src/ – all React code
– components/ – reusable UI widgets (buttons, cards, toggles)
– containers/ – page‐level composites (About, Blogs, Contact, etc.)
– contexts/ – React Context for theming (StyleContext)
– hooks/ – custom hooks (useLocalStorage)
– assets/ – fonts, images, Lottie animations
– serviceWorker.js, setupTests.js – CRA support files
• Configuration: .env for API tokens, .prettierrc, .github workflows.
README for Insights
• Project description: customizable, themeable portfolio; dynamic GitHub, Medium, Twitter integration.
• Deployment: supports Docker, GitHub Actions, GH Pages, Netlify.
• Tech Stack: React, SCSS, Apollo GraphQL (github), react-twitter-embed, Lottie.
Main Components & Their Relationships
a. Frontend SPA (User’s Browser)
• React App (App.js) renders containers & components.
• Custom hook (useLocalStorage) persists dark/light mode.
b. Data Layer & External Services
• GitHub GraphQL API (via fetch.js or apollo-boost) → pinned repos, profile, contributions
• Medium (via REST fetch) → latest blog posts
• Twitter Embed → live Twitter timeline widget
c. Static Asset Store
• Served from public/ and compiled into build (images, Lottie, fonts)
d. Build & CI/CD Pipeline
• Source repository on GitHub
• GitHub Actions workflows
• prettier.yml → lint & format check
• deploy.yml → builds Docker image, runs npm build, publishes to GH Pages or pushes to Netlify
• Docker build (Dockerfile) → containerizes npm install & npm run build / serve -s build
• Deployment target: GitHub Pages CDN or Netlify CDN
Architectural Patterns & Design Principles
• Component‐based UI: small, reusable, stateless/stately React components
• Container/presentation separation: containers orchestrate business logic, components handle rendering
• Context API for cross‐cutting concerns (theme)
• Single GraphQL client for GitHub data
• Single SPA served statically (no backend server beyond static host)
Essential Elements
• Labels: React App, StyleContext, useLocalStorage, Containers, Components