A modern web application for ski resort visitors that serves as both a digital ski pass and a slope tracker/analyzer. Built with React, Vite, Tailwind CSS, and Node.js.
- QR code-based lift access
- Real-time validity status
- Resort information display
- Activate/deactivate functionality
- Scan simulation for lift gates
- GPS track visualization using Leaflet
- Start, end, and max speed markers
- Auto-fit bounds to track
- OpenStreetMap tiles
- Mobile-friendly zoom and pan
- Speed over time chart
- Altitude over time chart
- Key metrics display:
- Total distance
- Max speed
- Vertical drop
- Duration
- Additional trip statistics
- Node.js - Runtime
- Express - Web framework
- CORS - Cross-origin resource sharing
- React 18+ - UI library
- Vite - Build tool
- Tailwind CSS - Styling
- Shadcn UI - Component library
- react-leaflet - Map visualization
- Recharts - Charts
- qrcode.react - QR code generation
- Lucide React - Icons
skiSnowHack26/
βββ backend/
β βββ server.js # Express API server
β βββ package.json # Backend dependencies
β βββ .gitignore # Git ignore rules
βββ frontend/
β βββ src/
β β βββ components/
β β β βββ ui/ # Shadcn UI components
β β β βββ SkiPass.jsx
β β β βββ SlopeMap.jsx
β β β βββ Analytics.jsx
β β β βββ TripSelector.jsx
β β βββ utils/
β β β βββ dataParser.js
β β β βββ cn.js
β β βββ App.jsx
β β βββ main.jsx
β β βββ index.css
β βββ index.html
β βββ vite.config.js
β βββ tailwind.config.js
β βββ postcss.config.js
β βββ package.json
βββ JSON/ # Trip data files
βββ README.md
- Node.js 18+ installed
- npm or yarn package manager
-
Clone the repository
git clone <repository-url> cd skiSnowHack26
-
Install backend dependencies
cd backend npm install -
Install frontend dependencies
cd frontend npm install
-
Start the backend server
cd backend npm startThe backend will run on
http://localhost:3001 -
Start the frontend development server (in a new terminal)
cd frontend npm run devThe frontend will run on
http://localhost:3000 -
Open your browser Navigate to
http://localhost:3000
Returns a list of all available trips.
Response:
[
{
"id": "trip_20260116_085444_059C4C69",
"filename": "trip_20260116_085444_059C4C69.json",
"date": "2026-01-16 08:54"
}
]Returns detailed data for a specific trip.
Response:
{
"id": "trip_20260116_085444_059C4C69",
"data": { /* raw trip data */ },
"metadata": {
"totalEntries": 330,
"hasGPS": true
}
}Health check endpoint.
Response:
{
"status": "ok",
"timestamp": "2024-01-16T10:00:00.000Z"
}Trip data is stored as JSON files with Unix timestamps as keys:
{
"1768553684428": {
"accelerometer": {
"x": 0.345,
"y": -0.055,
"z": -0.924,
"magnitude": 0.988
},
"gyroscope": {
"x": 0.301,
"y": -0.393,
"z": -0.656,
"magnitude": 0.822
},
"gps": {
"latitude": 46.99,
"longitude": 10.32,
"altitude": 2622.90,
"speed": 1.49,
"course": 48.16,
"horizontalAccuracy": 19.39
}
}
}The application processes raw trip data through several steps:
- GPS Filtering - Removes points with accuracy > 50m
- Distance Calculation - Uses Haversine formula for accurate distances
- Metric Computation - Calculates max speed, vertical drop, duration
- Visualization - Formats data for maps and charts
- Primary: Sky Blue (
#0ea5e9) - Secondary: Slate (
#64748b) - Success: Green (
#22c55e) - Warning: Orange (
#f59e0b) - Danger: Red (
#ef4444)
- Sans-serif font family
- Large, legible numbers for metrics
- Clear labels for all data points
- Touch-friendly UI elements
- Compact layouts for small screens
- Swipe gestures for map interaction
- Optimized chart tooltips for touch
cd backend
npm install --production
npm startcd frontend
npm run buildThe built files will be in the frontend/dist directory.
The backend can be deployed to any Node.js hosting service:
- Heroku
- Railway
- Render
- AWS EC2
- DigitalOcean
The frontend can be deployed to any static hosting service:
- Vercel
- Netlify
- GitHub Pages
- AWS S3 + CloudFront
Note: Update the API base URL in production builds to point to your deployed backend.
- Check if port 3001 is already in use
- Ensure Node.js is installed correctly
- Check the console for error messages
- Ensure the backend is running on port 3001
- Check CORS settings in
backend/server.js - Verify the API proxy configuration in
frontend/vite.config.js
- Check browser console for Leaflet errors
- Ensure
react-leafletandleafletare installed - Verify CSS imports for Leaflet
- Check if
rechartsis installed - Verify data format matches chart expectations
- Check browser console for errors
Contributions are welcome! Please feel free to submit a Pull Request.
ISC
- OpenStreetMap for map tiles
- Leaflet for map library
- Recharts for charting
- Shadcn UI for component library
- Lucide for icons
For questions or support, please open an issue on the repository.
Built with β€οΈ for skiers everywhere