Skip to content

Commit 041ee1a

Browse files
authored
Initial commit
0 parents  commit 041ee1a

28 files changed

+5675
-0
lines changed

.env.example

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# GitHub API Token - required for fetching repository data
2+
# Create a Personal Access Token with 'repo' and 'read:org' scopes
3+
# https://github.com/settings/tokens
4+
GH_TOKEN=your_github_token_here
5+
6+
# Optional: Custom environment variables
7+
# NODE_ENV=development
8+
# VITE_BASE_URL=/github-projects-showcase/
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Refresh GitHub Data
2+
3+
on:
4+
schedule:
5+
- cron: '0 0 * * *' # Runs daily at midnight UTC
6+
workflow_dispatch: # Allow manual triggers
7+
push:
8+
paths:
9+
- 'src/config.js' # Run when config is updated
10+
11+
jobs:
12+
refresh-data:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v3
18+
19+
- name: Set up Node.js
20+
uses: actions/setup-node@v3
21+
with:
22+
node-version: '18'
23+
cache: 'npm'
24+
25+
- name: Install dependencies
26+
run: npm ci
27+
28+
- name: Fetch GitHub data
29+
run: npm run fetch-data
30+
env:
31+
GH_TOKEN: ${{ secrets.GH_TOKEN }}
32+
33+
- name: Commit updated data
34+
run: |
35+
git config --local user.email "action@github.com"
36+
git config --local user.name "GitHub Action"
37+
git add public/projects.json
38+
git commit -m "Update projects data" || echo "No changes to commit"
39+
git push

