{"id":19571519,"url":"https://github.com/rodrigofontesdev/pizza","last_synced_at":"2026-04-07T21:31:12.741Z","repository":{"id":240935874,"uuid":"803826228","full_name":"rodrigofontesdev/pizza","owner":"rodrigofontesdev","description":"A restaurant dashboard built with React and Bun.","archived":false,"fork":false,"pushed_at":"2024-07-25T21:35:22.000Z","size":233,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-26T10:46:11.489Z","etag":null,"topics":["bun","playwright","postgresql","react","react-query","study-project","tailwindcss","testing-library","typescript","vitest"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rodrigofontesdev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-21T13:00:56.000Z","updated_at":"2024-07-26T01:15:10.000Z","dependencies_parsed_at":"2024-06-28T00:55:38.399Z","dependency_job_id":"de506392-46a1-4b34-9e1e-3d4d6c580d8e","html_url":"https://github.com/rodrigofontesdev/pizza","commit_stats":null,"previous_names":["rodrigofontesdev/pizza"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rodrigofontesdev/pizza","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rodrigofontesdev%2Fpizza","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rodrigofontesdev%2Fpizza/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rodrigofontesdev%2Fpizza/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rodrigofontesdev%2Fpizza/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rodrigofontesdev","download_url":"https://codeload.github.com/rodrigofontesdev/pizza/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rodrigofontesdev%2Fpizza/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31530640,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-07T16:28:08.000Z","status":"ssl_error","status_checked_at":"2026-04-07T16:28:06.951Z","response_time":105,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bun","playwright","postgresql","react","react-query","study-project","tailwindcss","testing-library","typescript","vitest"],"created_at":"2024-11-11T06:19:09.841Z","updated_at":"2026-04-07T21:31:12.684Z","avatar_url":"https://github.com/rodrigofontesdev.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"![cover](https://github.com/user-attachments/assets/d6b16526-c4d6-4f36-ae40-46e2c9aa34d1)\n\n# Pizza Shop\n\nA restaurant dashboard to track key metrics such as revenue by period, customer retention, daily and monthly orders, best-selling products, manage orders, and more.\n\nThe goal is to develop an application without using any framework, relying solely on React to integrate the front-end with a back-end via REST API.\n\n## Prerequisites\n\n- Bun\n- Node.js\n- Docker\n- PostgreSQL\n- Git\n\n## Getting Started\n\n### Back-end\n\n- Clone the repository (`git clone git@github.com:rodrigofontesdev/pizza-api.git`)\n- Install dependencies (`bun install`)\n- Copy .env.local.example file (`cp .env.local.example .env.local`)\n- Update [Resend](https://resend.com) key on .env.local file (from `RESEND_API_KEY=\"\"` to `RESEND_API_KEY=\".\"`), it should work\n- Run containers (`docker compose up -d`)\n- Check if container is running (`docker ps`)\n- Install migrations (`bun migrate`)\n- Open the seed file (`/src/db/seed.ts`) and update the restaurant manager email to your own email\n- Populate the database (`bun seed`)\n- Run application (`bun dev`)\n\n### Front-end\n\n- Clone the repository (`git clone git@github.com:rodrigofontesdev/pizza.git`)\n- Install dependencies (`npm install`)\n- Copy .env.example file (`cp .env.example .env`)\n- Run application (`npm run dev`)\n\n## Features\n\n- Create an account as restaurant manager\n- Passwordless login with magic link\n- Logout from account\n- Update restaurant profile\n- Toggle between dark and light theme\n- Revenue by period\n- Best-selling products\n- Daily and monthly orders\n- Monthly canceled orders\n- Filter orders by ID, customer name or status\n- Remove order filters\n- Open order in details\n- Manage order status\n- Paginate between orders\n\n## How to Use\n\n### Create an account\n\nVisit the `/sign-up` route, you must be able to create an account as a restaurant manager and sign in normally on the app. However, your dashboard will remain empty.\n\n### Sign-in with magic link\n\nVisit the `/sign-in` route, fill in the email address that you updated in the seed file. For now, transactional email sending is still disabled, but you can obtain the magic link in the back-end console. Open the link in your browser, and you will be automatically redirected to the dashboard.\n\n\u003e [!NOTE]\n\u003e See how to run the API server on the [Getting Started section](#getting-started) on this document.\n\u003e \n\u003e I plan to activate transactional email sending using a tool other than Resend service.\n\n### Manage orders\n\nVisit the `/orders` route, filter orders by status or other criteria, click on the left-side icon to see the order details or click the right-side action buttons to manage the statuses.\n\n## How to Test\n\nIn this application unit tests are built with [Vitest](https://github.com/vitest-dev/vitest), [Testing Library](https://github.com/testing-library/react-testing-library) and [Happy Dom](https://github.com/capricorn86/happy-dom). On the other hand, E2E tests are built with [Playwright](https://github.com/microsoft/playwright) and [Mock Service Worker](https://github.com/mswjs/msw).\n\nTo run the unit tests, open the front-end console and type: `npm run test`\n\n\u003e [!NOTE]\n\u003e Inside the tested components you can find a file with `.spec.tsx` extension, these files are located closest as possible to the target component.\n\nTo run end-to-end tests, first start the app in test mode by running `npm run dev:test` in the console. Once the app is mocked, open a new terminal and run `npx playwright test` for CI execution or `npx playwright test --ui` for the Playwright interface.\n\n\u003e [!NOTE]\n\u003e Inside `/src/api/mocks` you can find the mocks for the API. And inside `/test` are located the end-to-end tests.\n\n**Environment Variables**\n\n| Key  | Value | .ENV  | Description |\n| :------------ | :------------ | :------------ | :------------ |\n| VITE_API_URL | \"string\" (default: `http://localhost:3333`) |  | Indicates the URL from the API, in test mode should be `\"/\"`  |\n| VITE_ENABLE_API_DELAY | `true` \\| `false` |  | Enable or disable delay in the API, useful for simulating a non-local connection |\n| API_BASE_URL | \"string\" (default: `http://localhost:3333`) | API | Indicates the base URL for the API |\n| AUTH_REDIRECT_URL | \"string\" (default: `http://localhost:5173`) | API | Indicates the URL from the front-end application |\n| DB_URL | \"string\" (default: `docker container`) | API | URL for connection with the database, can be any Postgres service from your machine |\n| JWT_SECRET_KEY | \"string\" | API | A strong, randomly generated secret key is required for JSON Web Token security |\n| RESEND_API_KEY | \"string\" | API | `deprecated` |\n\n## I've Learned\n\n- Create pre-styled components with shadcn/ui\n- Provide SEO metatags with React Helmet Async\n- Create a theme toggle with dark and light mode (`Context API`)\n- Fetch, cache, synchronize and update server state with TanStack Query (also know as React Query)\n- Differences between local state, global state and HTTP state (server state)\n- Authentication with JWT Cookie approach\n- How and when to use optimistic interface to improve user experience\n- Create unit and end-to-end tests for the front-end\n- How and why to mock an API service\n\n## Built With\n\n- React\n- TypeScript\n- shadcn/ui\n- Tailwind CSS\n- TanStack Query (React Query)\n- Playwright\n- Vitest\n- Testing Library\n- Mock Service Worker\n\n## Credits\n\nSpecial thanks to [@rocketseat-education](https://github.com/rocketseat-education) for contributing to the back-end. See the original [Pizza Shop API](https://github.com/rocketseat-education/pizzashop-api).\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE.md](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frodrigofontesdev%2Fpizza","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frodrigofontesdev%2Fpizza","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frodrigofontesdev%2Fpizza/lists"}