# Project export: QuickFit

This document was generated by HackStack to give an AI agent context about a hackathon project. Sections are labeled with their provenance; content marked as truncated was cut to keep this document small.

## Project metadata

- Hackathon: Cal Hacks 10.0
- Tagline: Exercise has never been this motivating
- Devpost: https://devpost.com/software/quickfit-dyl9tn
- GitHub: https://github.com/manuell191/CalHacksFitness
- Team: 2 GitHub contributor(s) — Manuel Samaniego (24 commits), Junguilo (20 commits)

## Devpost submission (written by the team)

### What it does

Our Fitness app is designed for anyone to achieve their dream body. We found that other fitness apps tend to be demotivating when reaching our goals in the gym. We wanted to create an experience that would give you many options about how to attain your ideal body weight through different exercises while giving you a reason to come back. Using our app any user is able to create a profile, storing the user's height and weight for their BMI to be calculated. The app is intended to be used daily, as we have a ToDo list just for the exercises they have chosen for once they signed into their account.

### How we built it

The technologies used in this project is Django, Python, HTML, and CSS.

### Challenges we ran into

We found that we were too ambitious when it comes to trying out new things, which ended up with none of what we envisioned of using, such as MindDB and CockroachDB. Spent a lot of time learning it and fixing bugs while learning it realizing it's eating up a lot of our time until it's too late.

### Accomplishments we're proud of

We're proud we got a finished project up and running. We went beyond our limit when making the UI, and the backend was very clean for this being the first time that most of us used Django.

### What we learned

We learned a lot about the back end side of web development.

### What's next

We would like to continue by integrating an AI virtual trainer and add more incentives to keep users fit compared to other apps.

## README (from the GitHub repository)

# QuickFit
*Project made for CalHacks 2023*
![Screenshot of widget screen.](QuickFitScren.png)

Our Fitness app is designed for anyone to achieve their dream body. 
We found that other fitness apps tend to be demotivating when reaching our goals in the gym. We wanted to create an experience that would give you many options about how to attain your ideal body weight through different exercises while giving you a reason to come back.

Using our app any user is able to create a profile, storing the user's height and weight for their bmi to be calculated. The app is intended to be used daily, as we have a ToDo list just for the exercises they have chosen for once they signed into their account.

The technologies used in this project is Django, Python, HTML, and CSS. 





## Detected evidence (automated analysis)

Indexed codebase: 23 recognized source files, 20 KB.
- CSS (language) — detected in the code
- HTML (language) — detected in the code
- Python (language) — detected in the code
- Django (technology) — claimed on Devpost, not found in the code

## Codebase structure (from repository index)

### Files (24 of 24)

```
db.sqlite3
fitness/__init__.py
fitness/asgi.py
fitness/settings.py
fitness/urls.py
fitness/wsgi.py
fitnessApp/__init__.py
fitnessApp/admin.py
fitnessApp/apps.py
fitnessApp/forms.py
fitnessApp/migrations/__init__.py
fitnessApp/migrations/0001_initial.py
fitnessApp/models.py
fitnessApp/static/styles.css
fitnessApp/templates/base.html
fitnessApp/templates/home.html
fitnessApp/templates/login.html
fitnessApp/templates/setup.html
fitnessApp/templates/signup.html
fitnessApp/tests.py
fitnessApp/urls.py
fitnessApp/views.py
manage.py
README.md
```

### Dependencies

No dependency index available.

### Recent commits (newest first)

- ui
- button
- Update README.md
- Update README.md
- Add files via upload
- Delete CalHacksScreen.png
- Update README.md
- Create README.md
- Add files via upload
- Merge pull request #5 from manuell191/css-stuff
- CSS
- Adds admin func
- Merge pull request #4 from manuell191/CRUD-operations
- Changes
- Sign in/up views
- sql
- test
- t
- Merge branch 'master' of https://github.com/manuell191/CalHacksFitness
- views

## Key source files (fetched from GitHub, selected and truncated for size)

### manage.py

```python
#!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys


def main():
    """Run administrative tasks."""
    os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'fitness.settings')
    try:
        from django.core.management import execute_from_command_line
    except ImportError as exc:
        raise ImportError(
            "Couldn't import Django. Are you sure it's installed and "
            "available on your PYTHONPATH environment variable? Did you "
            "forget to activate a virtual environment?"
        ) from exc
    execute_from_command_line(sys.argv)


if __name__ == '__main__':
    main()

```

