|
| 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 |
0 commit comments