Skip to content

Alex-Just/gymlog-backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gymlog Backend

Gymlog is a workout tracking application designed to help users manage and record their fitness routines efficiently. This repository contains the backend code for the Gymlog application, which handles the core logic, data storage, and API endpoints. The backend is built with a focus on scalability and performance, using modern technologies and best practices.

Frontend Backend CI

Built with Cookiecutter Django Ruff

Logo Logo

Table of Contents

This updated structure maintains a clear and concise outline for easy navigation of your project's documentation.

Features

  • Workout Tracking: Log exercises, sets, and reps for different workouts.
  • Progress Monitoring: View progress over time with charts and stats.
  • Custom Routines: Create and manage custom workout routines.
  • Profile Management: Update personal information and track personal bests.

Technologies Used

  • Python: The primary programming language used for backend development.
  • Django: A high-level Python web framework that encourages rapid development and clean, pragmatic design.
  • Django Rest Framework (DRF): A powerful and flexible toolkit for building Web APIs.
  • PostgreSQL: A powerful, open-source object-relational database system.
  • Celery: An asynchronous task queue/job queue based on distributed message passing.
  • Redis: An in-memory data structure store, used as a database, cache, and message broker.
  • Docker: A set of platform-as-a-service products that use OS-level virtualization to deliver software in packages called containers.
  • GitHub Actions: Used for continuous integration and deployment.

Tech Features

  • 12-Factor based settings via django-environ
  • Secure by default. We believe in SSL.
  • Registration via django-allauth
  • Send emails via Anymail (using Mailgun by default or Amazon SES if AWS is selected cloud provider, but switchable)
  • Media storage using Amazon S3, Google Cloud Storage, Azure Storage or nginx
  • Docker support using docker-compose for development and production (using Traefik with LetsEncrypt support)
  • Procfile for deploying to Heroku
  • Instructions for deploying to PythonAnywhere
  • Run tests with unittest or pytest
  • Customizable PostgreSQL version
  • Default integration with pre-commit for identifying simple issues before submission to code review

Constraints

  • Only maintained 3rd party libraries are used.
  • Uses PostgreSQL everywhere: 12 - 16.
  • Environment variables for configuration (This won't work with Apache/mod_wsgi).

Basic Commands

Setting Up Your Users

  • To create a normal user account, just go to Sign Up and fill out the form. Once you submit it, you'll see a "Verify Your E-mail Address" page. Go to your console to see a simulated email verification message. Copy the link into your browser. Now the user's email should be verified and ready to go.

  • To create a superuser account, use this command:

    $ python manage.py createsuperuser
    

For convenience, you can keep your normal user logged in on Chrome and your superuser logged in on Firefox (or similar), so that you can see how the site behaves for both kinds of users.

Type checks

Running type checks with mypy:

$ mypy gymlog

Test coverage

To run the tests, check your test coverage, and generate an HTML coverage report:

$ coverage run -m pytest
$ coverage html
$ open htmlcov/index.html

Running tests with pytest

$ pytest

Celery

This app comes with Celery.

To run a celery worker:

cd gymlog
celery -A config.celery_app worker -l info

Please note: For Celery's import magic to work, it is important where the celery commands are run. If you are in the same folder with manage.py, you should be right.

To run periodic tasks, you'll need to start the celery beat scheduler service. You can start it as a standalone process:

cd gymlog
celery -A config.celery_app beat

or you can embed the beat service inside a worker with the -B option (not recommended for production use):

cd gymlog
celery -A config.celery_app worker -B -l info

About

A Workout Tracker App built with Django

Topics

Resources

License

Stars

Watchers

Forks

Contributors 2

  •  
  •