Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
101 changes: 89 additions & 12 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,95 @@
name: Deploy to GitHub Pages
name: CI

on:
pull_request:
branches:
- main
push:
branches:
- main

permissions:
contents: write

jobs:
build-and-deploy:
lint:
name: Lint Code
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm

- name: Install dependencies
run: npm ci

- name: Run linter
run: npm run lint

unit-tests:
name: Unit Tests
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm

- name: Install dependencies
run: npm ci

- name: Run unit tests
run: npm run test:run

e2e-tests:
name: E2E Tests
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm

- name: Install dependencies
run: npm ci

- name: Install Playwright Browsers
run: npx playwright install --with-deps

- name: Build site
env:
NODE_OPTIONS: --max_old_space_size=4096
run: npm run build

- name: Run E2E tests
run: npm run test:e2e

- name: Upload test results
if: failure()
continue-on-error: true
uses: actions/upload-artifact@v4
with:
name: playwright-report
path: playwright-report/
retention-days: 7

build:
name: Build Check
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -30,11 +108,10 @@ jobs:
NODE_OPTIONS: --max_old_space_size=4096
run: npm run build

- name: Deploy to gh-pages
uses: JamesIves/github-pages-deploy-action@v4
- name: Upload build artifacts
continue-on-error: true
uses: actions/upload-artifact@v4
with:
branch: gh-pages
folder: dist
clean: true
clean-exclude: |
pr-preview/
name: build-output
path: dist/
retention-days: 1
57 changes: 28 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

A modern, responsive community platform built with React 19 and Vite, featuring comprehensive testing, cross-browser compatibility, and enterprise-grade security.

## Features
## Features

- 🌐 **Responsive Design** – Mobile-first layout with smooth in-page navigation
- 🧪 **Automated Testing** – Unit and Playwright coverage for critical journeys
- 📱 **Cross-Browser Support** – Chrome, Firefox, Safari (desktop + mobile)
- ⚡ **Modern Stack** – React 19, Vite, Playwright, and Vitest
- 🛡️ **Built-In Security** – Strict Content Security Policy and lazy loading for heavy sections
- Responsive Design – Mobile-first layout with smooth in-page navigation
- Automated Testing – Unit and Playwright coverage for critical journeys
- Cross-Browser Support – Chrome, Firefox, Safari (desktop + mobile)
- Modern Stack – React 19, Vite, Playwright, and Vitest
- Built-In Security – Strict Content Security Policy and lazy loading for heavy sections

## 🚀 Quick Start
## Quick Start

### Prerequisites
- Node.js 18+
Expand All @@ -32,8 +32,7 @@ npm run dev
### Environment Variables
None required for local development.

## 🏗️ Project Structure

## Project Structure
```
zatech-website/
├── public/ # Static assets served directly
Expand All @@ -58,7 +57,7 @@ zatech-website/
└── README.md # This file
```

## 🔧 Development
## Development

### Available Scripts
```bash
Expand Down Expand Up @@ -90,22 +89,22 @@ npm run dev
# - Rate limiting status
```

## 🧪 Testing Cheat Sheet
## Testing Cheat Sheet

### Quick Test Commands
```bash
# 🚀 FULL TEST SUITE (Run this before commits)
# FULL TEST SUITE (Run this before commits)
npm run test:run && npm run test:e2e && npm run lint && npm audit

# 🏃‍♂️ QUICK DEV CHECKS (During development)
# QUICK DEV CHECKS (During development)
npm run test:run # Unit tests only (fast ~1-2 seconds)
npm run lint # Code quality check (~1 second)
npm run dev # Start dev server

# 🌐 CROSS-BROWSER TESTING (Before releases)
# CROSS-BROWSER TESTING (Before releases)
npm run test:e2e # Full browser compatibility (~10-30 seconds)

# 🔒 SECURITY CHECK
# SECURITY CHECK
npm audit # Check for vulnerabilities
```

Expand All @@ -115,7 +114,7 @@ npm audit # Check for vulnerabilities
| **Add new component** | `npm run test:run` | Verify existing tests still pass |
| **Change existing code** | `npm run test:run` | Check for regressions |
| **Add new CSS/styles** | `npm run lint` | Catch style issues early |
| **Before committing** | Full test suite ⬆️ | Ensure nothing is broken |
| **Before committing** | Full test suite | Ensure nothing is broken |
| **Add new dependencies** | `npm audit` | Security check |
| **Test mobile/responsive** | `npm run dev -- --host 0.0.0.0` | Test on phone |
| **Before deployment** | `npm run test:e2e` | Cross-browser verification |
Expand Down Expand Up @@ -147,7 +146,7 @@ npm run dev -- --host 0.0.0.0
# (Check terminal output for exact IP address)
```

## 🛡️ Security & Quality
## Security & Quality

### Security Features
- **Content Security Policy (CSP)**: Browser-level guardrails for third-party content
Expand All @@ -167,7 +166,7 @@ Configured via `.browserslistrc`:
- iOS Safari 14+, Android Chrome 88+
- Modern JavaScript features with graceful degradation

## 🤝 Contributing
## Contributing

1. Fork the repository
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
Expand All @@ -184,23 +183,23 @@ Configured via `.browserslistrc`:
- Update documentation for significant changes
- Follow security patterns established in the codebase

## 🏆 Technical Achievements
## Technical Achievements

This project demonstrates production-grade development practices:

- ✅ **Modern React Architecture** - Hooks, components, routing
- ✅ **Comprehensive Testing** - Unit, integration, E2E, cross-browser
- ✅ **Security First** - Multiple layers of protection
- ✅ **Performance Optimized** - Fast builds, optimized bundles
- ✅ **Mobile Ready** - Responsive design, touch-friendly
- ✅ **Developer Experience** - Hot reload, linting, type safety
- ✅ **Production Ready** - Build optimization, error handling
- Modern React Architecture - Hooks, components, routing
- Comprehensive Testing - Unit, integration, E2E, cross-browser
- Security First - Multiple layers of protection
- Performance Optimized - Fast builds, optimized bundles
- Mobile Ready - Responsive design, touch-friendly
- Developer Experience - Hot reload, linting, type safety
- Production Ready - Build optimization, error handling

## 📄 License
## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

## 🆘 Support & Resources
## Support & Resources

- **Documentation**: This README covers all major aspects
- **Issues**: Report bugs via [GitHub Issues](https://github.com/Accompany-VC/zatech-website/issues)
Expand All @@ -209,4 +208,4 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file

---

Built with ❤️ for the South African tech community
Built with love for the South African tech community
1 change: 1 addition & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import reactHooks from 'eslint-plugin-react-hooks'
import reactRefresh from 'eslint-plugin-react-refresh'
import { defineConfig, globalIgnores } from 'eslint/config'

// ESLint configuration
export default defineConfig([
globalIgnores(['dist']),
{
Expand Down
Loading
Loading