{"id":24030549,"url":"https://github.com/dzaky-pr/mini-project-supabase-dashboard","last_synced_at":"2026-04-10T11:31:51.906Z","repository":{"id":269743445,"uuid":"908333021","full_name":"dzaky-pr/mini-project-supabase-dashboard","owner":"dzaky-pr","description":"This is a mini project that creates a dashboard system with Role-Based Access Control (RBAC), data manipulation (CRUD), and authentication using Supabase. It provides a simple way to manage and control access to data, ensuring that users with different roles can interact with the system according to their permissions.","archived":false,"fork":false,"pushed_at":"2025-01-01T00:46:12.000Z","size":2884,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-26T03:45:28.097Z","etag":null,"topics":["husky","material-ui","nextjs14","prettier","reactjs","supabase-auth","supabase-db","tailwindcss","typescript","zod"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dzaky-pr.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"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-12-25T19:08:44.000Z","updated_at":"2025-02-18T18:59:07.000Z","dependencies_parsed_at":"2024-12-25T20:33:13.244Z","dependency_job_id":null,"html_url":"https://github.com/dzaky-pr/mini-project-supabase-dashboard","commit_stats":null,"previous_names":["dzaky-pr/mini-project-supabase-dashboard"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dzaky-pr/mini-project-supabase-dashboard","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dzaky-pr%2Fmini-project-supabase-dashboard","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dzaky-pr%2Fmini-project-supabase-dashboard/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dzaky-pr%2Fmini-project-supabase-dashboard/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dzaky-pr%2Fmini-project-supabase-dashboard/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dzaky-pr","download_url":"https://codeload.github.com/dzaky-pr/mini-project-supabase-dashboard/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dzaky-pr%2Fmini-project-supabase-dashboard/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31641114,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-10T07:40:12.752Z","status":"ssl_error","status_checked_at":"2026-04-10T07:40:11.664Z","response_time":98,"last_error":"SSL_read: 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":["husky","material-ui","nextjs14","prettier","reactjs","supabase-auth","supabase-db","tailwindcss","typescript","zod"],"created_at":"2025-01-08T17:44:42.476Z","updated_at":"2026-04-10T11:31:51.891Z","avatar_url":"https://github.com/dzaky-pr.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# To Do (It will be removed once completed)\n\n- [] Signup Cookies are not deleted after signup.\n- [] The verify email callback is not following best practices.\n- [] Implementing Supabase Auth Best Practices for Server and Client (Create Action).\n- [] Fix middleware for checking authentication and authorization (permission/role).\n- [] Check out feature (multiple order).\n- [] Pagination feature.\n- [] High Ordered Component implementation (?).\n- [] Order feature with realtime rajaongkir API for provinces, cities, and cost.\n\n# Mini Project Sistem Dashboard Buku\n\n\u003cdiv align=\"center\"\u003e\n  \u003ch2\u003eNext Js 14.x + MUI 5.x + TypeScript 4.x + Tailwind CSS 3.x + Supabase (auth \u0026 database) 2.x\u003c/h2\u003e\n  \u003cp\u003e\n    This is a mini project that creates a dashboard system with Role-Based Access Control (RBAC), data manipulation (CRUD), and authentication using Supabase. It provides a simple way to manage and control access to data, ensuring that users with different roles can interact with the system according to their permissions.\n  \u003c/p\u003e\n\n\u003c/div\u003e\n\n## Features\n\nThis repository is 🔋 battery packed with:\n\n- ⚛️ React 18.x\n- ✨ TypeScript\n- 💨 Material UI — Ready to use Material Design components [check here for the usage](https://mui.com/material-ui/getting-started/usage/)\n- 🎨 React Hook Form — Performant, flexible and extensible forms with easy-to-use validation\n- ⏰ Day.js — A modern day JavaScript Date Library\n- 🔥 Utils: getApiResponse - consoleLog\n- 🃏 Jest — Configured for unit testing\n- 📈 Absolute Import and Path Alias — Import components using `@/` prefix\n- 📏 ESLint — Find and fix problems in your code, also will **auto sort** your imports\n- 💖 Prettier — Format your code consistently\n- 🐶 Husky \u0026 Lint Staged — Run scripts on your staged files before they are committed\n- 🤖 Conventional Commit Lint — Make sure you \u0026 your teammates follow conventional commit\n- ⏰ Release Please — Generate your changelog by activating the `release-please` workflow\n- 👷 Github Actions — Lint your code on PR\n- 🚘 Automatic Branch and Issue Autolink — Branch will be automatically created on issue **assign**, and auto linked on PR\n- 🔥 Snippets — A collection of useful snippets\n- 👀 Open Graph Helper Function — Awesome open graph generated using [og](https://github.com/theodorusclarence/og), fork it and deploy!\n- 🗺 Site Map — Automatically generate sitemap.xml\n- 📦 Expansion Pack — Easily install common libraries, additional components, and configs.\n\n## Getting Started\n\n### 1. Clone this repo\n\n```\ngit clone https://github.com/dzaky-pr/mini-project-supabase-dashboard.git\n```\n\n### 2. Install dependencies\n\nIt is encouraged to use **yarn** so the husky hooks can work properly.\n\n```bash\nyarn install\n```\n\n### 3. Run the development server\n\nYou can start the server using this command:\n\n```bash\nyarn dev\n```\n\nOpen [http://localhost:3000](http://localhost:3000) with your browser to see the result. You can start editing the page by modifying `src/pages/index.tsx`.\n\n### 4. Change defaults\n\nThere are some things you need to change including title, urls, favicons, etc.\n\nFind all comments with !STARTERCONF, then follow the guide.\n\nDon't forget to change the package name in package.json\n\n### 5. Commit Message Convention\n\nThis starter is using [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/), it is mandatory to use it to commit changes.\n\n## Supabase Detail\n\n### Database Schema\n\n\u003e **Note**: The order feature, database schema, and everything related to this feature, both for admins and users, are still under development!\n\n![Database Schema](./public/images/database_schema.png)\n\n#### favorites\n\nThis table stores data about books that users like.\n\n- **favorite_id (UUID)**: Unique ID for each favorite.\n- **user_id (UUID)**: ID of the user who likes the book.\n- **book_id (UUID)**: ID of the liked book.\n- **created_at (timestamptz)**: Time when the favorite was created.\n\n#### orders\n\nThis table stores data about book orders from users.\n\n- **order_id (UUID)**: Unique ID for each order.\n- **user_id (UUID)**: ID of the user who placed the order.\n- **book_id (UUID)**: ID of the ordered book.\n- **count (int4)**: Number of books ordered.\n- **shipping_address (text)**: Shipping address.\n- **city (text)**: Shipping city.\n- **province (text)**: Shipping province.\n- **status (text)**: Order status.\n- **rejected_reason (text)**: Reason for rejection if the order is rejected.\n- **created_at (timestamptz)**: Time when the order was created.\n- **accepted_rejected_status_at (timestamptz)**: Time when the order was accepted or rejected.\n- **courier (text)**: Courier name.\n- **service (text)**: Shipping service type.\n- **shipping_cost (int4)**: Shipping cost.\n- **delivery_estimate (text)**: Estimated delivery time.\n- **total_price (int4)**: Total order price.\n\n#### books\n\nThis table stores data about available books.\n\n- **book_id (UUID)**: Unique ID for each book.\n- **title (text)**: Book title.\n- **author (text)**: Book author.\n- **description (text)**: Book description.\n- **created_at (timestamptz)**: Time when the book was added.\n- **stocks (int4)**: Number of books available in stock.\n\n#### permissions\n\nThis table stores data about user permissions.\n\n- **id (UUID)**: Unique ID for each permission entry.\n- **created_at (timestamptz)**: Time when the permission was created.\n- **role (text)**: User role (e.g., admin, user).\n\n### Functions\n\n#### create_user_on_signup\n\nThis function is triggered when a user signs up. It inserts a new permission entry with the user's ID.\n\n```sql\nBEGIN\n  INSERT INTO public.permissions (id)\n  VALUES (\n    NEW.id\n  );\n  RETURN NEW;\nEND;\n```\n\n#### is_admin\n\nThis function checks if a user is an admin. It returns `true` if the user's role is 'admin'.\n\n```sql\nBEGIN\n  RETURN (SELECT role FROM permissions WHERE permissions.id = (SELECT auth.uid())) = 'admin';\nEND;\n```\n\n#### is_user\n\nThis function checks if a user is a regular user. It returns `true` if the user's role is 'user'.\n\n```sql\nBEGIN\n  RETURN (SELECT role FROM permissions WHERE permissions.id = (SELECT auth.uid())) = 'user';\nEND;\n```\n\n#### update_status_timestamp\n\nThis function updates the `accepted_rejected_status_at` timestamp when the order status changes.\n\n```sql\nBEGIN\n  IF NEW.status IS DISTINCT FROM OLD.status THEN\n    NEW.accepted_rejected_status_at := CURRENT_TIMESTAMP;\n  END IF;\n  RETURN NEW;\nEND;\n```\n\n### Triggers\n\n#### create_user_on_signup\n\nThis trigger is activated when a user signs up and calls the `create_user_on_signup` function.\n\n#### update_status_timestamp\n\nThis trigger is activated after an update on the orders table and calls the\n\n## Format\n\n`\u003ctype\u003e(optional scope): \u003cdescription\u003e`\nExample: `feat(pre-event): add speakers section`\n\n### 1. Type\n\nAvailable types are:\n\n- feat → Changes about addition or removal of a feature. Ex: `feat: add table on landing page`, `feat: remove table from landing page`\n- fix → Bug fixing, followed by the bug. Ex: `fix: illustration overflows in mobile view`\n- docs → Update documentation (README.md)\n- style → Updating style, and not changing any logic in the code (reorder imports, fix whitespace, remove comments)\n- chore → Installing new dependencies, or bumping deps\n- refactor → Changes in code, same output, but different approach\n- ci → Update github workflows, husky\n- test → Update testing suite, cypress files\n- revert → when reverting commits\n- perf → Fixing something regarding performance (deriving state, using memo, callback)\n- vercel → Blank commit to trigger vercel deployment. Ex: `vercel: trigger deployment`\n\n### 2. Optional Scope\n\nLabels per page Ex: `feat(pre-event): add date label`\n\n\\*If there is no scope needed, you don't need to write it\n\n### 3. Description\n\nDescription must fully explain what is being done.\n\nAdd BREAKING CHANGE in the description if there is a significant change.\n\n**If there are multiple changes, then commit one by one**\n\n- After colon, there are a single space Ex: `feat: add something`\n- When using `fix` type, state the issue Ex: `fix: file size limiter not working`\n- Use imperative, and present tense: \"change\" not \"changed\" or \"changes\"\n- Don't use capitals in front of the sentence\n- Don't add full stop (.) at the end of the sentence\n\n## References\n\nThis project is built using the boilerplate starter template from the following repository:\n\n- [Next.js Materia MUI TypeScript Hook Form Scaffold Boilerplate Starter](https://github.com/AlexStack/nextjs-materia-mui-typescript-hook-form-scaffold-boilerplate-starter)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdzaky-pr%2Fmini-project-supabase-dashboard","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdzaky-pr%2Fmini-project-supabase-dashboard","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdzaky-pr%2Fmini-project-supabase-dashboard/lists"}