Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
6 changes: 0 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1 @@
node_modules
.env
.specstory/
.DS_Store
playwright-report/
.vscode/
test-results/
7 changes: 7 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"recommendations": [
"ms-playwright.playwright",
"ms-python.python",
"ritwickdey.liveserver"
]
}
4 changes: 4 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"liveServer.settings.root": "front-end/",
"python.defaultInterpreterPath": "backend/.venv/bin/python"
}
6 changes: 3 additions & 3 deletions backend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ To run:

1. In the `backend` directory, create a file named `.env` with values for the following environment variables:
* `JWT_SECRET_KEY`: Any random string.
* `PGPASSWORD`: Any random string.
* `PGUSER`: `postgres`, assuming you're using the bundled docker-based database, or whatever user you need if you have a custom postgres set up.
* Optionally, `PGDATABASE`, `PGHOST`, and `PGPORT` if you're not using default postgres values.
* `POSTGRES_PASSWORD`: Any random string.
* `POSTGRES_USER`: `postgres`, assuming you're using the bundled docker-based database, or whatever user you need if you have a custom postgres set up.
* Optionally, `POSTGRES_DB`, `POSTGRES_HOST`, and `POSTGRES_PORT` if you're not using default postgres values.
2. Make a virtual environment: `python3 -m venv .venv`
3. Activate the virtual environment: `. .venv/bin/activate`
4. Install dependencies: `pip install -r requirements.txt`
Expand Down
10 changes: 5 additions & 5 deletions backend/data/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
@contextmanager
def db_cursor():
with psycopg2.connect(
dbname=os.getenv("PGDATABASE"),
user=os.getenv("PGUSER"),
password=os.environ["PGPASSWORD"],
host=os.getenv("PGHOST", "127.0.0.1"),
port=os.getenv("PGPORT"),
dbname=os.getenv("POSTGRES_DB"),
user=os.getenv("POSTGRES_USER"),
password=os.environ["POSTGRES_PASSWORD"],
host=os.getenv("POSTGRES_HOST", "127.0.0.1"),
port=os.getenv("POSTGRES_PORT"),
) as conn:
with conn.cursor() as cur:
yield cur
6 changes: 6 additions & 0 deletions backend/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
blinker==1.9.0
certifi==2025.4.26
cffi==1.17.1
charset-normalizer==3.4.2
click==8.1.8
cryptography==44.0.1
Flask==3.1.0
flask-cors==5.0.1
Flask-JWT-Extended==4.7.1
idna==3.10
itsdangerous==2.2.0
Jinja2==3.1.5
MarkupSafe==3.0.2
psycopg2==2.9.10
pycparser==2.22
PyJWT==2.10.1
python-dotenv==1.0.1
requests==2.32.3
urllib3==2.4.0
Werkzeug==3.1.3
11 changes: 8 additions & 3 deletions db/create-schema.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ set -euo pipefail

SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &> /dev/null && pwd)"

export PGPASSWORD="$(cat "${SCRIPT_DIR}/../backend/.env" | grep ^PGPASSWORD= | cut -d= -f2-)"

psql -h 127.0.0.1 -U postgres -f "${SCRIPT_DIR}/schema.sql"
source "$SCRIPT_DIR/../backend/.env"

PGPASSWORD="$POSTGRES_PASSWORD" psql \
--dbname "${POSTGRES_DB:-postgres}" \
--file "${SCRIPT_DIR}/schema.sql" \
--host "${POSTGRES_HOST:-127.0.0.1}" \
--port "${POSTGRES_PORT:-5432}" \
--username "${POSTGRES_USER:-postgres}"
11 changes: 9 additions & 2 deletions db/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &> /dev/null && pwd)"
BACKING_STORE_DIR="${SCRIPT_DIR}/pg_data"
mkdir -p "${BACKING_STORE_DIR}"

POSTGRES_PASSWORD="$(cat "${SCRIPT_DIR}/../backend/.env" | grep ^PGPASSWORD= | cut -d= -f2-)"
source "$SCRIPT_DIR/../backend/.env"

docker run -it --rm -e POSTGRES_PASSWORD="${POSTGRES_PASSWORD}" -p 5432:5432 -v "${BACKING_STORE_DIR}:/var/lib/postgresql/data" postgres:17.4
docker run \
--env-file "$SCRIPT_DIR/../backend/.env" \
--interactive \
--publish "${POSTGRES_PORT:-5432}:5432" \
--rm \
--tty \
--volume "${BACKING_STORE_DIR}:/var/lib/postgresql/data" \
postgres:17.4
3 changes: 3 additions & 0 deletions front-end/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/node_modules/
/playwright-report/
/test-results/
20 changes: 19 additions & 1 deletion front-end/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.