### fitnessApp/tests.py

```python
from django.test import TestCase

# Create your tests here.

```

### fitnessApp/admin.py

```python
from django.contrib import admin
from .models import Profile

# Register your models here.
admin.site.register(Profile)
```

### fitnessApp/apps.py

```python
from django.apps import AppConfig


class FitnessappConfig(AppConfig):
    default_auto_field = 'django.db.models.BigAutoField'
    name = 'fitnessApp'

```

### fitnessApp/urls.py

```python
from django.urls import path
from . import views

urlpatterns = [
    path('', views.home, name='home'),
    path('login/', views.userLogin, name='login'),
    path('signup/', views.signup, name='signup'),
    path('signup/<pk>/', views.setup, name='setup'),
    path('logout/', views.userLogout, name='logout')
]

```

### fitness/asgi.py

```python
"""
ASGI config for fitness project.

It exposes the ASGI callable as a module-level variable named ``application``.

For more information on this file, see
https://docs.djangoproject.com/en/4.2/howto/deployment/asgi/
"""

import os

from django.core.asgi import get_asgi_application

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'fitness.settings')

application = get_asgi_application()

```

### fitness/wsgi.py

```python
"""
WSGI config for fitness project.

It exposes the WSGI callable as a module-level variable named ``application``.

For more information on this file, see
https://docs.djangoproject.com/en/4.2/howto/deployment/wsgi/
"""

import os

from django.core.wsgi import get_wsgi_application

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'fitness.settings')

application = get_wsgi_application()

```

### fitnessApp/models.py

```python
from django.db import models
from django.contrib.auth.models import User

GOAL_BODY_TYPE = (
    ("LEAN", "Lean"),
    ("BUFF", "Buff"),
    ("CUT", "Cut"),
    ("BULK", "Bulk")
)


#Create your models here.
class Profile(models.Model):
    user = models.OneToOneField(User, on_delete=models.CASCADE)
    bmi = models.IntegerField(default=0)
    weight = models.IntegerField(default=0)
    height = models.IntegerField(default=0)
    goal = models.CharField(
        max_length = 20,
        choices = GOAL_BODY_TYPE,
        default = 'LEAN'
    )
    def str(self):
        return self.user.username

```

### fitness/urls.py

```python
"""
URL configuration for fitness project.

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/4.2/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path, include

urlpatterns = [
    path('admin/', admin.site.urls),
    path('', include('fitnessApp.urls'))
]

```

### fitnessApp/forms.py

```python
from django import forms
from .models import GOAL_BODY_TYPE

class LoginForm(forms.Form):
    def __init__(self, *args, **kwargs):
        super(LoginForm, self).__init__(*args, **kwargs)
        self.fields['username'].widget.attrs.update({
            'autocomplete': 'off'
        })
    
    username = forms.CharField(label='Username', max_length=20, required=True)
    password = forms.CharField(label='Password', widget=forms.PasswordInput, required=True)

class SignupForm(forms.Form):
    def __init__(self, *args, **kwargs):
        super(SignupForm, self).__init__(*args, **kwargs)
        self.fields['username'].widget.attrs.update({
            'autocomplete': 'off'
        })
    
    username = forms.CharField(label='Username', max_length=20, required=True)
    password1 = forms.CharField(label='Password', widget=forms.PasswordInput, required=True)
    password2 = forms.CharField(label='Password (again)', widget=forms.PasswordInput, required=True)

class SetupForm(forms.Form):
    def __init__(self, *args, **kwargs):
        super(SetupForm, self).__init__(*args, **kwargs)
        #self.fields['username'].widget.attrs.update({
        #    'autocomplete': 'off'
        #})
    
    weight = forms.IntegerField(label='Weight (pounds)', required=True)
    height = forms.IntegerField(label='Height (inches)', required=True)
    goal = forms.ChoiceField(label='Goal/Ideal Body Type', choices=GOAL_BODY_TYPE, required=True)

class UpdateForm(forms.Form):
    def __init__(self, *args, **kwargs):
        super(UpdateForm, self).__init__(*args, **kwargs)
    
    weight = forms.IntegerField(label='Weight (pounds, negative if you lost weight)', required=True)
```

[9 more indexed source files omitted to keep this export small. The full file list is in the Codebase structure section above.]