Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
da82339
Minor bug fixes
cejiogu Jan 27, 2026
a9da9a6
Modify workout and user tables enable streaks and goal changes
cejiogu Feb 18, 2026
cb6560d
Refactor GraphQL schema
cejiogu Feb 18, 2026
dabf2f9
Implement active streaks for users
cejiogu Feb 18, 2026
872bc07
initial commit
Feb 20, 2026
fdeb0e1
Modify streak resolvers to account for changes in user workout goals
cejiogu Feb 22, 2026
1d4ec97
Add lastStreakStart field and resolver, ensure streaks consider worko…
cejiogu Feb 24, 2026
dab7e7f
add deleteReport mutation
Feb 25, 2026
2545a52
Bug fix: Adjust time when workout goal changes go in effect
cejiogu Feb 25, 2026
c3c91a9
Convert backend times to utc, transition from deprecated library
cejiogu Feb 25, 2026
d8625ab
Final bug fixes with local time to utc conversion
cejiogu Feb 25, 2026
a6e9032
Rename and refactor lastStreakStart resolver
cejiogu Feb 25, 2026
bd50c04
Remove dev parameters from mutation to set workout goal
cejiogu Feb 25, 2026
cd54998
Merge pull request #227 from cuappdev/add_report_sheet
sophiestrausberg Feb 26, 2026
c871905
Generalize code and remove extra comments
cejiogu Mar 1, 2026
add4eb6
Remove extra comments
cejiogu Mar 2, 2026
149f584
Debug timezone conversions
cejiogu Mar 2, 2026
6e6247d
Resolve migration issues
cejiogu Mar 2, 2026
9ab9efb
Merge
cejiogu Mar 2, 2026
8b853ad
Merge again
cejiogu Mar 2, 2026
55a2360
Merge branch 'master' into chimdi/workout-logging-testing
cejiogu Mar 2, 2026
ed0770b
Merge pull request #226 from cuappdev/chimdi/workout-logging-testing
cejiogu Mar 2, 2026
fbfb360
Changed assets to use S3 buckets
JoshD94 Mar 5, 2026
ffb3042
Moved migration run from dockerfile to workflow file
JoshD94 Mar 5, 2026
1ab36b4
mounted certs when running migrations
JoshD94 Mar 5, 2026
fcd5723
Try fixing migrations
JoshD94 Mar 6, 2026
9e01dd4
Try fixing migrations
JoshD94 Mar 6, 2026
3e7ffb9
Try fixing migrations 3
JoshD94 Mar 6, 2026
3fefa5e
Try fixing migrations 4: remove pricetype error
JoshD94 Mar 6, 2026
f0cb96b
Try fixing migrations 5: remove pricetype error
JoshD94 Mar 6, 2026
aba9db7
Try fixing migrations 6: gear table fix
JoshD94 Mar 6, 2026
4304cc6
Migration: backfill last_streak in users to be nullable False
JoshD94 Mar 6, 2026
4caf1f5
Update workflow: prune unused images
JoshD94 Mar 6, 2026
43c6267
Add health endpoint
JoshD94 Mar 6, 2026
e1977e0
initial commit
Mar 7, 2026
6b0fa9e
fix upload
Mar 7, 2026
7725404
Merge pull request #230 from cuappdev/fix-image-upload
sophiestrausberg Mar 9, 2026
9f19fbd
Remove user field from WorkoutGoalHistory type
cejiogu Mar 9, 2026
ee67ebd
Make lastStreak field DateTime object, modify timezone info
cejiogu Mar 9, 2026
e87b6e9
Add workout history field to User type
cejiogu Mar 9, 2026
c0cc759
Merge pull request #229 from cuappdev/josh-health
JoshD94 Mar 10, 2026
f5c459a
Merge pull request #231 from cuappdev/chimdi/api-refactoring
cejiogu Mar 10, 2026
1d3b4fa
logs
Mar 18, 2026
56c26c8
Merge pull request #233 from cuappdev/logs
sophiestrausberg Mar 18, 2026
d506b55
Added log
yitbrekmata Mar 20, 2026
57df772
Merge branch 'master' into yitbrek/logs
yitbrekmata Mar 20, 2026
da2e14b
Merge pull request #234 from cuappdev/yitbrek/logs
yitbrekmata Mar 20, 2026
67567c5
Changes to how users are added and deleted
yitbrekmata Mar 22, 2026
ae9b13e
Merge branch 'master' into yitbrek/users
yitbrekmata Mar 22, 2026
8700d06
Minor syntax fix
yitbrekmata Mar 22, 2026
4275cdd
Merge branch 'yitbrek/users' of https://github.com/cuappdev/uplift-ba…
yitbrekmata Mar 22, 2026
b42a0cc
Fixed minor logging errors and profile picture upload checks
yitbrekmata Mar 22, 2026
9aaad16
Updated EditUser mutation and added auth checks
yitbrekmata Mar 24, 2026
e795681
Minor bug fixes
yitbrekmata Mar 24, 2026
6fbd1bc
Minor auth bug fix
yitbrekmata Mar 24, 2026
8caf28f
More bug fixes
yitbrekmata Mar 24, 2026
899a29d
Merge pull request #235 from cuappdev/yitbrek/users
JoshD94 Mar 25, 2026
a71a3d6
fix bug
tnt07-t Apr 12, 2026
bd3afe1
Merge pull request #236 from cuappdev/tran/quick-fix
tnt07-t Apr 12, 2026
288e432
fix
tnt07-t Apr 12, 2026
d23ec78
Merge pull request #237 from cuappdev/tran/fix
tnt07-t Apr 12, 2026
c302ab6
g
tnt07-t Apr 12, 2026
4fdde05
Merge pull request #238 from cuappdev/tran/fix
tnt07-t Apr 12, 2026
452fecf
update schema.py
tnt07-t Apr 12, 2026
63bcc1c
jiwon's fix 3
JiwonJeong414 Apr 12, 2026
9deefde
update schema
JiwonJeong414 Apr 12, 2026
cd3aba3
Merge pull request #240 from cuappdev/jiwon/auth-bug
JiwonJeong414 Apr 12, 2026
ebad7fa
bug
JiwonJeong414 Apr 12, 2026
df256bb
Merge pull request #241 from cuappdev/jiwon/auth-bug
JiwonJeong414 Apr 12, 2026
e3c5dd8
update schema
JiwonJeong414 Apr 12, 2026
c265893
Merge pull request #242 from cuappdev/jiwon/auth-bug
JiwonJeong414 Apr 12, 2026
eceaed1
logs
JiwonJeong414 Apr 12, 2026
e19eb11
Merge pull request #243 from cuappdev/jiwon/image-bug
JiwonJeong414 Apr 12, 2026
dd36d62
quick fix
JiwonJeong414 Apr 12, 2026
8111791
Merge pull request #244 from cuappdev/jiwon/image-bug
JiwonJeong414 Apr 12, 2026
f3bf1ce
restart
JiwonJeong414 Apr 19, 2026
77bd69d
Merge pull request #245 from cuappdev/jiwon/image-bug
JiwonJeong414 Apr 19, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,6 @@ build/

.env

Archive
Archive

service-account-key.json
9 changes: 4 additions & 5 deletions .github/workflows/deploy-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,9 @@ jobs:
source tags
export IMAGE_TAG=${{ steps.vars.outputs.sha_short }}
cd docker-compose
docker stack rm the-stack
sleep 20s
sudo systemctl stop nginx
docker pull cornellappdev/uplift-dev:$IMAGE_TAG
# temporary container to run migrations
docker run --rm --env-file uplift.env -v ./certs:/usr/src/app/certs cornellappdev/uplift-dev:$IMAGE_TAG flask --app migrations db upgrade
sudo systemctl restart nginx
docker stack deploy -c docker-compose.yml the-stack --with-registry-auth
sleep 60s
yes | docker system prune -a
docker system prune -f
9 changes: 4 additions & 5 deletions .github/workflows/deploy-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,10 @@ jobs:
touch tags
source tags
export IMAGE_TAG=${{ steps.vars.outputs.sha_short }}
echo "export IMAGE_TAG=${IMAGE_TAG}" > tags
cd docker-compose
docker stack rm the-stack
sleep 20s
sudo systemctl stop nginx
docker pull cornellappdev/uplift-prod:$IMAGE_TAG
# temporary container to run migrations
docker run --rm --env-file uplift.env -v ./certs:/usr/src/app/certs cornellappdev/uplift-prod:$IMAGE_TAG flask --app migrations db upgrade
sudo systemctl restart nginx
docker stack deploy -c docker-compose.yml the-stack --with-registry-auth
yes | docker system prune -a
docker system prune -f
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ COPY . .
ENV MAX_CONCURRENT_PIP=4
RUN pip3 install --upgrade pip
RUN pip3 install --exists-action w -r requirements.txt
CMD flask --app migrations db upgrade && python3 app.py
CMD python3 app.py
11 changes: 10 additions & 1 deletion app_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
from flask_jwt_extended import JWTManager
from src.utils.constants import SERVICE_ACCOUNT_PATH, JWT_SECRET_KEY
from datetime import datetime
from flask import Flask, render_template
from flask import Flask, jsonify, render_template
from sqlalchemy import text
from graphene import Schema
from graphql.utils import schema_printer
from src.database import db_session, init_db
Expand Down Expand Up @@ -89,6 +90,14 @@ def check_if_token_revoked(jwt_header, jwt_payload: dict) -> bool:
def index():
return render_template("index.html")

