Skip to content

This repo contains app that has ability to sign up user for fitness class. 🏊🚴🏃

License

Notifications You must be signed in to change notification settings

mihalw28/fitness_app

Repository files navigation

Fitness App

🏊🚴🏃

Build Status Code style: black

This repostitory contains source code of an app that is able to auto signup user to fitness class. The main idea behind this work was to automate things using python and make life easier. Many of us attending gym classes probably know the pain of trying to sign up for our favorite class and realized that it has been just fully booked. 😞 To help prevent such situations, automatic registration could be a good solution.

Default gym app doesn't allow to schedule trainings and signup automatically.

✔️ Pros of this solution:
  • There is no pain if you forgot to sign up to your favourite class.
  • It is a convinient solution.
  • Works in parallel with default gym app.
❗ Cons:
  • Works only on gym site that was designed for. After small changes it could also works for almost any other gym with website signups.
  • This type of scripts with auto loggin and auto signup functions could be unwated.
  • Due to the nature of this app, it generates real costs working deployed - Twillio & AWS.

🔨 How it works - gerneral:

  1. Registration and creation of user profile - gym selection and class(es).
  2. The app will scrap gym website at appropriate intervals to find out if user registration for class is possible. (Registration for classes are open 36 hours before given class starts.)
  3. After correctly subscribing to training the user recievs a confirmation via 📱
  4. If user wouldn't accept a confirmation from the app, his/her place in training will be unbooked 4 hours before the start.

How it works - backend:

  1. Flask app uses blueprints objects.
  2. App is deployed on AWS using docker containers. Pre-configured container uses headless chrome browser and selenium testing package.
  3. Scrapping module is an inner part of the application.
  4. DB used: AWS PostgreSQL.

Main goals to accomplish:

  1. Firstly I had an idea of deploying app on Heroku, but that idea is not alive now. Foremost it's necessary to create API endpoints for scrapping gym website using AWS Lambda. AWS Lambda connected to DB instance within VPC generates high costs, so this idea has been dropped. Scrapping module is placed within the main app.
  2. Tests.
  3. Replace some app modules with Lambda functions and add new ones.
  4. Create API endpoints to handle HTTP requests - API Gateway.
  5. Create complete REST API.
  6. Set time intervals using cron jobs - APScheduler.
  7. Make some more user friendly frontend.

Improvement ideas:

  1. Add an option to select more than one discipline and more than one training a day.

Made with ☕ using:

Credits:

  • Fitness App is based on microblog application skeleton from The Flask Mega Tutorial by Miguel Grinberg
  • Dockercontainer for running Python Selenium in headless Chromeclick
  • Basic testing flask web app with Selenium click

Additional info

As an autor of this app I'm still a beginner 🔰 python programmmer constantly learning. I don't know many programming tricks and hacks. Many more experienced developers probably know better/easier solutions. I will be very grateful for suggestions where to go next. I'm open for constructive criticism.

License:

MIT license Twitter URL

About

This repo contains app that has ability to sign up user for fitness class. 🏊🚴🏃

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages