Lambeth Foodbank provides foodbank services to clients in south London that have been issued with a foodbank voucher (by front-line professionals like social workers, doctors or police). Since the COVID-19 pandemic, most food parcels have been delivered to clients.
net localgroup docker-users <your_softwire_username> /ADD
as an administrator to add yourself to the docker-users group, where <your_softwire_username>
is your non-admin Softwire username.Download .env.local (Local) from Keeper and put in the top-level directory as .env.local
. Check that this file has NEXT_PUBLIC_SUPABASE_URL set to http://127.0.0.1:54321
Run npx snaplet auth setup
to log into Snaplet
Use npm run post_checkout
to install any dependencies.
Stopped supabase local development setup. failed to start docker container: Error response from daemon: Ports are not available: exposing port TCP 0.0.0.0:54322 -> 0.0.0.0:0: listen tcp 0.0.0.0:54322: bind: An attempt was made to access a socket in a way forbidden by its access permissions.
Run the following commands:
net stop winnat
netsh int ipv4 add excludedportrange protocol=tcp startport=554322 numberofports=1
net start winnat
then re-run npm run post_checkout
If you're using WSL, you need to download some dependencies for Cypress:
sudo apt-get install libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb
Run website locally (npm run dev
) and log in with one of the dev user credentials
Password | Role | |
---|---|---|
admin@example.com | admin123 | admin |
volunteer@example.com | volunteer123 | volunteer |
manager@example.com | manager123 | manager |
staff@example.com | staff123 | staff |
The best place to start is src/app
, where the website is based! Look at the folder structure for an idea of what the
website navigation will be.
(Optional) Install 'axe DevTools' to check that the website is accessible: https://chrome.google.com/webstore/detail/axe-devtools-web-accessib/lhdoppojpmngadmnindnejefpokejbdd?utm_source=deque.com&utm_medium=referral&utm_campaign=axe_hero
npm run dev
to launch the website locally
npm run lint_fix
to get ESLint to try and fix any linting mistakes, and to report anything it cannot fix
npm run post_checkout
to ensure the database and packages are up-to-date after switching to a new branch
npm run build
to make an optimised build - you'll need to do this before running tests.
npm run test
to run all tests. This will run both component and integration tests.
npm run test:component
for just component (unit) testsnpm run test:e2e
for just end-to-end testsnpm run test:coverage
for a full coverage report at the endnpm run open:cypress
npx supabase functions serve
to run Supabase functions locally
npx supabase migration list
to compare what migrations are applied locally and on remote
npx supabase migrations up --include-all --local
to run outstanding migrations locally
npm run dev:reset_supabase
to
npm run db:generate_seed
to generate supabase/seed.sql
based on supabase/seed/seed.mts
npm run dev:reset_supabase
To use the Supabase CLI:
supabase login
supabase [...]
Database migrations are tracked under /supabase/migrations.
You can either
npx supabase db diff -f <name_of_migration>
to generate a migration sql file (recommended), or
npx supabase migration new <name_of_migration>
and write sql queries yourself (not recommended)
You can regenerate the types
npm run db:local:generate_types
npm run db:remote:generate_types -- --project-id <PROJECT_ID>
npx snaplet auth setup
npx snaplet generate
supabase/seed.sql
from supabase/seed/seed.mts
npm run db:generate_seed
npm run dev:reset_supabase