.gitignore

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
14+
15+
# Editor directories and files
16+
.vscode/*
17+
!.vscode/extensions.json
18+
.idea
19+
.DS_Store
20+
*.suo
21+
*.ntvs*
22+
*.njsproj
23+
*.sln
24+
*.sw?
25+
.env

README.md

Lines changed: 221 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,221 @@
1+
## 🛠️ Quick Start
2+
3+
### 1. Use this template
4+
5+
Click the "Use this template" button to create a new repository based on this template.
6+
7+
### 2. Clone your repository
8+
9+
```bash
10+
git clone https://github.com/your-username/your-repo-name.git
11+
cd your-repo-name
12+
```
13+
14+
### 3. Install dependencies
15+
16+
```bash
17+
npm install
18+
```
19+
20+
### 4. Configure your GitHub API Token
21+
22+
This template requires a GitHub API token to fetch repository data:
23+
24+
1. Create a [Personal Access Token](https://github.com/settings/tokens) with the following permissions:
25+
- `repo` (Full control of private repositories)
26+
- `read:org` (Read organization information)
27+
28+
2. Add the token to your repository secrets:
29+
- Go to your repository on GitHub
30+
- Navigate to Settings > Secrets and variables > Actions
31+
- Click "New repository secret"
32+
- Name: `GH_TOKEN`
33+
- Value: Your personal access token
34+
- Click "Add secret"
35+
36+
3. For local development, create a `.env` file in the root directory:
37+
```
38+
GH_TOKEN=your_github_token_here
39+
```
40+
41+
### 5. Configure your organization and projects
42+
43+
Edit the `src/config.js` file to customize your showcase:
44+
45+
```javascript
46+
// src/config.js
47+
export default {
48+
// Organization & Theme
49+
organization: "YourOrgName", // GitHub organization name
50+
title: "Projects Showcase", // Page title
51+
logo: "/logo.png", // Path to your logo (place in public folder)
52+
53+
// Theme colors
54+
colors: {
55+
primary: "#00305C", // Primary color - dark blue
56+
secondary: "#0093C7", // Secondary color - light blue
57+
accent: "#009DE0", // Accent color - medium blue
58+
text: "#333333", // Main text color
59+
background: "#ffffff", // Background color
60+
},
61+
62+
// Categories to show
63+
categories: [
64+
{ id: "all", label: "All" },
65+
{ id: "ai", label: "Artificial Intelligence" },
66+
{ id: "iot", label: "Internet of Things" },
67+
// Add more categories as needed
68+
],
69+
70+
// Projects input data
71+
projects: [
72+
{
73+
"project_name": "Project Name",
74+
"project_topic": "github-topic", // GitHub topic to search for
75+
"project_area": "Category", // Should match one of the category labels
76+
"project_description": "Project description text",
77+
"project_url": "https://example.com/project",
78+
"project_website": "https://project.example.com" // Optional
79+
},
80+
// Add more projects as needed
81+
]
82+
}
83+
```
84+
85+
### 6. Add your logo and assets
86+
87+
- Place your organization logo in the `public` folder as `logo.png`
88+
- If you have project logos, add them to the `src/assets` folder
89+
90+
### 7. Fetch data from GitHub
91+
92+
```bash
93+
npm run fetch-data
94+
```
95+
96+
This command will:
97+
- Use your GitHub token to fetch data about your repositories
98+
- Group repositories by the topics defined in your config
99+
- Save the data to `public/projects.json`
100+
101+
### 8. Run the development server
102+
103+
```bash
104+
npm run dev
105+
```
106+
107+
### 9. Build for production
108+
109+
```bash
110+
npm run build
111+
```
112+
113+
## 🚢 Deployment
114+
115+
### GitHub Pages
116+
117+
1. In your repository settings, navigate to "Pages"
118+
2. Set up GitHub Pages to deploy from your GitHub Actions workflow
119+
120+
3. Add the following workflow file to `.github/workflows/deploy.yml`:
121+
122+
```yaml
123+
name: Deploy to GitHub Pages
124+
125+
on:
126+
push:
127+
branches: [ main ]
128+
workflow_dispatch:
129+
130+
jobs:
131+
build-and-deploy:
132+
runs-on: ubuntu-latest
133+
steps:
134+
- name: Checkout
135+
uses: actions/checkout@v3
136+
137+
- name: Set up Node.js
138+
uses: actions/setup-node@v3
139+
with:
140+
node-version: '18'
141+
142+
- name: Install dependencies
143+
run: npm ci
144+
145+
- name: Fetch GitHub data
146+
run: npm run fetch-data
147+
env:
148+
GH_TOKEN: ${{ secrets.GH_TOKEN }}
149+
150+
- name: Build
151+
run: npm run build
152+
153+
- name: Deploy to GitHub Pages
154+
uses: JamesIves/github-pages-deploy-action@v4
155+
with:
156+
folder: dist
157+
```
158+
159+
### Automatic Data Updates
160+
161+
To keep your project data up-to-date, add a GitHub Action workflow to fetch data regularly:
162+
163+
```yaml
164+
name: Update Project Data
165+
166+
on:
167+
schedule:
168+
- cron: '0 0 * * *' # Run daily at midnight
169+
workflow_dispatch: # Allow manual triggers
170+
171+
jobs:
172+
update-data:
173+
runs-on: ubuntu-latest
174+
steps:
175+
- name: Checkout
176+
uses: actions/checkout@v3
177+
178+
- name: Set up Node.js
179+
uses: actions/setup-node@v3
180+
with:
181+
node-version: '18'
182+
183+
- name: Install dependencies
184+
run: npm ci
185+
186+
- name: Fetch GitHub data
187+
run: npm run fetch-data
188+
env:
189+
GH_TOKEN: ${{ secrets.GH_TOKEN }}
190+
191+
- name: Commit and push if changed
192+
run: |
193+
git config --local user.email "action@github.com"
194+
git config --local user.name "GitHub Action"
195+
git add public/projects.json
196+
git diff --quiet && git diff --staged --quiet || git commit -m "Update projects data"
197+
git push
198+
```
199+
200+
## 📋 Customization
201+
202+
### Styling
203+
204+
The application uses Tailwind CSS for styling. You can customize the look and feel by:
205+
206+
1. Editing colors in `src/config.js`
207+
2. Modifying the Tailwind theme in `tailwind.config.js`
208+
3. Adding custom CSS in `src/index.css`
209+
210+
### Components
211+
212+
All components are in the `src/components` directory and can be customized:
213+
214+
- `Header.jsx` - Search, filters, and sorting
215+
- `ProjectCard.jsx` - How each project is displayed
216+
- `Footer.jsx` - Page footer
217+
- `ScrollNavbar.jsx` - Navigation bar
218+
219+
## 📝 License
220+
221+
MIT

eslint.config.js

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import js from '@eslint/js'
2+
import globals from 'globals'
3+
import reactHooks from 'eslint-plugin-react-hooks'
4+
import reactRefresh from 'eslint-plugin-react-refresh'
5+
6+
export default [
7+
{ ignores: ['dist'] },
8+
{
9+
files: ['**/*.{js,jsx}'],
10+
languageOptions: {
11+
ecmaVersion: 2020,
12+
globals: globals.browser,
13+
parserOptions: {
14+
ecmaVersion: 'latest',
15+
ecmaFeatures: { jsx: true },
16+
sourceType: 'module',
17+
},
18+
},
19+
plugins: {
20+
'react-hooks': reactHooks,
21+
'react-refresh': reactRefresh,
22+
},
23+
rules: {
24+
...js.configs.recommended.rules,
25+
...reactHooks.configs.recommended.rules,
26+
'no-unused-vars': ['error', { varsIgnorePattern: '^[A-Z_]' }],
27+
'react-refresh/only-export-components': [
28+
'warn',
29+
{ allowConstantExport: true },
30+
],
31+
},
32+
},
33+
]

index.html

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" type="image/png" href="/favicon.png" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<meta name="description" content="GitHub Projects Showcase - Discover open source projects and repositories" />
8+
<meta name="theme-color" content="#003366" />
9+
<title>GitHub Projects Showcase</title>
10+
</head>
11+
<body>
12+
<div id="root"></div>
13+
<script type="module" src="/src/main.jsx"></script>
14+
</body>
15+
</html>

0 commit comments

Comments
 (0)