ByteBite is a food tracking app designed around minimal effort. Unlike existing apps that demand detailed manual entry, ByteBite uses smart defaults and quick-add so users actually stick with it. This includes features:
- Fridge Catalogue
- Automatic Expiry Assignment
- Expiry Alerts & Notifications
- Recipe recommendations
- Search & Filter
- Simplified Input Methods (Upcoming)
For more details on our project, click on the following link.
ByteBite is developed using a branch-based workflow so that new features and fixes can be worked on separately before being merged back into the main codebase. For example, frontend setup, expiry-date handling, and bug fixes are kept on dedicated feature or bug branches such as feature/frontend-setup, feature/expiry-prior, and bug/expiry-prior-bug. This makes it easier to review changes, test them in isolation, and avoid mixing unrelated work in the same commit. We also maintain supporting engineering documents, including an API contract in docs/api_contract.md and database schema files in docs/, so frontend and backend development can stay aligned. Backend tests are run through a GitHub Actions workflow on pushes and pull requests to main, using separate test database credentials stored as repository secrets. Sensitive local configuration such as database URLs and JWT secrets are kept in .env files and excluded from Git. Together, these practices help us keep the project maintainable, traceable, and safer to modify as the app grows.
Evidence to include in the final submitted document: screenshots of feature branches, pull requests or review comments, GitHub issues or sprint boards, and the GitHub Actions test workflow.
Follow these steps to set up ByteBite locally on your machine.
Before starting, ensure you have the following installed:
- Node.js (v22 or higher)
- npm (comes bundled with Node)
- Git
ByteBite requires a live PostgreSQL instance to run. Set this up first to get your connection credentials:
- Create a free account and a new project on the Supabase Dashboard.
- Go to the SQL Editor tab in your Supabase project sidebar.
- Paste the contents of
docs/schema.sqlinto the editor and click Run to generate your database tables. - Open a new SQL query tab, paste the contents of
docs/foodTypes.sql, and click Run to populate your baseline categories, food types, and brand products. - To enable recipe recommendations, run
docs/recipes.sql, then rundocs/seed_recipes.sql. - Click the blue Connect button in the top right corner of your Supabase dashboard header.
- In the modal that appears, select Direct connection (or Session Pooler if your local network doesn't support IPv6), copy the URI string, and make sure to replace
[YOUR-PASSWORD]with your actual database password. Keep this string handy for Step 3.
Open your terminal and run the following commands to clone the code and enter the project folder:
git clone [https://github.com/wangyixuan818/ByteBite.git](https://github.com/wangyixuan818/ByteBite.git)
cd ByteBiteCreate a new file named server/.env. Use server/.env.example as a template.
- DATABASE_URL: The Session Pooler URI string you copied from Supabase in Step 1
- JWT_SECRET: A custom random string of your choice, at least 32 characters long, used for login security. To generate a professional one, run this command in your terminal and copy the result:
bash node -e "console.log(require('crypto').randomBytes(48).toString('hex'))")
Important: Never commit this .env file to Git. It is private to your local machine.server/.envis gitignored.
Open a new terminal window, navigate to the server directory, and run:
cd server
npm install
npm run biteYou should see: Server running on http://localhost:5001
Open another new terminal window, navigate to the client directory, and run:
cd client
npm install
npm run devYou should see: Local: http://localhost:5173
Visit http://localhost:5173 in your browser.
Note: The frontend is pre-configured to automatically route any /api/* requests directly to your backend server running on port 5001. You do not need to configure any extra endpoints or handle CORS errors manually.
The backend ships with a Jest suite covering unit tests (schema validation, date helpers, expiry-pick logic) and integration tests (auth, items, food types, notifications, expiry-alert cron).
The test suite writes and deletes rows freely, so it needs its own database — do not point it at your dev database from Setup Step 1 or your dev data will be wiped.
- On the Supabase Dashboard, create a second project (e.g.
bytebite-test), separate from the one you created during setup. - Go to the SQL Editor tab in this new project's sidebar.
- Paste the contents of
docs/schema.sqlanddocs/recipes.sqlinto the editor and click Run. - Open a new SQL query tab, paste the contents of
docs/foodTypes.sqlanddocs/seed_recipes.sql, and click Run. - Click the blue Connect button in the top right corner and copy the connection URI (Direct connection, or Session Pooler if your network doesn't support IPv6). Replace
[YOUR-PASSWORD]with your actual database password.
Append the following two variables to the server/.env file you created in Setup Step 3:
-
TEST_DATABASE_URL: The URI string from the test project you just created.
-
TEST_JWT_SECRET: A second random string generated the same way as
JWT_SECRET:node -e "console.log(require('crypto').randomBytes(48).toString('hex'))"
Jest automatically swaps DATABASE_URL and JWT_SECRET to these test values before any test runs, so your dev database is never touched.
The backend server does not need to be running — Jest boots the Express app in-process against the test database.
From the server/ directory:
npm testTo generate a coverage report:
npm run test:coverage