@app.route("/health")
def health_check():
try:
db_session.execute(text("SELECT 1"))
return jsonify({"status": "healthy", "database": "connected"}), 200
except Exception:
return jsonify({"status": "unhealthy", "database": "disconnected"}), 503

app.add_url_rule("/graphql", view_func=GraphQLView.as_view("graphql", schema=schema, graphiql=True))

@app.teardown_appcontext
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
"""Make streaks non-null default 0

Revision ID: 30b29f371489
Revises: 6ec7ce03bb6a
Create Date: 2026-02-10 18:12:25.251531

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '30b29f371489'
down_revision = '6ec7ce03bb6a'
branch_labels = None
depends_on = None


def upgrade():
# ### commands auto generated by Alembic - please adjust! ###

# First complete backfill: set all streaks (active/max) to 0 if they are NULL
op.execute("UPDATE users SET active_streak = 0 WHERE active_streak IS NULL")
op.execute("UPDATE users SET max_streak = 0 WHERE max_streak IS NULL")

op.alter_column('users', 'active_streak',
existing_type=sa.INTEGER(),
nullable=False,
server_default=sa.text('0')
)

op.alter_column('users', 'max_streak',
existing_type=sa.INTEGER(),
nullable=False,
server_default=sa.text('0'),
)
# ### end Alembic commands ###


def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.alter_column('users', 'max_streak',
existing_type=sa.INTEGER(),
nullable=True)
op.alter_column('users', 'active_streak',
existing_type=sa.INTEGER(),
nullable=True)
# ### end Alembic commands ###
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
"""make last_streak non_null default 0

Revision ID: 46ba03c28573
Revises: b09a4d8151d6
Create Date: 2026-03-06 01:47:07.348774

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '46ba03c28573'
down_revision = 'b09a4d8151d6'
branch_labels = None
depends_on = None


def upgrade():
op.execute("UPDATE users SET last_streak = 0 WHERE last_streak IS NULL")
op.alter_column('users', 'last_streak',
existing_type=sa.INTEGER(),
nullable=False,
server_default=sa.text('0')
)


