Skip to content

Commit c1d198a

Browse files
7oSkaaacursoragent
andcommitted
Add CP Sessions Hub website with GitHub Pages deployment.
Introduces a React/Vite site that parses session READMEs, integrates YouTube content, and auto-deploys to GitHub Pages on push to main. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 4806c0f commit c1d198a

38 files changed

Lines changed: 11256 additions & 0 deletions

.github/workflows/deploy-pages.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- "website/**"
8+
- ".github/workflows/deploy-pages.yml"
9+
- "**/readme.md"
10+
- "**/README.md"
11+
workflow_dispatch:
12+
13+
permissions:
14+
contents: read
15+
pages: write
16+
id-token: write
17+
18+
concurrency:
19+
group: pages
20+
cancel-in-progress: false
21+
22+
jobs:
23+
build:
24+
runs-on: ubuntu-latest
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@v4
28+
29+
- name: Setup Node.js
30+
uses: actions/setup-node@v4
31+
with:
32+
node-version: 20
33+
cache: npm
34+
cache-dependency-path: website/package-lock.json
35+
36+
- name: Install dependencies
37+
working-directory: website
38+
run: npm ci
39+
40+
- name: Build for GitHub Pages
41+
working-directory: website
42+
run: npm run build:pages
43+
44+
- name: Upload artifact
45+
uses: actions/upload-pages-artifact@v3
46+
with:
47+
path: website/dist
48+
49+
deploy:
50+
needs: build
51+
runs-on: ubuntu-latest
52+
environment:
53+
name: github-pages
54+
url: ${{ steps.deployment.outputs.page_url }}
55+
steps:
56+
- name: Deploy to GitHub Pages
57+
id: deployment
58+
uses: actions/deploy-pages@v4

website/.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
website/node_modules/
2+
website/dist/
3+
website/.env
4+
website/.env.*

website/README.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# CP Sessions Hub
2+
3+
A modern website showcasing all Competitive Programming sessions from this repository, integrated with [7oSkaa's YouTube channel](https://www.youtube.com/@7oSkaa/videos).
4+
5+
## Quick Start
6+
7+
```bash
8+
cd website
9+
npm install
10+
npm run dev
11+
```
12+
13+
## Scripts
14+
15+
| Command | Description |
16+
|---------|-------------|
17+
| `npm run dev` | Generate content from READMEs + start dev server |
18+
| `npm run build` | Generate content + production build |
19+
| `npm run generate` | Parse session READMEs and fetch YouTube RSS |
20+
21+
## How It Works
22+
23+
- **`scripts/generate-content.ts`** reads every session folder's README and extracts structured links (videos, problems, articles, sheets).
24+
- YouTube videos are fetched from the channel RSS feed and matched to sessions automatically (with explicit mappings for known sessions).
25+
- The React app consumes `src/data/site-data.json` — no runtime API calls needed.
26+
27+
## Deploy to GitHub Pages
28+
29+
The site deploys automatically on push to `main` via [`.github/workflows/deploy-pages.yml`](../.github/workflows/deploy-pages.yml).
30+
31+
**Live URL:** https://7oSkaaa.github.io/Competitive-Programming-Session-Content/
32+
33+
### One-time GitHub setup
34+
35+
1. Open **Settings → Pages** in the repo on GitHub
36+
2. Under **Build and deployment → Source**, select **GitHub Actions**
37+
3. Push to `main` (or run the workflow manually from the Actions tab)
38+
39+
### Local GitHub Pages build
40+
41+
```bash
42+
npm run build:pages
43+
```
44+
45+
This sets the correct base path (`/Competitive-Programming-Session-Content/`) and adds a `404.html` SPA fallback.
46+
47+
## Deploy elsewhere
48+
49+
```bash
50+
npm run build
51+
```
52+
53+
Deploy `website/dist/` to Vercel or Netlify with base path `/`.
54+
55+
## Project Structure
56+
57+
```
58+
website/
59+
├── scripts/generate-content.ts # Content pipeline
60+
├── src/
61+
│ ├── components/ # Reusable UI
62+
│ ├── pages/ # Route pages
63+
│ ├── lib/utils.ts # Shared helpers
64+
│ ├── types/ # TypeScript types
65+
│ └── data/site-data.json # Generated content
66+
└── public/
67+
```

website/dist/404.html

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" type="image/svg+xml" href="/Competitive-Programming-Session-Content/favicon.svg" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<meta
8+
name="description"
9+
content="Competitive Programming sessions by Ahmed Hossam (7oSkaa) — videos, problems, articles, and resources."
10+
/>
11+
<link rel="preconnect" href="https://fonts.googleapis.com" />
12+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
13+
<link
14+
href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&family=Space+Grotesk:wght@500;600;700&display=swap"
15+
rel="stylesheet"
16+
/>
17+
<title>CP Sessions Hub | 7oSkaa</title>
18+
<script type="module" crossorigin src="/Competitive-Programming-Session-Content/assets/index-DvRzUOwu.js"></script>
19+
<link rel="stylesheet" crossorigin href="/Competitive-Programming-Session-Content/assets/index-D9351ISx.css">
20+
</head>
21+
<body>
22+
<div id="root"></div>
23+
</body>
24+
</html>

website/dist/assets/index-D9351ISx.css

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

website/dist/assets/index-DvRzUOwu.js

Lines changed: 1226 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

website/dist/favicon.svg

Lines changed: 4 additions & 0 deletions
Loading

website/dist/index.html

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" type="image/svg+xml" href="/Competitive-Programming-Session-Content/favicon.svg" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<meta
8+
name="description"
9+
content="Competitive Programming sessions by Ahmed Hossam (7oSkaa) — videos, problems, articles, and resources."
10+
/>
11+
<link rel="preconnect" href="https://fonts.googleapis.com" />
12+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
13+
<link
14+
href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&family=Space+Grotesk:wght@500;600;700&display=swap"
15+
rel="stylesheet"
16+
/>
17+
<title>CP Sessions Hub | 7oSkaa</title>
18+
<script type="module" crossorigin src="/Competitive-Programming-Session-Content/assets/index-DvRzUOwu.js"></script>
19+
<link rel="stylesheet" crossorigin href="/Competitive-Programming-Session-Content/assets/index-D9351ISx.css">
20+
</head>
21+
<body>
22+
<div id="root"></div>
23+
</body>
24+
</html>

website/index.html

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<meta
8+
name="description"
9+
content="Competitive Programming sessions by Ahmed Hossam (7oSkaa) — videos, problems, articles, and resources."
10+
/>
11+
<link rel="preconnect" href="https://fonts.googleapis.com" />
12+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
13+
<link
14+
href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&family=Space+Grotesk:wght@500;600;700&display=swap"
15+
rel="stylesheet"
16+
/>
17+
<title>CP Sessions Hub | 7oSkaa</title>
18+
</head>
19+
<body>
20+
<div id="root"></div>
21+
<script type="module" src="/src/main.tsx"></script>
22+
</body>
23+
</html>

0 commit comments

Comments
 (0)