Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
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: 2 additions & 2 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ Local runs use Minio (S3) and DynamoDB Local unless `AWS_REGION` is set to a rea

```bash
# One-time: start Minio + DynamoDB Local, create local bucket
bin/local_minio_control.bash start
bin/local_dynamodb_control.bash start
python3 bin/local_services.py minio start
python3 bin/local_services.py dynamodb start
make make-local-bucket

# Create demo course and DB tables
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,11 @@ jobs:

- name: Create default AWS credentials and Validate local DynamoDB endpoint
run: |
bin/local_dynamodb_control.bash start
python3 bin/local_services.py dynamodb start

- name: Validate local minio/S3 endpoint and make sure we have buckets
run: |
bin/local_minio_control.bash start
python3 bin/local_services.py minio start
Comment on lines +62 to +66
Copy link

Copilot AI Apr 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI now starts local DynamoDB/MinIO via python3 bin/local_services.py ..., but bin/local_services.py is not present in the repo. This will cause the workflow to fail immediately. Add/commit the script (or revert to the previous start commands) so CI can bring up its local services.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added

make make-local-bucket

- name: Make a demo course, user and upload the demo movies
Expand Down
10 changes: 5 additions & 5 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co

## Project Overview

Plant Tracer is a Flask-based web application for uploading, managing, and annotating plant growth time-lapse videos at https://app.planttracer.com/. It has a Python/Flask backend, a JavaScript frontend (custom DOM utilities; jQuery has been completely removed), DynamoDB for structured data, and S3 for video/frame storage.
Plant Tracer is a Flask-based web application for uploading, managing, and annotating plant growth time-lapse videos at https://app.planttracer.com/. It has a Python/Flask backend, a JavaScript frontend (jQuery loaded globally, with ES modules importing `$` from `utils.js`), DynamoDB for structured data, and S3 for video/frame storage.

## Common Commands

Expand All @@ -28,8 +28,8 @@ npm run test-debug # JS tests with verbose output
AWS_REGION=local PYTHONPATH="lambda-resize/src:src" poetry run pytest tests/endpoint_test.py -v

# Local development
bin/local_minio_control.bash start # Start Minio (S3 emulator, port 9000)
bin/local_dynamodb_control.bash start # Start DynamoDB Local (port 8000)
python3 bin/local_services.py minio start # Start Minio (S3 emulator, ports 9000/9001)
python3 bin/local_services.py dynamodb start # Start DynamoDB Local (port 8000)
make make-local-bucket # Create local S3 bucket
make make-local-demo # Create demo course and DB tables
make run-local-debug # Flask dev server at localhost:8080
Expand All @@ -52,7 +52,7 @@ make run-local-debug # Flask dev server at localhost:8080
Route handlers should be thin; put business logic in `odb.py`, `mailer.py`, `s3_presigned.py`, etc.

### Frontend (`src/app/static/`, `src/app/templates/`)
`$` is **not jQuery** — it is the custom lightweight helper from `utils.js`. Before writing any JavaScript, read `utils.js` to understand what `$` and `$$` actually support. Use only methods defined there.
`$` is jQuery. Browser pages load jQuery globally, and ES modules import `$` from `utils.js`, which re-exports the global jQuery instance.

### Data Storage
- **S3**: movies, frames, ZIP files. The bucket is always **pre-existing** and **outlives the CloudFormation stack** as the long-term archive. Because the bucket outlives DynamoDB, research/attribution metadata must also be written **into the MP4 file** (see `src/app/mp4_metadata_lib.py`, `docs/MOVIE_METADATA.rst`).
Expand Down Expand Up @@ -84,7 +84,7 @@ Tests run against **real local services** (DynamoDB Local + Minio), not mocks. F
- `pyproject.toml` uses PEP 621 `[project]` table — do not use deprecated `[tool.poetry]` keys for name/version/description/authors/scripts.

### JavaScript
- Always check `src/app/static/utils.js` before writing JS — use only methods defined there.
- `src/app/static/utils.js` is a shim that re-exports the global jQuery instance for ES modules.
- `make eslint` lints `src/app/static/` and `src/app/templates/`.
- Jest tests live in `jstests/`; run with `NODE_PATH=src/app/static`.

Expand Down
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ TS_FILES := $(wildcard *.ts */*.ts)
JS_FILES := $(TS_FILES:.ts=.js)
LOCAL_BUCKET:=planttracer-local
LOCAL_HTTP_PORT=8080
LOCAL_LAMBDA_PORT=9001
LOCAL_LAMBDA_PORT=9811
LOCAL_LAMBDA_BASE=http://127.0.0.1:$(LOCAL_LAMBDA_PORT)/
DYNAMODB_LOCAL_ENDPOINT=http://localhost:8000/
MINIO_ENDPOINT=http://localhost:9000/
Expand Down Expand Up @@ -315,10 +315,10 @@ bin/DynamoDBLocal.jar: bin/dynamodb_local_latest.zip

# operation:
start_local_dynamodb: bin/DynamoDBLocal.jar
bash bin/local_dynamodb_control.bash start
python3 bin/local_services.py dynamodb start

stop_local_dynamodb: bin/DynamoDBLocal.jar
bash bin/local_dynamodb_control.bash stop
python3 bin/local_services.py dynamodb stop
Comment on lines +318 to +321
Copy link

Copilot AI Apr 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These make targets now call python3 bin/local_services.py ..., but bin/local_services.py is not present in the repository (so make start_local_dynamodb/stop_local_dynamodb will fail on a fresh checkout). Add/commit the new script or update these targets to call an existing implementation.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added


list-tables:
$(LOCAL_AWS_ENV) aws dynamodb list-tables
Expand Down Expand Up @@ -367,10 +367,10 @@ bin/minio:

# operation:
start_local_minio: bin/minio
bash bin/local_minio_control.bash start
python3 bin/local_services.py minio start

stop_local_minio: bin/minio
bash bin/local_minio_control.bash stop
python3 bin/local_services.py minio stop

list-local-buckets:
$(LOCAL_AWS_ENV) aws s3 ls
Expand Down
20 changes: 10 additions & 10 deletions Makefile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -159,18 +159,18 @@ pytest-selenium: $(PYR)

wipe-local: $(DYR) $(SYR)
@echo wiping all local artifacts and remaking the local bucket.
bin/local_minio_control.bash stop
bin/local_dynamodb_control.bash stop
python3 bin/local_services.py minio stop
python3 bin/local_services.py dynamodb stop
/bin/rm -rf var
mkdir -p var
bin/local_minio_control.bash start
bin/local_dynamodb_control.bash start
python3 bin/local_services.py minio start
python3 bin/local_services.py dynamodb start
make make-local-bucket

delete-local: $(DYR) $(SYR)
@echo deleting all local artifacts
bin/local_minio_control.bash stop
bin/local_dynamodb_control.bash stop
python3 bin/local_services.py minio stop
python3 bin/local_services.py dynamodb stop
/bin/rm -rf var

FUNCTION_NAME ?= MyLambdaFunction
Expand Down Expand Up @@ -244,10 +244,10 @@ bin/DynamoDBLocal.jar: bin/dynamodb_local_latest.zip
touch bin/DynamoDBLocal.jar

start_local_dynamodb: bin/DynamoDBLocal.jar
bash bin/local_dynamodb_control.bash start
python3 bin/local_services.py dynamodb start

stop_local_dynamodb: bin/DynamoDBLocal.jar
bash bin/local_dynamodb_control.bash stop
python3 bin/local_services.py dynamodb stop
.PHONY: start_local_dynamodb stop_local_dynamodb
################################################################

Expand Down Expand Up @@ -279,10 +279,10 @@ bin/minio:
fi

start_local_minio: bin/minio
bash bin/local_minio_control.bash start
python3 bin/local_services.py minio start

stop_local_minio: bin/minio
bash bin/local_minio_control.bash stop
python3 bin/local_services.py minio stop
.PHONY: start_local_minio stop_local_minio
###############################################################
## S3/DynamoDB controls
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Code

The application consists of two parts, both of which are contained in this repo:

1. A web client written in JavaScript using a custom lightweight DOM utility (jQuery has been completely eliminated). Most of the app is located in [deploy/app/static/](deploy/app/static/), although these JavaScript files require some variables set on the HTML pages served out of [deploy/app/templates/](deploy/app/templates/) to function.
1. A web client written in JavaScript. jQuery is loaded globally for browser pages, and ES modules import `$` from `src/app/static/utils.js`, which re-exports the global jQuery instance. Most of the app is located in [deploy/app/static/](deploy/app/static/), although these JavaScript files require some variables set on the HTML pages served out of [deploy/app/templates/](deploy/app/templates/) to function.

2. A back-end application written in Python using the Flask framework. This application can be served using an Apache webserver with the `gunicorn` application server, or using Amazon Lambda or another serverless framework.

Expand Down
125 changes: 0 additions & 125 deletions bin/local_dynamodb_control.bash

This file was deleted.

Loading
Loading