def downgrade():
op.alter_column('users', 'last_streak',
existing_type=sa.INTEGER(),
nullable=True,
server_default=None
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
"""Debug internal default conversion to UTC

Revision ID: 48923aecacb0
Revises:
Create Date: 2026-03-02 06:30:17.794409

"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql


# revision identifiers, used by Alembic.
revision = '48923aecacb0'
down_revision = None
branch_labels = None
depends_on = None


def upgrade():
op.alter_column(
"workout",
"workout_time",
type_=sa.DateTime(timezone=True),
postgresql_using="workout_time AT TIME ZONE 'UTC'",
existing_nullable=False,
)

op.alter_column(
"user_workout_goal_history",
"effective_at",
type_=sa.DateTime(timezone=True),
postgresql_using="effective_at AT TIME ZONE 'UTC'",
existing_nullable=False,
)

op.alter_column(
"user_workout_goal_history",
"effective_at",
server_default=sa.text("CURRENT_TIMESTAMP"),
existing_type=sa.DateTime(timezone=True),
existing_nullable=False,
)


def downgrade():
op.alter_column(
"user_workout_goal_history",
"effective_at",
server_default=None,
existing_type=sa.DateTime(timezone=True),
existing_nullable=False,
)

op.alter_column(
"user_workout_goal_history",
"effective_at",
type_=sa.DateTime(timezone=False),
postgresql_using="effective_at::timestamp",
existing_nullable=False,
)

op.alter_column(
"workout",
"workout_time",
type_=sa.DateTime(timezone=False),
postgresql_using="workout_time::timestamp",
existing_nullable=False,
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
"""Change workout_goal type to integer

Revision ID: 6ec7ce03bb6a
Revises: add_friends_table
Create Date: 2026-02-09 22:56:02.894228

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '6ec7ce03bb6a'
down_revision = 'add_friends_table'
branch_labels = None
depends_on = None


def upgrade():
op.alter_column("users", "workout_goal", type_=sa.Integer, postgresql_using="cardinality(workout_goal)")

# NOTE: Lossy migration — cannot convert integer back to array of specific days of the week
def downgrade():
raise NotImplementedError("Downgrade is possible: cannot convert integer back to array of specific days of the week")
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
"""Include last_streak and last_goal_change to User model

Revision ID: 6fb4a21a1201
Revises: 30b29f371489
Create Date: 2026-02-17 10:06:17.931547

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '6fb4a21a1201'
down_revision = '30b29f371489'
branch_labels = None
depends_on = None


def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('users', sa.Column('last_goal_change', sa.DateTime(), nullable=True))
op.add_column('users', sa.Column('last_streak', sa.Integer(), nullable=True))
# ### end Alembic commands ###


def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('users', 'last_streak')
op.drop_column('users', 'last_goal_change')
# ### end Alembic commands ###
24 changes: 24 additions & 0 deletions migrations/versions/b09a4d8151d6_merge_diverging_branches.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
"""Merge diverging branches

Revision ID: b09a4d8151d6
Revises: eb948c31a342, 48923aecacb0
Create Date: 2026-03-05 17:15:46.737524

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = 'b09a4d8151d6'
down_revision = ('eb948c31a342', '48923aecacb0')
branch_labels = None
depends_on = None


def upgrade():
pass


def downgrade():
pass
42 changes: 42 additions & 0 deletions migrations/versions/eb948c31a342_create_gear_table.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
"""Create gear table

Revision ID: eb948c31a342
Revises: 6fb4a21a1201
Create Date: 2026-03-02 06:22:00.042780

"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql


# revision identifiers, used by Alembic.
revision = 'eb948c31a342'
down_revision = '6fb4a21a1201'
branch_labels = None
depends_on = None

### Ensures alembic does not try to create enum
price_type_enum = postgresql.ENUM('rate', 'gear', name='pricetype', create_type=False)


def upgrade():
op.execute("""
DO $$
BEGIN
IF NOT EXISTS (SELECT 1 FROM information_schema.tables WHERE table_name = 'gear') THEN
CREATE TABLE gear (
id SERIAL NOT NULL,
activity_id INTEGER NOT NULL,
name VARCHAR NOT NULL,
cost FLOAT NOT NULL,
rate VARCHAR,
type pricetype NOT NULL,
PRIMARY KEY (id)
);
END IF;
END $$;
""")

def downgrade():
op.drop_table("gear")
Binary file modified requirements.txt
Binary file not shown.
Loading
Loading