A comprehensive full-stack web application for managing hiking groups, events, and community features. Built with modern technologies for scalability, security, and user experience.
- ๐ Frontend: https://helloliam.web.app
- ๐ง Backend API: https://backend-4kzqyywlqq-ew.a.run.app
- ๐ Custom Domain (Planned): https://www.thenarrowtrail.co.za
- ๐ Documentation: Complete Documentation
Status: โ Production Ready - Last Deployed: October 15, 2025
- โก Quick Start Guide - Get started in 5 minutes
- ๐ Deployment Guide - Complete deployment instructions
- โ๏ธ Configuration Reference - All environment variables explained
- โ Pre-Deployment Checklist - Use before every deployment
- Authentication - Secure JWT-based login with role-based access control
- User Profiles - Comprehensive profiles with emergency contacts
- Permission System - Granular role and permission management
- Auto-Approval - Intelligent user registration approval
- Privacy - Full POPIA compliance (South African data protection)
- Event Planning - Create and manage hiking events
- Registration - Interest tracking and attendance management
- Payment Tracking - Integrated payment processing
- Photo Galleries - Image upload and sharing
- Packing Lists - Customizable gear lists
- Weather Integration - Real-time weather data
- Email Notifications - SendGrid-powered email system
- SMS Alerts - Twilio SMS and WhatsApp integration
- Real-time Updates - WebSocket-based live notifications
- Comment System - Discussions on hikes and events
- Carpool Coordination - Organize shared transportation
- Usage Analytics - Comprehensive usage tracking
- Activity Logs - Detailed audit trail
- Payment Reporting - Financial tracking and reporting
- Admin Dashboard - Complete system administration
- POPIA Compliance - Full South African data protection compliance
- Data Retention - Automated data cleanup policies
- Editable Legal Docs - Privacy Policy and Terms in admin panel
- Data Export - User data export capabilities
- Account Deletion - Complete data removal
- Offline Support - Work without internet connection
- Mobile Optimized - Responsive design for all devices
- Install Prompt - Add to home screen on mobile
- Push Notifications - Real-time alerts on mobile
โโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโ
โ React Frontend โ โ Node.js Backend โ โ PostgreSQL DB โ
โ Firebase Hosting โโโโโโโบโ Cloud Run โโโโโโโบโ Cloud SQL โ
โ (Port 3000 dev) โ โ (Port 8080 prod) โ โ (Unix Socket) โ
โโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโ
โ โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโ
โ โ
โโโโโโโโโโโผโโโโโโโโโโ โโโโโโโโโโโโผโโโโโโโโโโ
โ Secret Manager โ โ File Storage โ
โ (API Keys, etc) โ โ (Future: GCS) โ
โโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโ
Frontend:
- React 18 with Hooks
- React Router v6
- Bootstrap 5
- Socket.IO Client
- Service Workers (PWA)
Backend:
- Node.js 18 (LTS)
- Express.js
- Socket.IO Server
- JWT Authentication
- Node-cron (Scheduled tasks)
Database:
- PostgreSQL 14
- pg (Node PostgreSQL client)
- Connection pooling
- Automated backups
Cloud Infrastructure:
- Google Cloud Platform (Project:
helloliam)- Cloud Run (Backend hosting)
- Cloud SQL (Database)
- Secret Manager (Credentials)
- Cloud Build (CI/CD)
- Firebase
- Hosting (Frontend)
- Analytics
Integrations:
- SendGrid (Email)
- Twilio (SMS & WhatsApp)
- OpenWeather API (Weather data)
- Stripe (Payment processing - Future)
hiking-portal/
โโโ ๐ DEPLOYMENT.md # Complete deployment guide
โโโ ๐ CONFIGURATION.md # Environment variables reference
โโโ ๐ PRE_DEPLOYMENT_CHECKLIST.md # Pre-deployment verification
โโโ ๐ README.md # This file
โ
โโโ ๐ frontend/ # React application
โ โโโ src/
โ โ โโโ components/ # Reusable UI components
โ โ โ โโโ admin/ # Admin-specific components
โ โ โ โโโ hikes/ # Hike-related components
โ โ โ โโโ payments/ # Payment components
โ โ โ โโโ common/ # Shared components
โ โ โโโ pages/ # Page-level components
โ โ โโโ contexts/ # React Context (state management)
โ โ โโโ services/ # API integration layer
โ โ โโโ hooks/ # Custom React hooks
โ โ โโโ utils/ # Utility functions
โ โโโ public/
โ โ โโโ service-worker.js # PWA service worker
โ โ โโโ manifest.json # PWA manifest
โ โโโ .env.production # Production environment config โ ๏ธ
โ โโโ .env.local.example # Local dev config template
โ โโโ package.json
โ
โโโ ๐ backend/ # Node.js API server
โ โโโ controllers/ # Request handlers
โ โ โโโ adminController.js
โ โ โโโ hikeController.js
โ โ โโโ paymentController.js
โ โ โโโ ...
โ โโโ routes/ # API route definitions
โ โ โโโ admin.js
โ โ โโโ hikes.js
โ โ โโโ auth.js
โ โ โโโ ...
โ โโโ middleware/ # Express middleware
โ โ โโโ auth.js # JWT authentication
โ โ โโโ permissions.js # Permission checks
โ โ โโโ rateLimit.js # Rate limiting
โ โโโ services/ # Business logic
โ โ โโโ emailService.js # SendGrid integration
โ โ โโโ smsService.js # Twilio integration
โ โ โโโ socketService.js # WebSocket handling
โ โโโ config/ # Configuration
โ โ โโโ database.js # DB connection
โ โ โโโ env.js # Environment variables
โ โโโ migrations/ # Database migrations (future)
โ โโโ tools/ # Utility scripts
โ โโโ .env.example # Backend config template
โ โโโ server.js # Application entry point
โ
โโโ ๐ docs/ # Documentation
โ โโโ setup-guides/ # Getting started guides
โ โโโ deployment/ # Deployment documentation
โ โโโ architecture/ # System design
โ โโโ features/ # Feature documentation
โ โโโ development/ # Developer guides
โ โโโ configuration/ # Config guides
โ โโโ compliance/ # POPIA & security
โ โโโ mobile/ # PWA & mobile docs
โ โโโ archive/ # Archived documentation
โ
โโโ ๐ scripts/ # Deployment & utility scripts
โ โโโ pre-deploy-check.sh # Pre-deployment validation (future)
โ
โโโ ๐ docker/ # Docker configuration (local dev)
โ โโโ docker-compose.yml # Local dev environment
โ
โโโ ๐ .git/ # Git repository
- Node.js 18+ (Download)
- Google Cloud SDK (Install)
- Firebase CLI -
npm install -g firebase-tools - Git - For version control
# 1. Clone the repository
git clone https://github.com/yourusername/hiking-portal.git
cd hiking-portal
# 2. Install backend dependencies
cd backend
npm install
# 3. Configure backend (create .env file)
cp .env.example .env
# Edit .env with your local database credentials
# 4. Start backend
npm start
# Backend runs on http://localhost:5000
# 5. In a new terminal, install frontend dependencies
cd frontend
npm install
# 6. Configure frontend (for local development)
cp .env.local.example .env.local
# Edit .env.local to point to http://localhost:5000
# 7. Start frontend
npm start
# Frontend runs on http://localhost:3000# Start all services with Docker Compose
cd docker
docker-compose up -d
# Services will be available at:
# - Frontend: http://localhost:3000
# - Backend: http://localhost:5000
# - Database: localhost:5433Before deploying to production:
- Read PRE_DEPLOYMENT_CHECKLIST.md
- Complete ALL checklist items
- Follow DEPLOYMENT.md step-by-step
# 1. Deploy Backend
cd backend
gcloud run deploy backend \
--source . \
--region europe-west1 \
--project helloliam \
--allow-unauthenticated \
--set-env-vars="NODE_ENV=production,DB_USER=postgres,DB_NAME=hiking_portal,DB_HOST=/cloudsql/helloliam:us-central1:hiking-db,DB_PORT=5432,FRONTEND_URL=https://www.thenarrowtrail.co.za" \
--add-cloudsql-instances=helloliam:us-central1:hiking-db \
--set-secrets="DB_PASSWORD=db-password:latest,JWT_SECRET=jwt-secret:latest,SENDGRID_API_KEY=sendgrid-key:latest,SENDGRID_FROM_EMAIL=sendgrid-from-email:latest,OPENWEATHER_API_KEY=openweather-api-key:latest,TWILIO_ACCOUNT_SID=twilio-sid:latest,TWILIO_AUTH_TOKEN=twilio-token:latest,TWILIO_WHATSAPP_NUMBER=twilio-whatsapp-number:latest"
# 2. Deploy Frontend
cd frontend
npm run build
firebase deploy --only hostingFor complete deployment instructions, see DEPLOYMENT.md.
Monitor and manage your hiking portal directly from Home Assistant!
The Home Assistant integration has been moved to a dedicated repository for easier installation and maintenance.
๐ hiking-portal-homeassistant
1. HACS โ Integrations โ โฎ โ Custom repositories
2. Add: https://github.com/steyncd/hiking-portal-homeassistant
3. Category: Integration
4. Install "The Narrow Trail Hiking Portal"
5. Restart Home Assistant
6. Configuration โ Integrations โ Add โ "The Narrow Trail"- ๐ 24 Sensors - Hikes, notifications, weather, payments, WebSocket
- ๐จ 3 Binary Sensors - Urgent notifications, weather warnings, connection status
- ๐ Calendar - All hikes as calendar events
- โก 7 Services - Express interest, mark attendance, notifications, payments, weather
- ๐ Real-time Updates - WebSocket support for instant notifications
- โ Fixed: Backend database connection using Unix socket
- โ Fixed: All 12 users now display (pagination issue resolved)
- โ Fixed: Correct backend URL in frontend configuration
- โ Added: Smart pagination with per-page selector
- โ Added: Comprehensive deployment documentation
- โ Backend deployed to Cloud Run
- โ Frontend deployed to Firebase Hosting
- โ Database migrated to Cloud SQL
- โ Secret Manager configured
- โ SSL certificates configured
- โ Permission system audit complete
- โ User role management enhanced
- โ Mobile responsiveness improved
- โ Performance optimizations
- โ Code cleanup and organization
-
frontend/.env.production- Frontend production config- Contains backend API URL
- MUST be verified before every deployment
- See CONFIGURATION.md
-
Backend Environment - Set via Cloud Run deployment
- Environment variables set via
gcloud run deploy - Secrets stored in Secret Manager
- Database connection via Unix socket
- Environment variables set via
-
Database - Cloud SQL PostgreSQL
- Instance:
helloliam:us-central1:hiking-db - Connection: Unix socket for Cloud Run
- Backups: Automated daily
- Instance:
For complete configuration reference, see CONFIGURATION.md.
Issue: Frontend shows "Failed to fetch"
- Cause: Wrong backend URL in
.env.production - Solution: Verify URL and rebuild frontend
- See: DEPLOYMENT.md Troubleshooting
Issue: Backend database connection errors
- Cause: Using TCP IP instead of Unix socket
- Solution: Redeploy with correct
DB_HOST - See: CONFIGURATION.md
Issue: Users not all displaying
- Status: โ Fixed in latest deployment
- Solution: Frontend now requests all users with
?limit=1000
For more troubleshooting, see:
API endpoints are documented in backend/api-docs/.
Base URL (Production): https://backend-4kzqyywlqq-ew.a.run.app
Authentication: JWT Bearer token in Authorization header
Example API calls:
# Public endpoints (no auth)
GET /api/hikes/public
GET /api/public-content/mission_vision
# Authenticated endpoints
GET /api/hikes (requires login)
POST /api/hikes (requires admin)
GET /api/admin/users (requires admin)See docs/architecture/DATABASE_SCHEMA.md for complete schema documentation.
Tables:
users- User accounts and profileshikes- Hiking eventshike_interest- User registrationspayments- Payment trackingroles&permissions- Access control- And 20+ more tables
- Quick Start Guide - Get up and running
- Deployment Guide - Production deployment
- Configuration Reference - All settings explained
- Pre-Deployment Checklist - Before every deploy
- Architecture: docs/architecture/
- Features: docs/features/
- Development: docs/development/
- Compliance: docs/compliance/
- Mobile/PWA: docs/mobile/
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Backend: ESLint with Airbnb config
- Frontend: ESLint with React config
- Commits: Conventional commit messages
- Testing: Write tests for new features
Developer: Christiaan Steyn Email: steyncd@gmail.com Project: The Narrow Trail Hiking Portal Status: โ Production Ready
This project is private and proprietary.
Last Updated: October 15, 2025 Version: 2.0.0 Status: โ Production - Fully Operational