Making route planner with Django, Wagtail, geo-django and Vue

Dec. 11, 2019, 9:06 a.m.

A few days ago I’ve finally released a new version of my website "I Ride Bicycle", which allows cyclists to plan routes in a different part of the world, put photos on a map, write descriptions using WYSIWYG editor.

In a series of articles, I’m going to share how different technologies were used to build this site.

There are three user roles — visitor, user, and admin. A visitor is someone who opens a website and navigates through its pages. The user is someone who is stored in a database and is able to log in and put some new content. Admin is someone who gets notifications about new content published, can publish/unpublish routes submitted by users, create landing pages related to specific regions, provide SEO friendly descriptions, etc.

I didn’t want to bother users to manually tag their routes with different locations (cities) when a route is created. Instead, I wanted to do it automatically based on points of the route. This meant I needed to have some kind of database with locations and their respective points on a map. This also meant I had to get this database somewhere.

SEO also was an important topic with the following requirements:

With all that in mind and some previous experience I decided to choose the following tech stack:

For the frontend, I was considering multiple options, based on Vue. The very first idea was to use Nuxt.js which is a very cool framework built on top of Vue, Vue Router, Vue SSR and which makes creating hybrid applications (frontend and serverside rendered) quite easy. Another benefit of Nuxt.js is that you create your Vue components with all styles in one codebase, without the need to switch between separate CSS files and js code. After some experiments, I decided to abandon this approach because it was adding quite a lot of complexity to my code. So the final decision was to use Django’s templates and create multiple Vue applications that could be then added to pages. Here’s the final list: