Note
MotoTwist is a personal hobby project. I am open-sourcing it because others might find it useful, but I make no guarantees about bug fixes, feature requests, or support timelines. I work on this when it's fun for me!
Track the Thrill. Rate the Road.
📑 Documentation | 🏍 Web App (Coming Maybe)
MotoTwist is the ultimate companion for every motorcycle enthusiast. Discover, track, and save your most epic journeys. MotoTwist allows you to define and rate motorcycle roads, both paved and unpaved, on various criteria. Weather conditions at the time of ride are also recorded: maybe a rainy day ruined a certain ride, but it's amazing in the sun! MotoTwist has support for multiple users, advanced filters help anyone find the exact road for them and the current conditions, and an ability to export it all to GPX and take it with you.
Share your favorite roads with a community of fellow riders and find your next great adventure, recommended by those who've ridden it before.
Follow these steps to set up and run the application in development mode.
-
Clone the repository:
git clone git@github.com:amot-dev/MotoTwist.git cd MotoTwist -
Configure environment variables: Find
.env.examplein the project's root directory. Copy this into your own.envfile. Uncomment the developer options. -
Build and run the containers: Use Docker Compose to build the image and start the services. A handy
build.shscript exists that does just this, as well as a few other things. -
Access the application: Open your web browser and navigate to
http://localhost:8000. -
Load mock data: With debug mode enabled, admin users will have access to the debug page, which allows saving and loading the current database state, as well as seeding random rides.
Tip
Saving rides is mostly useless unless you're using debug mode to migrate your data. Prefer saving Twists and seeding ride data after loading.
-
Set up a
venv: This is recommended for static analysis.python -m venv .venv source .venv/bin/activate python -m pip install pip -U # optional python -m pip install requirements.txt # for exact pinned versions python -m pip install requirements.in # for latest versions (untested)
-
Start Developing: More thorough documentation for this is coming (maybe), but I'm sure you can figure it out.
-
Updating packages: High-level dependencies are stored in
requirements.inand versions are pinned inrequirements.txt. Pending a more robust package management system than pip (too busy to switch over at the moment), the process is as follows:python -m pip install --upgrade pip pip-audit pip-tools # Install dev dependencies python -m pip install -r requirements.in # Install dependencies python -m pip piptools compile --upgrade requirements.in # Update requirements.txt python -m pip_audit -r requirements.txt # Check for vulnerabilities
Ensure the new versions are well-tested. If the Python version goes up, ensure the image is updated in the
Dockerfiletoo.
Tip
You may run mototwist in an interactive terminal with:
docker compose run --service-ports mototwistTip
Email functionality can be tested with MailHog (included by docker-compose.override.yml):
# Email Options
EMAIL_ENABLED=True
SMTP_HOST="mailhog"
SMTP_PORT=1025
SMTP_USERNAME="anything"
SMTP_PASSWORD="anything"
SMTP_FROM_EMAIL="anything@anything.com"
SMTP_USE_TLS=FalseNavigate to http://localhost:8025 to view the fake inbox.
- Migrate the database if needed:
If you make any model changes, you'll need to make a migration from them. All migrations are applied to the database on container restart.
docker compose run --rm mototwist create-migration "Your very descriptive message"
Tip
If you want to modify criteria, make changes to initialize_criteria in app/services/rides.py and restart with a fresh database.
