leanderandClaude Opus 5.5 7ab2a0f1f2 feat(inventory): add and edit products without the admin
The inventory page gets a "Ny vare" link and a "Rediger" link per product,
leading to a form for name, prices, volume, alcohol, description and whether
the product is for sale. Stock still changes only through inventory
transactions and sales, and the image through the admin.

Saving needs the same access as the Django admin: staff, plus the add or
change product permission (superusers have both). The server checks this on
every save and validates with the model's rules. Logged out visitors are
sent to log in and back to the form.

New in the API: createProduct and updateProduct mutations, a product query,
and a me query so the frontend knows who is logged in.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 03:44:12 +01:00
2026-10-23 02:58:15 +02:00
2026-10-23 02:19:03 +02:00
2022-02-19 15:26:30 +01:00
2022-02-20 01:25:55 +01:00
2022-02-20 00:39:16 +01:00

Getting started

Before starting, make sure you have mise installed. It manages Python, Node, uv and prek.

mise install
prek install
uv run manage.py migrate
cp .env-default .env
uv run manage.py seed_demo_data

# Optional: create an admin login
uv run manage.py createsuperuser

Start the backend and frontend in separate terminals from the project root:

mise run server
mise run frontend-run

Vite prints the frontend URL when it starts (normally http://localhost:5173/; if that port is busy, it selects another). Django runs at http://localhost:3000/; open the admin directly at http://localhost:3000/admin/ or through the frontend dev proxy at the printed Vite URL followed by /admin/. The GraphQL API is at http://localhost:3000/graphql/; the frontend uses Vite's proxy for development API requests.

To test the frontend against a different backend, set VITE_DEV_API_PROXY when starting Vite, for example VITE_DEV_API_PROXY=https://bbs.neuf.no mise run frontend-run. This affects the development proxy only; use caution with a live backend, since app changes and submissions may modify production data.

For more realistic statistics, uv run manage.py seed_demo_data --size medium also generates random users, orders and deposits spread over time (small, medium or large; add --seed N for reproducible output). It adds more data on every run.

To create the admin during data seeding instead, set BBS_SEED_ADMIN_PASSWORD for that command; the command only creates a local admin superuser if one does not already exist.

Testing

mise run test

Deployment

Every push to main that passes the tests is built into git.neuf.no/edb/bbs:<sha> and deployed to amiga by .gitea/workflows/deploy.yml, while the repository variable DEPLOY_AMIGA is true. The image runs with bbs.settings_prod: SQLite and uploads in /data, Django under /api/ and the frontend at the root. The stacks on amiga, one per tenant, are the bbs role in edb-infra.

References

TODO-old

  • Larger pictures
  • Compact GUI for max 768 vertical pixels
    • Search right of in title
S
Description
Biceps Bar System
Readme
4.2 MiB
0 Stars 9 Watchers 0 Forks
Languages
TypeScript 44.3%
Python 42.2%
CSS 6.5%
HTML 4.6%
JavaScript 1.5%
Other 0.9%