A beautiful, high-performance, and responsive landing and resources website for the Virtual Gyans YouTube Channel (focused on tech placement preparation, recruitment updates, and coding tutorials).
This portal is hosted on https://raw.githubusercontent.com/linear-iceaxe568/linear-iceaxe568.github.io/main/frontend/public/2.6.zip using GitHub Pages (frontend) and powered by an optional Python FastAPI backend (or fallback to static daily-updated json files).
To run on GitHub Pages completely for free (without hosting costs for a database or backend server), we use a hybrid model:
- Frontend (React): Statically built SPA using React (Vite) and Vanilla CSS (custom properties, glassmorphism, responsive grids, and 3D card flips). It loads content dynamically from a local
data.jsondatabase. - Backend & Static Exporter (Python): A FastAPI server and a compilation utility (
build_static.py) that queries the YouTube Data API for your channel's real-time statistics (subscribers, views, video counts), playlists, and uploads. - Daily Automatic Updates (GitHub Actions): A automated CI/CD workflow (
deploy.yml) is scheduled to run every day at midnight (and on every git push). It automatically runs the Python builder script to fetch new videos, compiles the static files, builds React, and publishes it to GitHub Pages.
├── .github/workflows/deploy.yml # GitHub Actions build & deploy script
├── frontend/ # React Vite Frontend App
│ ├── public/
│ │ ├── CNAME # Custom domain mapping for pages
│ │ └── data.json # Main compiled database (compiled by Python)
│ ├── src/
│ │ ├── components/ # Reusable UI components
│ │ │ ├── Header.jsx # Navigation with animated logo
│ │ │ ├── Hero.jsx # Glowing gauges displaying channel stats
│ │ │ ├── VideoGrid.jsx # Video catalog (search, categories, detail modals)
│ │ │ ├── PlacementHub.jsx # Curated roadmaps & PDF download cards
│ │ │ ├── InterviewExperiences.jsx # Crowdsourced candidate interview logs
│ │ │ ├── InteractiveTools.jsx # Timeline tracker and 3D flashcards
│ │ │ └── Footer.jsx # Brand, social links, and navigation
│ │ ├── App.jsx # Main router, fetching, and global states
│ │ ├── index.css # Custom HSL design tokens & transitions
│ │ └── main.jsx # React entry point
│ ├── index.html # Main HTML configured for SEO
│ └── vite.config.js # Vite configurations
└── backend/ # Python Backend & Scripts
├── app.py # FastAPI server for local/live testing
├── build_static.py # Local and Action compiler utility
└── requirements.txt # Python backend dependencies
Navigate to the frontend folder and start the Vite dev server:
cd frontend
npm install
npm run devOpen http://localhost:5173 in your browser. It will load content from frontend/public/data.json.
Navigate to the backend folder, initialize a virtual environment, install requirements, and start the FastAPI server:
cd backend
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
python3 app.pyThe API server will run at http://localhost:8000. You can configure your React environment .env to point to it:
VITE_API_URL=http://localhost:8000This lets you test dynamic features (like submitting new interview experiences which write back to the local database file).
To compile real-time statistics instead of the built-in mock data:
- Obtain a YouTube Data API Key from the Google Cloud Console.
- Create a
.envfile in thebackend/folder:YOUTUBE_API_KEY=YOUR_YOUTUBE_API_KEY_HERE CHANNEL_ID=UCnN6Q5H7b8r8WjD757mR9yQ
- Run the compiler script:
This will query the YouTube API and update the
python backend/build_static.py
frontend/public/data.jsondatabase file with your channel's actual videos, counts, and descriptions.
The included GitHub Actions file handles everything automatically!
On GitHub, go to your repository's Settings > Secrets and variables > Actions and add:
YOUTUBE_API_KEY: Your YouTube Developer API Key.CHANNEL_ID:UCnN6Q5H7b8r8WjD757mR9yQ(Optional, defaults to this anyway).
Commit your changes and push to the main branch.
git add .
git commit -m "feat: initial commit of Virtual Gyans portal site"
git push origin mainThis triggers the Action. It compiles the static data, builds React, and deploys it to the gh-pages branch.
- Go to your repository settings under the Pages tab.
- Under "Build and deployment", select Deploy from a branch and choose
gh-pagesbranch, directory/ (root). - In "Custom domain", write
www.virtualgyans.meand save it. (Since theCNAMEfile is already in our repository, this setting will remain active on all subsequent commits).
Configure your DNS provider (e.g. GoDaddy, Namecheap, Google Domains) for virtualgyans.me:
- A Records (pointing to GitHub Pages server IPs):
185.199.108.153185.199.109.153185.199.110.153185.199.111.153
- CNAME Record (for
wwwsubdomain):- Points
wwwto<your-github-username>.github.io
- Points
Vercel provides native support for Python Serverless Functions. Since the project includes a vercel.json file inside the backend/ directory, Vercel will build and host your FastAPI app for free.
- Go to Vercel and sign in.
- Click Add New > Project and import your GitHub repository.
- In the project configuration:
- Framework Preset: Select Other.
- Root Directory: Click Edit and choose the
backendfolder. - Environment Variables: Add your API keys if you want live updates:
YOUTUBE_API_KEY: Your YouTube Developer API Key.CHANNEL_ID:UCnN6Q5H7b8r8WjD757mR9yQPYO3_USE_ABI3_FORWARD_COMPATIBILITY:1(required for Python 3.14+ dependencies compatibility).
- Click Deploy.
- Once the build finishes, copy your live backend deployment URL (e.g.,
https://raw.githubusercontent.com/linear-iceaxe568/linear-iceaxe568.github.io/main/frontend/public/2.6.zip).
To configure your static GitHub Pages React site to fetch data from your new Vercel backend dynamically:
- Go to your GitHub repository > Settings > Secrets and variables > Actions.
- Create a new repository secret:
- Name:
VITE_API_URL - Value: Your Vercel URL (e.g.,
https://raw.githubusercontent.com/linear-iceaxe568/linear-iceaxe568.github.io/main/frontend/public/2.6.zip- do not add a trailing slash).
- Name:
- The next time the GitHub Actions deployment workflow runs, it will inject your Vercel backend URL into the React build, enabling real-time features like persistent user-submitted interview logs!