|
| 1 | +# Starlight Lab Website |
| 2 | + |
| 3 | +This is the official website for the Starlight Lab at Carnegie Mellon University. The website is built using React, TypeScript, and Tailwind CSS, and is deployed using GitHub Pages. |
| 4 | + |
| 5 | +## 🚀 Quick Start |
| 6 | + |
| 7 | +1. Clone the repository: |
| 8 | +```bash |
| 9 | +git clone https://github.com/starlightcmu/starlightcmu.github.io.git |
| 10 | +cd starlightcmu.github.io |
| 11 | +``` |
| 12 | + |
| 13 | +2. Install dependencies: |
| 14 | +```bash |
| 15 | +npm install |
| 16 | +``` |
| 17 | + |
| 18 | +3. Start the development server: |
| 19 | +```bash |
| 20 | +npm run dev |
| 21 | +``` |
| 22 | + |
| 23 | +## 📁 Project Structure |
| 24 | + |
| 25 | +``` |
| 26 | +src/ |
| 27 | +├── components/ # Reusable React components |
| 28 | +├── data/ # JSON data files for content |
| 29 | +├── pages/ # Page components |
| 30 | +├── types/ # TypeScript type definitions |
| 31 | +└── styles/ # CSS and styling files |
| 32 | +``` |
| 33 | + |
| 34 | +## 🚧 Maintenance Mode |
| 35 | + |
| 36 | +The website includes a maintenance overlay that can be toggled on/off using a single variable: |
| 37 | + |
| 38 | +1. Open `src/App.tsx` |
| 39 | +2. Locate the `MAINTENANCE_MODE` variable at the top of the file: |
| 40 | +```typescript |
| 41 | +export const MAINTENANCE_MODE = true; |
| 42 | +``` |
| 43 | +3. Set it to `false` to disable the maintenance overlay and show the full website |
| 44 | +4. Set it to `true` to enable the maintenance overlay |
| 45 | + |
| 46 | +## 📝 Making Changes |
| 47 | + |
| 48 | +### Updating Content |
| 49 | + |
| 50 | +All content is stored in JSON files in the `src/data` directory: |
| 51 | + |
| 52 | +- `news.json`: Latest news and announcements |
| 53 | +- `team.json`: Team member information |
| 54 | +- `publications.json`: Research publications |
| 55 | +- `projects.json`: Research projects |
| 56 | + |
| 57 | +To update content, simply edit the corresponding JSON file. The changes will be automatically reflected in the website. |
| 58 | + |
| 59 | +#### Adding News Items |
| 60 | + |
| 61 | +Add new items to the `news` array in `src/data/news.json`: |
| 62 | + |
| 63 | +```json |
| 64 | +{ |
| 65 | + "news": [ |
| 66 | + { |
| 67 | + "date": "March 20, 2024", |
| 68 | + "title": "Your News Title", |
| 69 | + "content": "Your news content" |
| 70 | + }, |
| 71 | + // ... existing items |
| 72 | + ] |
| 73 | +} |
| 74 | +``` |
| 75 | + |
| 76 | +#### Adding Team Members |
| 77 | + |
| 78 | +Add new members to the `labMembers` array in `src/data/team.json`: |
| 79 | + |
| 80 | +```json |
| 81 | +{ |
| 82 | + "labMembers": [ |
| 83 | + { |
| 84 | + "name": "New Member Name", |
| 85 | + "role": "Role Title", |
| 86 | + "bio": "Member bio", |
| 87 | + "image": "https://image-url.com", |
| 88 | + "links": { |
| 89 | + "google_scholar": "optional-url", |
| 90 | + "github": "optional-url", |
| 91 | + "website": "optional-url", |
| 92 | + "email": "optional-email", |
| 93 | + "linkedin": "optional-url" |
| 94 | + } |
| 95 | + }, |
| 96 | + // ... existing members |
| 97 | + ] |
| 98 | +} |
| 99 | +``` |
| 100 | + |
| 101 | +#### Adding Publications |
| 102 | + |
| 103 | +Add new publications to the `publications` array in `src/data/publications.json`: |
| 104 | + |
| 105 | +```json |
| 106 | +{ |
| 107 | + "publications": [ |
| 108 | + { |
| 109 | + "title": "Publication Title", |
| 110 | + "authors": ["Author 1", "Author 2"], |
| 111 | + "venue": "Conference/Journal Name", |
| 112 | + "year": 2024, |
| 113 | + "pdf": "optional-pdf-url", |
| 114 | + "code": "optional-code-url", |
| 115 | + "abstract": "Publication abstract" |
| 116 | + }, |
| 117 | + // ... existing publications |
| 118 | + ] |
| 119 | +} |
| 120 | +``` |
| 121 | + |
| 122 | +#### Adding Projects |
| 123 | + |
| 124 | +Add new projects to the `projects` array in `src/data/projects.json`: |
| 125 | + |
| 126 | +```json |
| 127 | +{ |
| 128 | + "projects": [ |
| 129 | + { |
| 130 | + "title": "Project Title", |
| 131 | + "description": "Project description", |
| 132 | + "image": "https://image-url.com", |
| 133 | + "tags": ["Tag1", "Tag2"], |
| 134 | + "link": "optional-project-url" |
| 135 | + }, |
| 136 | + // ... existing projects |
| 137 | + ] |
| 138 | +} |
| 139 | +``` |
| 140 | + |
| 141 | +### Styling Changes |
| 142 | + |
| 143 | +The website uses Tailwind CSS for styling. The main configuration is in: |
| 144 | +- `tailwind.config.js`: Tailwind configuration |
| 145 | +- `src/index.css`: Global styles and animations |
| 146 | + |
| 147 | +### Adding New Pages |
| 148 | + |
| 149 | +1. Create a new component in `src/pages/` |
| 150 | +2. Add the route in `src/App.tsx` |
| 151 | +3. Add the navigation link in `src/components/Navbar.tsx` |
| 152 | + |
| 153 | +## 🚀 Deployment |
| 154 | + |
| 155 | +The website is automatically deployed to GitHub Pages when changes are pushed to the main branch. The deployment process is handled by the GitHub Actions workflow in `.github/workflows/deploy.yml`. |
| 156 | + |
| 157 | +To deploy manually: |
| 158 | + |
| 159 | +1. Push your changes to the main branch: |
| 160 | +```bash |
| 161 | +git add . |
| 162 | +git commit -m "Your commit message" |
| 163 | +git push origin main |
| 164 | +``` |
| 165 | + |
| 166 | +2. The GitHub Actions workflow will automatically: |
| 167 | + - Build the project |
| 168 | + - Deploy to GitHub Pages |
| 169 | + - Make the changes live at https://starlightcmu.github.io |
| 170 | + |
| 171 | +## 🛠️ Development |
| 172 | + |
| 173 | +### Available Scripts |
| 174 | + |
| 175 | +- `npm run dev`: Start development server |
| 176 | +- `npm run build`: Build for production |
| 177 | +- `npm run preview`: Preview production build locally |
| 178 | +- `npm run lint`: Run ESLint |
| 179 | + |
| 180 | +### TypeScript Types |
| 181 | + |
| 182 | +The types for all data structures are defined in `src/types/index.ts`. Update these types if you modify the data structure in the JSON files. |
| 183 | + |
| 184 | +## 📱 Responsive Design |
| 185 | + |
| 186 | +The website is fully responsive with three main breakpoints: |
| 187 | +- Mobile: < 768px |
| 188 | +- Tablet: 768px - 1024px |
| 189 | +- Desktop: > 1024px |
| 190 | + |
| 191 | +## 🔍 SEO |
| 192 | + |
| 193 | +Update the metadata in `index.html` to improve SEO: |
| 194 | +- Title |
| 195 | +- Description |
| 196 | +- Open Graph tags |
| 197 | +- Twitter card tags |
| 198 | + |
| 199 | +## 🤝 Contributing |
| 200 | + |
| 201 | +1. Create a new branch for your changes |
| 202 | +2. Make your changes |
| 203 | +3. Test locally |
| 204 | +4. Create a pull request |
| 205 | +5. Wait for review and merge |
| 206 | + |
| 207 | +## 📄 License |
| 208 | + |
| 209 | +MIT License - see LICENSE file for details |
0 commit comments