React website for Augmented Perception, an Open-Source Organisation that provides AI-powered solutions to the AR/VR community. This website is designed to show off the orgs capabilities and provide a platform for users to learn more about the org and its projects.
- Homepage: Welcome page introducing the organization
- Projects Page: Displays projects from Firestore database with GitHub integration
- About Page: Information about the organization and team
- Contact Page: Contact form for reaching out
- Admin Dashboard: Protected admin area with comprehensive project management
- Authentication: Secure admin login using Firebase Authentication
- Project Management: Full CRUD operations - create, read, update, delete projects
- GitHub Integration: Sync projects with GitHub repositories automatically
- Pin Projects: Highlight important projects at the top
- Modern UI: Clean, responsive design using styled-components
- Error Handling: Comprehensive error boundaries and user feedback
- Real-time Updates: Live project data from Firestore
- Frontend: React 18 with React Router for navigation
- Database: Firebase Firestore for project data storage
- Styling: styled-components for modern CSS-in-JS
- Authentication: Firebase Authentication (Email/Password)
- API Integration: GitHub API for repository synchronization
- Build Tool: Create React App with PWA template
- Package Manager: npm
- Node.js (version 16 or higher)
- npm or yarn
- Firebase project (for authentication and Firestore)
- GitHub organization access (for repository sync)
-
Clone the repository
git clone https://github.com/Augmented-Perception/Digital-Perception.git cd Digital-Perception -
Install dependencies
npm install
-
Set up Firebase
- Go to Firebase Console
- Create a new project
- Enable Authentication with Email/Password sign-in method
- Enable Firestore Database (start in test mode for development)
- Add a web app to your project
- Copy the Firebase configuration
-
Configure environment variables Create a
.envfile in the root directory:REACT_APP_API_KEY=your_api_key REACT_APP_AUTH_DOMAIN=your_project.firebaseapp.com REACT_APP_PROJECT_ID=your_project_id REACT_APP_STORAGE_BUCKET=your_project.appspot.com REACT_APP_MESSAGING_SENDER_ID=your_sender_id REACT_APP_APP_ID=your_app_id REACT_APP_MEASUREMENT_ID=your_measurement_id
-
Set up Firestore (Optional) For detailed Firestore setup instructions including security rules, see FIRESTORE_SETUP.md
-
Create admin user
- In Firebase Console, go to Authentication > Users
- Add a new user with email and password
- This user will have admin access to the dashboard
Start the development server
npm run startThe app will open at http://localhost:3000.
Available Scripts
npm run start- Start development servernpm run build- Build for productionnpm run test- Run testsnpm run lint- Run ESLint
src/
├── pages/ # Page components
├── src/
│ ├── components/
│ │ ├── particles.js # Animated background particles
│ │ ├── AdminProjectDashboard.js # Comprehensive admin interface
│ │ └── ErrorBoundary.js # Error handling component
│ ├── pages/
│ │ ├── Home.js # Homepage
│ │ ├── Projects.js # Projects listing with Firestore integration
│ │ ├── About.js # About page
│ │ ├── Contact.js # Contact form
│ │ └── Login.js # Admin login
│ ├── utils/
│ │ ├── projectService.js # Firestore CRUD operations
│ │ ├── testFirestore.js # Testing utilities
│ │ └── mouse.js # Mouse tracking utilities
│ ├── App.js # Main app component with routing
│ ├── firebase.js # Firebase configuration
│ └── index.js # App entry point
├── FIRESTORE_SETUP.md # Detailed Firestore setup guide
└── README.md # This file
- Secure login using Firebase Authentication
- Protected admin routes with error boundaries
- Automatic session management
- Comprehensive Statistics: View total, pinned, GitHub, and custom project counts
- GitHub Synchronization: Import and sync repositories from GitHub organization
- Real-time Updates: Live project data from Firestore database
- Bulk Operations: Manage multiple projects efficiently
- Create: Add new custom projects with full validation
- Read: View all projects with filtering and sorting
- Update: Edit project details, descriptions, and URLs
- Delete: Remove projects with confirmation dialogs
- Pin/Unpin: Highlight important projects
- Auto-Import: Import all repositories from GitHub organization
- Data Sync: Update existing GitHub projects with latest repository data
- Repository Tracking: Distinguish between GitHub repos and custom projects
- Metadata Storage: Store GitHub-specific data (stars, language, etc.)
- Error Boundaries: Graceful handling of component crashes
- Loading States: User feedback during async operations
- Success/Error Messages: Clear feedback for all actions
- Form Validation: Prevent invalid data submission
- Admin controls are only visible to authenticated users
- Non-admin users can view projects but cannot modify them
- Protected routes with automatic redirection
The project includes GitHub Actions workflows for automatic deployment:
-
CI/CD Pipeline: Runs on every push to main branch
- Lints code
- Runs tests
- Builds the project
-
Deployment: Automatically deploys to GitHub Pages
- Builds the project
- Deploys to
gh-pagesbranch
-
Releases: Creates releases for tagged versions
- Triggers on version tags (e.g.,
v1.0.0) - Builds and packages the app
- Triggers on version tags (e.g.,
npm run buildThe built files will be in the build/ directory, ready for deployment to any static hosting service.
This project includes a fix for Single Page Application (SPA) routing issues on GitHub Pages. When users refresh the page on any route other than the root (e.g., /about, /contact), GitHub Pages would normally show a 404 error because it looks for physical files at those paths.
Solution implemented:
public/404.html: Redirects 404 errors to the main page with the original path preservedpublic/index.html: Contains a script that restores the correct URL from the redirect
This ensures that all routes work correctly when users refresh the page or access URLs directly. The solution is based on the spa-github-pages approach.
| Variable | Description | Required |
|---|---|---|
REACT_APP_API_KEY |
Firebase API key | Yes |
REACT_APP_AUTH_DOMAIN |
Firebase auth domain | Yes |
REACT_APP_PROJECT_ID |
Firebase project ID | Yes |
REACT_APP_STORAGE_BUCKET |
Firebase storage bucket | Yes |
REACT_APP_MESSAGING_SENDER_ID |
Firebase messaging sender ID | Yes |
REACT_APP_APP_ID |
Firebase app ID | Yes |
REACT_APP_MEASUREMENT_ID |
Firebase measurement ID | Yes |
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
For support, please contact the Augmented Perception team or create an issue in this repository.
- Augmented Perception GitHub Organization
- Live Demo (after deployment)
