2024-06-27 09:02:54 +00:00
|
|
|
{
|
2024-09-20 14:50:43 +00:00
|
|
|
"name": "frontend",
|
2024-06-27 09:02:54 +00:00
|
|
|
"version": "0.1.0",
|
|
|
|
"private": true,
|
|
|
|
"scripts": {
|
2024-09-24 20:01:06 +00:00
|
|
|
"dev": "next dev",
|
|
|
|
"dev:nosentry": "export NODE_ENV=development && export DISABLE_SENTRY=true && next dev",
|
2024-09-23 09:31:48 +00:00
|
|
|
"dev:test": "export NODE_ENV=test && next dev",
|
2024-06-27 09:02:54 +00:00
|
|
|
"build": "next build",
|
|
|
|
"start": "next start",
|
2024-10-11 14:51:15 +00:00
|
|
|
"lint": "next lint && prettier --check .",
|
2024-09-24 23:31:38 +00:00
|
|
|
"format": "prettier --write .",
|
|
|
|
"test": "playwright test",
|
|
|
|
"test-ui": "playwright test --ui",
|
2024-10-10 16:35:05 +00:00
|
|
|
"gentests": "playwright codegen http://localhost:3000",
|
|
|
|
"storybook": "storybook dev -p 6006",
|
|
|
|
"build-storybook": "storybook build",
|
|
|
|
"test-storybook": "test-storybook",
|
|
|
|
"test-storybook:ci": "concurrently -k -s first -n \"SB,TEST\" -c \"magenta,blue\" \"npm run build-storybook -- --quiet && npx http-server storybook-static --port 6006 --silent\" \"wait-on tcp:6006 && npm run test-storybook\""
|
2024-06-27 09:02:54 +00:00
|
|
|
},
|
2024-09-25 11:06:47 +00:00
|
|
|
"browserslist": [
|
|
|
|
"defaults"
|
|
|
|
],
|
2024-06-27 09:02:54 +00:00
|
|
|
"dependencies": {
|
2024-07-18 12:19:56 +00:00
|
|
|
"@hookform/resolvers": "^3.9.0",
|
2024-08-22 09:24:12 +00:00
|
|
|
"@next/third-parties": "^14.2.5",
|
2024-07-09 16:33:12 +00:00
|
|
|
"@radix-ui/react-avatar": "^1.1.0",
|
2024-08-20 12:04:22 +00:00
|
|
|
"@radix-ui/react-checkbox": "^1.1.1",
|
2024-08-05 04:39:42 +00:00
|
|
|
"@radix-ui/react-collapsible": "^1.1.0",
|
2024-10-12 09:33:29 +00:00
|
|
|
"@radix-ui/react-context-menu": "^2.2.1",
|
2024-07-18 12:19:56 +00:00
|
|
|
"@radix-ui/react-dialog": "^1.1.1",
|
2024-07-09 16:33:12 +00:00
|
|
|
"@radix-ui/react-dropdown-menu": "^2.1.1",
|
2024-07-05 06:14:45 +00:00
|
|
|
"@radix-ui/react-icons": "^1.3.0",
|
2024-07-18 12:19:56 +00:00
|
|
|
"@radix-ui/react-label": "^2.1.0",
|
2024-07-10 16:04:51 +00:00
|
|
|
"@radix-ui/react-popover": "^1.1.1",
|
2024-08-05 04:58:12 +00:00
|
|
|
"@radix-ui/react-scroll-area": "^1.1.0",
|
2024-08-20 12:04:22 +00:00
|
|
|
"@radix-ui/react-select": "^2.1.1",
|
2024-08-05 04:38:14 +00:00
|
|
|
"@radix-ui/react-separator": "^1.1.0",
|
2024-07-05 06:14:45 +00:00
|
|
|
"@radix-ui/react-slot": "^1.1.0",
|
2024-07-18 12:19:56 +00:00
|
|
|
"@radix-ui/react-switch": "^1.1.0",
|
2024-09-01 10:18:57 +00:00
|
|
|
"@radix-ui/react-toast": "^1.2.1",
|
2024-07-17 09:54:43 +00:00
|
|
|
"@radix-ui/react-tooltip": "^1.1.2",
|
2024-09-16 16:19:52 +00:00
|
|
|
"@sentry/nextjs": "^8",
|
feat(builder): Add Supabase Auth, session and sign in UI (#7655)
This PR adds Supabase Auth (cloud) integration, login and profile UI, configures password login and three OAuth providers: Google, GitHub and Discord.
For `Account` button to show up and ability to login two env vars need to be set in `.env.local`: `NEXT_PUBLIC_SUPABASE_URL` and `NEXT_PUBLIC_SUPABASE_ANON_KEY`. OAuth providers are by the Supabase and don't require env vars.
Email confirmation (for email/password signup) is disabled because there's limit of 3 emails per hour without custom SMTP server configuration. [Link](https://supabase.com/dashboard/project/adfjtextkuilwuhzdjpf/auth/templates) to configure custom SMTP server and email template.
### Added dependencies:
- "@supabase/ssr": "^0.4.0"
- "@supabase/supabase-js": "^2.45.0"
- "react-icons": "^5.2.1"
### Added pages/routes:
- `app/auth/auth-code-error/page.tsx`: displayed when login using OAuth provider fails
- `app/auth/callback/route.ts`: route accessed when logging in using OAuth provider; it passes session code to Supabase
- `app/auth/confirm/route.ts`: accessed when confirming email, users will be directed here from email they get after signing in.
- `app/error/page.tsx`: Generic error page without explanation (any errors should be visible in the console)
- `app/login/page.tsx` and `app/login/actions.ts`: Login page and related login/signup server actions
- `app/profile/page.tsx`: Profile page, displays email address of the user and button to logout
### Changes
- Update `layout.tsx`: add `Log In` button and make icons consistent. The log in button shows up if user is logged out, avatar is shown when logged in, and if supabase is unavailable nothing shows up.
- Login form is verified using `zod` on the frontend (recommended by shadcn) and in case login fails feedback is displayed. On successful login users are redirected to `/profile`
- Add `PasswordInput` component, [source](https://gist.github.com/mjbalcueva/b21f39a8787e558d4c536bf68e267398)
- Add `SupabaseProvider` with context for Supabase accessed via hook `useSupabase(): { supabase: SupabaseClient | null, isLoading: boolean }`
- Add `useUser` hook to get `{ user, session, isLoading, error }` on the client
- Add `getServerUser`: async function to get `{ user: User | null, error: string | null }` on the server side
- Add `src/middleware.ts` and `client.ts`, `server.ts`, `middleware.ts` in `src/lib/supabase` which are utility functions and middleware to refresh auth token
2024-08-02 11:58:28 +00:00
|
|
|
"@supabase/ssr": "^0.4.0",
|
|
|
|
"@supabase/supabase-js": "^2.45.0",
|
2024-09-05 20:04:11 +00:00
|
|
|
"@tanstack/react-table": "^8.20.5",
|
2024-10-09 20:29:13 +00:00
|
|
|
"@xyflow/react": "^12.3.1",
|
2024-07-29 09:17:27 +00:00
|
|
|
"ajv": "^8.17.1",
|
2024-07-05 06:14:45 +00:00
|
|
|
"class-variance-authority": "^0.7.0",
|
|
|
|
"clsx": "^2.1.1",
|
2024-08-20 12:04:22 +00:00
|
|
|
"cmdk": "1.0.0",
|
2024-07-10 16:04:51 +00:00
|
|
|
"date-fns": "^3.6.0",
|
2024-07-09 16:20:31 +00:00
|
|
|
"dotenv": "^16.4.5",
|
2024-07-10 16:01:07 +00:00
|
|
|
"lucide-react": "^0.407.0",
|
2024-07-17 09:54:43 +00:00
|
|
|
"moment": "^2.30.1",
|
2024-09-27 16:14:48 +00:00
|
|
|
"next": "^14.2.13",
|
2024-07-05 06:14:45 +00:00
|
|
|
"next-themes": "^0.3.0",
|
2024-06-27 09:02:54 +00:00
|
|
|
"react": "^18",
|
2024-07-10 16:04:51 +00:00
|
|
|
"react-day-picker": "^8.10.1",
|
2024-06-27 09:02:54 +00:00
|
|
|
"react-dom": "^18",
|
2024-07-18 12:19:56 +00:00
|
|
|
"react-hook-form": "^7.52.1",
|
2024-09-26 07:27:26 +00:00
|
|
|
"react-icons": "^5.3.0",
|
2024-07-17 09:54:43 +00:00
|
|
|
"react-markdown": "^9.0.1",
|
2024-06-27 09:14:25 +00:00
|
|
|
"react-modal": "^3.16.1",
|
2024-08-29 12:53:45 +00:00
|
|
|
"react-shepherd": "^6.1.1",
|
2024-09-05 20:04:11 +00:00
|
|
|
"recharts": "^2.12.7",
|
2024-07-05 06:14:45 +00:00
|
|
|
"tailwind-merge": "^2.3.0",
|
2024-07-18 12:19:56 +00:00
|
|
|
"tailwindcss-animate": "^1.0.7",
|
2024-08-30 11:48:33 +00:00
|
|
|
"uuid": "^10.0.0",
|
2024-07-18 12:19:56 +00:00
|
|
|
"zod": "^3.23.8"
|
2024-06-27 09:02:54 +00:00
|
|
|
},
|
|
|
|
"devDependencies": {
|
2024-10-10 16:35:05 +00:00
|
|
|
"@chromatic-com/storybook": "^1.9.0",
|
2024-09-24 23:31:38 +00:00
|
|
|
"@playwright/test": "^1.47.1",
|
2024-10-10 16:35:05 +00:00
|
|
|
"@storybook/addon-essentials": "^8.3.5",
|
|
|
|
"@storybook/addon-interactions": "^8.3.5",
|
|
|
|
"@storybook/addon-links": "^8.3.5",
|
|
|
|
"@storybook/addon-onboarding": "^8.3.5",
|
|
|
|
"@storybook/blocks": "^8.3.5",
|
|
|
|
"@storybook/nextjs": "^8.3.5",
|
|
|
|
"@storybook/react": "^8.3.5",
|
|
|
|
"@storybook/test": "^8.3.5",
|
|
|
|
"@storybook/test-runner": "^0.19.1",
|
2024-10-01 10:37:01 +00:00
|
|
|
"@types/node": "^22.7.3",
|
2024-06-27 09:02:54 +00:00
|
|
|
"@types/react": "^18",
|
|
|
|
"@types/react-dom": "^18",
|
2024-06-27 09:14:25 +00:00
|
|
|
"@types/react-modal": "^3.16.3",
|
2024-10-10 16:35:05 +00:00
|
|
|
"concurrently": "^9.0.1",
|
2024-06-27 09:14:25 +00:00
|
|
|
"eslint": "^8",
|
|
|
|
"eslint-config-next": "14.2.4",
|
2024-10-10 16:35:05 +00:00
|
|
|
"eslint-plugin-storybook": "^0.9.0",
|
2024-06-27 09:02:54 +00:00
|
|
|
"postcss": "^8",
|
2024-08-05 07:14:02 +00:00
|
|
|
"prettier": "^3.3.3",
|
2024-08-21 10:14:21 +00:00
|
|
|
"prettier-plugin-tailwindcss": "^0.6.6",
|
2024-10-10 16:35:05 +00:00
|
|
|
"storybook": "^8.3.5",
|
2024-06-27 09:02:54 +00:00
|
|
|
"tailwindcss": "^3.4.1",
|
2024-06-27 09:14:25 +00:00
|
|
|
"typescript": "^5"
|
2024-10-11 14:51:15 +00:00
|
|
|
},
|
|
|
|
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
|
2024-06-27 09:02:54 +00:00
|
|
|
}
|