← Back to projects2024
SendaDigital
Hiking website with 3D route visualisation. Bachelor’s thesis.
SendaDigital is my bachelor’s thesis: a website to discover, publish and share hiking routes. Each route is uploaded as a GPX file and shown on a 3D terrain map, with its elevation profile, its stats and the photos from the hike placed where they were taken.
- Client
- Bachelor’s thesis · ETSIIT, University of Granada
- My role
- Analysis, design, development and documentation
Architecture
Two repositories: an Angular frontend with server-side rendering and a FastAPI API deployed on Render, with MySQL as the database.
01
Frontend · Angular 17
Standalone components and SSR
Server-side rendering with Express. An interceptor adds the token and guards protect the profile, new-route and edit pages.
MapTiler SDK (MapLibre GL)
A map with 3D relief from a digital elevation model.
togeojson, Chart.js and exifr
Converting the GPX, drawing the elevation profile and reading the photos’ GPS position.
- ↓→
02
API · FastAPI on Render
Users, routes and verification routers
Routes, images, followers, profile and sign-up.
JWT and bcrypt
Login with python-jose and passwords with passlib.
- ↓→
03
Data
MySQL
Users, routes, images and follow relationships.
API files
GPX files and photos, served as static files.
Gmail SMTP
Verification email on sign-up.
How data flows
- When a GPX file is chosen, the browser converts it to GeoJSON and works out distance, elevation gain and loss, highest and lowest altitude, average speed and estimated time before uploading anything.
- The route is sent as a multipart form (the data as JSON plus the GPX); the API stores the file and the MySQL row, and adds the kilometres to the user’s total.
- For each photo, the browser reads the EXIF coordinates and only accepts those taken near the track; the API stores them with their position.
- When a route is opened, the map downloads its GPX, draws it segment by segment over the 3D terrain and frames the track; below, Chart.js draws the elevation profile.
- On sign-up, the API stores the user provisionally and emails a token; opening the link creates the account.
- The home page shows routes from the users you follow, and the explorer places them all on the map.
Technical challenges
From GPX to 3D relief
A GPX file is XML with latitude, longitude and altitude points. I convert it to GeoJSON in the browser and draw it over a map with a digital elevation model and a tilted camera; the map fits and is limited to the route’s area so it doesn’t get lost.
Stats without waiting for the server
Distance comes from adding up the haversine formula between each pair of points, and elevation from accumulating climbs and descents. Everything is computed in the browser when the file is chosen, so users see their route’s data before publishing it.
Routes that start in the same place
Many routes start from the same car park, and their markers in the explorer ended up on top of each other. When a route is saved and another one already sits at that point, the API moves the marker around the original, widening the radius on each lap, until it finds a free spot.
Photos where they were taken
Phone photos store their GPS position in their EXIF metadata. With exifr I read it before uploading, discard those far from the track and place the rest on the map where they were taken.
What I’d do differently today
- Recalculate the stats on the server from the GPX, instead of trusting the ones the browser sends.
- Store GPX files and photos in object storage (S3 or R2): on Render’s free plan the disk doesn’t persist between deploys.
- An ORM with migrations and a connection pool, instead of hand-written SQL and a new connection per query.
- Geographic queries with spatial indexes to search routes by area.
- CORS limited to the frontend’s domain, plus API tests with pytest and flow tests with Playwright, with CI.
Stack
- Angular
- TypeScript
- FastAPI
- Python
- MySQL
- MapTiler
- Chart.js
- Figma
- Jira
- GitHub
← Back to projects