|
1 | | -# OpenHardware Initiative Website — Source Code |
2 | | - |
3 | | -This folder contains the full source code for the OpenHardware Initiative website. |
4 | | - |
5 | | -## 📁 Structure |
6 | | -- `src/` — Main app source code |
7 | | - - `components/` — React UI components |
8 | | - - `data/` — All data (people, events, projects) |
9 | | - - `pages/` — Page components |
10 | | - - `...` |
11 | | -- `public/` — Static assets (images, uploads, etc.) |
12 | | - |
13 | | -## 📦 Data Management |
14 | | -- See [`DATA_MANAGEMENT_README.md`](DATA_MANAGEMENT_README.md) for how to add or edit people, events, or projects. |
15 | | -- See [`APPLICATION_CONFIG_README.md`](APPLICATION_CONFIG_README.md) for how to set-up & remove an application form. |
16 | | - |
17 | | -## 🏗️ Building & Deploying |
18 | | -See [`DEPLOYMENT_README.md`](DEPLOYMENT_README.md) for how to build and deploy the site with Bun and GitHub Pages. |
19 | | - |
20 | | -## ⚡ Quick Start |
21 | | -1. Install dependencies (if needed): |
22 | | - ```sh |
23 | | - bun install |
24 | | - ``` |
25 | | -2. Start the dev server (test the website locally): |
26 | | - ```sh |
27 | | - bun run dev |
28 | | - ``` |
29 | | -3. Build for production: |
30 | | - ```sh |
31 | | - bun run build |
32 | | - ``` |
33 | | - |
34 | | -## 🛠️ Development |
35 | | -- Built with [React](https://react.dev/), [Vite](https://vitejs.dev/), [TypeScript](https://www.typescriptlang.org/), [Tailwind CSS](https://tailwindcss.com/), and [Bun](https://bun.sh/) |
36 | | -- All data is managed in `src/data/` as TypeScript files |
37 | | -- No database or CMS required |
38 | | - |
39 | | -## 📝 Notes |
40 | | -- SPA routing is supported for GitHub Pages, Vercel, and Netlify |
41 | | -- All application links are managed via `src/config/applicationConfig.ts` |
42 | | - |
43 | | ---- |
44 | | - |
45 | | -For more, see the main repo README and the documentation files. |
| 1 | +# Open Hardware Initiative Website - Source Code |
| 2 | + |
| 3 | +This directory contains the source code for the Open Hardware Initiative website, built with React, TypeScript, and Vite. |
| 4 | + |
| 5 | +## 🚀 Quick Start |
| 6 | + |
| 7 | +### Prerequisites |
| 8 | +- [Bun](https://bun.sh/) (recommended) or Node.js 18+ |
| 9 | +- Git |
| 10 | + |
| 11 | +### Development |
| 12 | +```bash |
| 13 | +# Install dependencies |
| 14 | +bun install |
| 15 | + |
| 16 | +# Start development server |
| 17 | +bun run dev |
| 18 | + |
| 19 | +# The site will be available at http://localhost:8080 |
| 20 | +``` |
| 21 | + |
| 22 | +### Building Locally |
| 23 | +```bash |
| 24 | +# Build for production |
| 25 | +bun run build |
| 26 | + |
| 27 | +# Preview production build |
| 28 | +bun run preview |
| 29 | +``` |
| 30 | + |
| 31 | +## 🚀 Deployment |
| 32 | + |
| 33 | +**No manual deployment needed!** This project uses GitHub Actions for automatic deployment: |
| 34 | + |
| 35 | +1. **Push to main branch** → Automatic build and deploy |
| 36 | +2. **Site goes live** at [open-hardware-initiative.com](https://open-hardware-initiative.com) |
| 37 | + |
| 38 | +The GitHub Actions workflow (`.github/workflows/deploy.yml`) handles: |
| 39 | +- Installing dependencies with Bun |
| 40 | +- Building the project |
| 41 | +- Deploying to GitHub Pages |
| 42 | + |
| 43 | +## 📁 Project Structure |
| 44 | + |
| 45 | +``` |
| 46 | +src/ |
| 47 | +├── components/ # React components |
| 48 | +│ ├── ui/ # Reusable UI components (shadcn/ui) |
| 49 | +│ └── ... # Page-specific components |
| 50 | +├── pages/ # Page components |
| 51 | +├── data/ # Content data files |
| 52 | +├── hooks/ # Custom React hooks |
| 53 | +├── lib/ # Utility libraries |
| 54 | +├── utils/ # Helper functions |
| 55 | +└── config/ # Configuration files |
| 56 | +
|
| 57 | +public/ # Static assets |
| 58 | +├── media/ # Images and media files |
| 59 | +├── lovable-uploads/ # Uploaded content |
| 60 | +└── ... # Other static files |
| 61 | +
|
| 62 | +data/ # Content data (TypeScript files) |
| 63 | +├── peopleData.ts # Team member information |
| 64 | +├── projectsData.ts # Project showcase data |
| 65 | +└── eventsData.ts # Events and activities |
| 66 | +``` |
| 67 | + |
| 68 | +## 📝 Content Management |
| 69 | + |
| 70 | +### Adding/Editing Team Members |
| 71 | +Edit `src/data/peopleData.ts`: |
| 72 | +```typescript |
| 73 | +export const peopleData = [ |
| 74 | + { |
| 75 | + name: "John Doe", |
| 76 | + role: "Team Member", |
| 77 | + image: "/media/team/john-doe.jpg", |
| 78 | + // ... other fields |
| 79 | + } |
| 80 | +]; |
| 81 | +``` |
| 82 | + |
| 83 | +### Adding/Editing Projects |
| 84 | +Edit `src/data/projectsData.ts`: |
| 85 | +```typescript |
| 86 | +export const projectsData = [ |
| 87 | + { |
| 88 | + title: "Project Name", |
| 89 | + description: "Project description", |
| 90 | + image: "/media/projects/project.jpg", |
| 91 | + // ... other fields |
| 92 | + } |
| 93 | +]; |
| 94 | +``` |
| 95 | + |
| 96 | +### Adding/Editing Events |
| 97 | +Edit `src/data/eventsData.ts`: |
| 98 | +```typescript |
| 99 | +export const eventsData = [ |
| 100 | + { |
| 101 | + title: "Event Name", |
| 102 | + date: "2024-01-15", |
| 103 | + description: "Event description", |
| 104 | + // ... other fields |
| 105 | + } |
| 106 | +]; |
| 107 | +``` |
| 108 | + |
| 109 | +### Managing Application Status |
| 110 | +Edit `src/config/applicationConfig.ts`: |
| 111 | +```typescript |
| 112 | +export const applicationConfig = { |
| 113 | + isOpen: false, // Set to true to enable applications |
| 114 | + formUrl: "https://forms.google.com/your-form", // Google Form URL |
| 115 | + closedMessage: "Application period is currently closed." |
| 116 | +}; |
| 117 | +``` |
| 118 | + |
| 119 | +## 🛠️ Tech Stack |
| 120 | + |
| 121 | +- **Framework**: React 18 with TypeScript |
| 122 | +- **Build Tool**: Vite |
| 123 | +- **Styling**: Tailwind CSS + shadcn/ui components |
| 124 | +- **Package Manager**: Bun (faster than npm) |
| 125 | +- **Routing**: React Router DOM |
| 126 | +- **Deployment**: GitHub Actions + GitHub Pages |
| 127 | + |
| 128 | +## 🔧 Configuration Files |
| 129 | + |
| 130 | +- `vite.config.ts` - Build configuration |
| 131 | +- `tailwind.config.ts` - Tailwind CSS configuration |
| 132 | +- `tsconfig.json` - TypeScript configuration |
| 133 | +- `CNAME` - Custom domain configuration |
| 134 | + |
| 135 | +## 📦 Available Scripts |
| 136 | + |
| 137 | +- `bun run dev` - Start development server |
| 138 | +- `bun run build` - Build for production |
| 139 | +- `bun run preview` - Preview production build |
| 140 | +- `bun run lint` - Run ESLint |
| 141 | + |
| 142 | +## 🎨 UI Components |
| 143 | + |
| 144 | +This project uses [shadcn/ui](https://ui.shadcn.com/) components for consistent design. All components are in `src/components/ui/`. |
| 145 | + |
| 146 | +## 📱 Responsive Design |
| 147 | + |
| 148 | +The website is fully responsive and mobile-friendly. All components are designed to work on: |
| 149 | +- Desktop (1024px+) |
| 150 | +- Tablet (768px - 1023px) |
| 151 | +- Mobile (< 768px) |
| 152 | + |
| 153 | +## 🔍 SEO & Performance |
| 154 | + |
| 155 | +- Optimized for search engines |
| 156 | +- Fast loading with Vite |
| 157 | +- Proper meta tags and structured data |
| 158 | +- Responsive images and lazy loading |
| 159 | + |
| 160 | +## 🐛 Troubleshooting |
| 161 | + |
| 162 | +### Common Issues |
| 163 | + |
| 164 | +1. **Port already in use**: Change the port in `vite.config.ts` |
| 165 | +2. **Build errors**: Check TypeScript errors with `bun run lint` |
| 166 | +3. **Missing dependencies**: Run `bun install` |
| 167 | + |
| 168 | +### Getting Help |
| 169 | + |
| 170 | +- Check the [main README.md](../README.md) for repository overview |
| 171 | +- Create an issue in the repository for bugs |
| 172 | +- Contact the development team for questions |
0 commit comments