BikeNav ๐ฒ
A simple web app to help you find nearby bike parking.
I love biking places. I especially love biking to new places. Unfortunately, in our imperfect world, I never know if or where there will be a place to lock my bike at my destination. I often would spend time scouring Google Maps satelite images and street view to try to figure out what I do with my bike.
I got fed up with it, and created BikeNav! Using OpenStreetMap APIs, with BikeNav you can now easily find parking near you or get biking directions to the closest parking to your destination.
This application was one of my first forays into what the "cool kids" call "vibe coding" ๐ The original prototype was built using Builder.io, and for refinement and additional features I used the OpenCode CLI
๐ ๏ธ Tech Stack
This is a fully client-side app, making use of open-source mapping tools and APIs.
- Frontend: React 18 + TypeScript + Vite
- Styling: TailwindCSS 3 + Radix UI components
- Mapping: Leaflet + React Leaflet
- Routing: React Router 6
- Data: OpenStreetMap APIs (Nominatim + OSRM)
- Testing: Vitest
- Icons: Lucide React
๐ Getting Started
Prerequisites
Local Development Setup
Clone the repository
git clone https://github.com/algabl/bikenav cd bikenav
Install dependencies
npm install
Start the development server
npm run dev
The application will be available at http://localhost:8080.
๐ Available Scripts
npm run dev
- Start development server at http://localhost:8080npm run build
- Build for productionnpm run preview
- Preview production build locallynpm test
- Run unit testsnpm run typecheck
- TypeScript type checkingnpm run format.fix
- Format code with Prettier
๐ Production Deployment
Static Build
npm run build
npm run preview
The app builds to a static site that can be deployed to any static hosting service like:
- Netlify
- Vercel
- GitHub Pages
- AWS S3 + CloudFront
๐๏ธ Project Structure
client/ # React SPA frontend
โโโ api/ # API interface layer
โโโ components/ # React components
โ โโโ ui/ # Reusable UI components (Radix + Tailwind)
โ โโโ Map.tsx # Leaflet map component
โ โโโ SearchBox.tsx # Location search with geocoding
โ โโโ DirectionsList.tsx # Parking location results
โ โโโ RouteDisplay.tsx # Route information display
โ โโโ ModeSelector.tsx # Toggle between parking/directions
โโโ hooks/ # Custom React hooks
โโโ lib/ # Core business logic
โ โโโ bicycle-parking.ts # OSM bicycle parking data fetching
โ โโโ routing.ts # OSRM bike route calculation
โ โโโ types.ts # TypeScript type definitions
โ โโโ utils.ts # Utility functions
โโโ pages/ # Route components
โ โโโ Index.tsx # Main app page
โ โโโ NotFound.tsx # 404 page
โโโ App.tsx # App entry point with routing
โโโ global.css # TailwindCSS styles
public/ # Static assets
โโโ favicon.ico
โโโ robots.txt
Configuration files:
โโโ package.json # Dependencies and scripts
โโโ tsconfig.json # TypeScript config
โโโ tailwind.config.ts # TailwindCSS config
โโโ vite.config.ts # Vite build config
โโโ components.json # Radix UI component config
๐งช Features
Interactive Map
- Leaflet-powered mapping with OpenStreetMap tiles
- Click-to-select locations for easy route planning
- Real-time markers for start, destination, and parking locations
- Route visualization with turn-by-turn directions overlay
Two Core Modes
Parking Mode
- Find bicycle parking near any destination
- Search by address using Nominatim geocoding
- Distance and amenity info for each parking location
- Visual markers showing parking availability and type
Directions Mode
- Full bike route planning from start to destination
- Optimal routing using OSRM bike-specific routing
- Turn-by-turn directions with distance and duration
- Parking integration - routes can include nearby bike parking
Smart Search
- Address autocomplete with geocoding suggestions
- Current location detection with GPS integration
- Manual map selection by clicking anywhere
- Location permission prompts for enhanced UX
Responsive Design
- Mobile-first interface optimized for on-the-go use
- Desktop-friendly with expanded sidebars and controls
- Smooth animations and transitions between modes
- Accessible UI built with Radix primitives
Open Source Data
- OpenStreetMap for all mapping and location data
- No API keys required - fully client-side operation
- Community-driven bicycle infrastructure data
- Real-time updates as OSM data improves