diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 519e3bdb..b117f484 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,18 +1,21 @@ name: CI on: push: - branches: ['*'] + branches: ["*"] paths-ignore: - - 'README.md' - - 'docs/**' + - "README.md" + - "docs/**" pull_request: branches: [master] paths-ignore: - - 'README.md' - - 'docs/**' + - "README.md" + - "docs/**" jobs: all-cli-check: runs-on: ubuntu-latest + defaults: + run: + working-directory: ./apps/react-vite steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 @@ -33,6 +36,9 @@ jobs: e2e: timeout-minutes: 60 runs-on: ubuntu-latest + defaults: + run: + working-directory: ./apps/react-vite steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 diff --git a/.gitignore b/.gitignore index 5f49a4ab..428d46c2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,40 +1,7 @@ -# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. - # dependencies /node_modules /.pnp .pnp.js -# testing -/coverage -/test-results/ -/playwright-report/ -/blob-report/ -/playwright/.cache/ -/e2e/.auth/ - -# storybook -migration-storybook.log -storybook.log -storybook-static - - -# production -/dist - # misc -.DS_Store -.env -.env.local -.env.development.local -.env.test.local -.env.production.local - -npm-debug.log* -yarn-debug.log* -yarn-error.log* - - -# local -mocked-db.json - +.DS_Store \ No newline at end of file diff --git a/.husky/pre-commit b/.husky/pre-commit index 1a1f1f06..1d731b2c 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1 +1 @@ -yarn lint-staged \ No newline at end of file +yarn --cwd apps/react-vite lint-staged \ No newline at end of file diff --git a/.env.example b/apps/react-vite/.env.example similarity index 100% rename from .env.example rename to apps/react-vite/.env.example diff --git a/.env.example-e2e b/apps/react-vite/.env.example-e2e similarity index 100% rename from .env.example-e2e rename to apps/react-vite/.env.example-e2e diff --git a/.eslintrc.cjs b/apps/react-vite/.eslintrc.cjs similarity index 100% rename from .eslintrc.cjs rename to apps/react-vite/.eslintrc.cjs diff --git a/apps/react-vite/.gitignore b/apps/react-vite/.gitignore new file mode 100644 index 00000000..5f49a4ab --- /dev/null +++ b/apps/react-vite/.gitignore @@ -0,0 +1,40 @@ +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + +# dependencies +/node_modules +/.pnp +.pnp.js + +# testing +/coverage +/test-results/ +/playwright-report/ +/blob-report/ +/playwright/.cache/ +/e2e/.auth/ + +# storybook +migration-storybook.log +storybook.log +storybook-static + + +# production +/dist + +# misc +.DS_Store +.env +.env.local +.env.development.local +.env.test.local +.env.production.local + +npm-debug.log* +yarn-debug.log* +yarn-error.log* + + +# local +mocked-db.json + diff --git a/.prettierignore b/apps/react-vite/.prettierignore similarity index 100% rename from .prettierignore rename to apps/react-vite/.prettierignore diff --git a/.prettierrc b/apps/react-vite/.prettierrc similarity index 100% rename from .prettierrc rename to apps/react-vite/.prettierrc diff --git a/.storybook/main.ts b/apps/react-vite/.storybook/main.ts similarity index 100% rename from .storybook/main.ts rename to apps/react-vite/.storybook/main.ts diff --git a/.storybook/preview.tsx b/apps/react-vite/.storybook/preview.tsx similarity index 100% rename from .storybook/preview.tsx rename to apps/react-vite/.storybook/preview.tsx diff --git a/.vscode/extensions.json b/apps/react-vite/.vscode/extensions.json similarity index 100% rename from .vscode/extensions.json rename to apps/react-vite/.vscode/extensions.json diff --git a/.vscode/settings.json b/apps/react-vite/.vscode/settings.json similarity index 100% rename from .vscode/settings.json rename to apps/react-vite/.vscode/settings.json diff --git a/__mocks__/vitest-env.d.ts b/apps/react-vite/__mocks__/vitest-env.d.ts similarity index 100% rename from __mocks__/vitest-env.d.ts rename to apps/react-vite/__mocks__/vitest-env.d.ts diff --git a/__mocks__/zustand.ts b/apps/react-vite/__mocks__/zustand.ts similarity index 94% rename from __mocks__/zustand.ts rename to apps/react-vite/__mocks__/zustand.ts index 9c13c70f..a07195c5 100644 --- a/__mocks__/zustand.ts +++ b/apps/react-vite/__mocks__/zustand.ts @@ -21,7 +21,9 @@ export const create = ((stateCreator: zustand.StateCreator) => { console.log('zustand create mock'); // to support curried version of create - return typeof stateCreator === 'function' ? createUncurried(stateCreator) : createUncurried; + return typeof stateCreator === 'function' + ? createUncurried(stateCreator) + : createUncurried; }) as typeof zustand.create; const createStoreUncurried = (stateCreator: zustand.StateCreator) => { diff --git a/e2e/.eslintrc.cjs b/apps/react-vite/e2e/.eslintrc.cjs similarity index 100% rename from e2e/.eslintrc.cjs rename to apps/react-vite/e2e/.eslintrc.cjs diff --git a/e2e/tests/auth.setup.ts b/apps/react-vite/e2e/tests/auth.setup.ts similarity index 100% rename from e2e/tests/auth.setup.ts rename to apps/react-vite/e2e/tests/auth.setup.ts diff --git a/e2e/tests/profile.spec.ts b/apps/react-vite/e2e/tests/profile.spec.ts similarity index 100% rename from e2e/tests/profile.spec.ts rename to apps/react-vite/e2e/tests/profile.spec.ts diff --git a/e2e/tests/smoke.spec.ts b/apps/react-vite/e2e/tests/smoke.spec.ts similarity index 100% rename from e2e/tests/smoke.spec.ts rename to apps/react-vite/e2e/tests/smoke.spec.ts diff --git a/generators/component/component.stories.tsx.hbs b/apps/react-vite/generators/component/component.stories.tsx.hbs similarity index 100% rename from generators/component/component.stories.tsx.hbs rename to apps/react-vite/generators/component/component.stories.tsx.hbs diff --git a/generators/component/component.tsx.hbs b/apps/react-vite/generators/component/component.tsx.hbs similarity index 100% rename from generators/component/component.tsx.hbs rename to apps/react-vite/generators/component/component.tsx.hbs diff --git a/generators/component/index.cjs b/apps/react-vite/generators/component/index.cjs similarity index 100% rename from generators/component/index.cjs rename to apps/react-vite/generators/component/index.cjs diff --git a/generators/component/index.ts.hbs b/apps/react-vite/generators/component/index.ts.hbs similarity index 100% rename from generators/component/index.ts.hbs rename to apps/react-vite/generators/component/index.ts.hbs diff --git a/index.html b/apps/react-vite/index.html similarity index 100% rename from index.html rename to apps/react-vite/index.html diff --git a/mock-server.ts b/apps/react-vite/mock-server.ts similarity index 100% rename from mock-server.ts rename to apps/react-vite/mock-server.ts diff --git a/package.json b/apps/react-vite/package.json similarity index 100% rename from package.json rename to apps/react-vite/package.json diff --git a/playwright.config.ts b/apps/react-vite/playwright.config.ts similarity index 100% rename from playwright.config.ts rename to apps/react-vite/playwright.config.ts diff --git a/plopfile.cjs b/apps/react-vite/plopfile.cjs similarity index 100% rename from plopfile.cjs rename to apps/react-vite/plopfile.cjs diff --git a/postcss.config.cjs b/apps/react-vite/postcss.config.cjs similarity index 100% rename from postcss.config.cjs rename to apps/react-vite/postcss.config.cjs diff --git a/public/_redirects b/apps/react-vite/public/_redirects similarity index 100% rename from public/_redirects rename to apps/react-vite/public/_redirects diff --git a/public/favicon.ico b/apps/react-vite/public/favicon.ico similarity index 100% rename from public/favicon.ico rename to apps/react-vite/public/favicon.ico diff --git a/public/logo192.png b/apps/react-vite/public/logo192.png similarity index 100% rename from public/logo192.png rename to apps/react-vite/public/logo192.png diff --git a/public/logo512.png b/apps/react-vite/public/logo512.png similarity index 100% rename from public/logo512.png rename to apps/react-vite/public/logo512.png diff --git a/public/mockServiceWorker.js b/apps/react-vite/public/mockServiceWorker.js similarity index 100% rename from public/mockServiceWorker.js rename to apps/react-vite/public/mockServiceWorker.js diff --git a/public/robots.txt b/apps/react-vite/public/robots.txt similarity index 100% rename from public/robots.txt rename to apps/react-vite/public/robots.txt diff --git a/src/app/index.tsx b/apps/react-vite/src/app/index.tsx similarity index 100% rename from src/app/index.tsx rename to apps/react-vite/src/app/index.tsx diff --git a/src/app/main-provider.tsx b/apps/react-vite/src/app/main-provider.tsx similarity index 100% rename from src/app/main-provider.tsx rename to apps/react-vite/src/app/main-provider.tsx diff --git a/src/app/routes/app/dashboard.tsx b/apps/react-vite/src/app/routes/app/dashboard.tsx similarity index 100% rename from src/app/routes/app/dashboard.tsx rename to apps/react-vite/src/app/routes/app/dashboard.tsx diff --git a/src/app/routes/app/discussions/__tests__/discussion.test.tsx b/apps/react-vite/src/app/routes/app/discussions/__tests__/discussion.test.tsx similarity index 100% rename from src/app/routes/app/discussions/__tests__/discussion.test.tsx rename to apps/react-vite/src/app/routes/app/discussions/__tests__/discussion.test.tsx diff --git a/src/app/routes/app/discussions/__tests__/discussions.test.tsx b/apps/react-vite/src/app/routes/app/discussions/__tests__/discussions.test.tsx similarity index 100% rename from src/app/routes/app/discussions/__tests__/discussions.test.tsx rename to apps/react-vite/src/app/routes/app/discussions/__tests__/discussions.test.tsx diff --git a/src/app/routes/app/discussions/discussion.tsx b/apps/react-vite/src/app/routes/app/discussions/discussion.tsx similarity index 100% rename from src/app/routes/app/discussions/discussion.tsx rename to apps/react-vite/src/app/routes/app/discussions/discussion.tsx diff --git a/src/app/routes/app/discussions/discussions.tsx b/apps/react-vite/src/app/routes/app/discussions/discussions.tsx similarity index 100% rename from src/app/routes/app/discussions/discussions.tsx rename to apps/react-vite/src/app/routes/app/discussions/discussions.tsx diff --git a/src/app/routes/app/profile.tsx b/apps/react-vite/src/app/routes/app/profile.tsx similarity index 100% rename from src/app/routes/app/profile.tsx rename to apps/react-vite/src/app/routes/app/profile.tsx diff --git a/src/app/routes/app/root.tsx b/apps/react-vite/src/app/routes/app/root.tsx similarity index 100% rename from src/app/routes/app/root.tsx rename to apps/react-vite/src/app/routes/app/root.tsx diff --git a/src/app/routes/app/users.tsx b/apps/react-vite/src/app/routes/app/users.tsx similarity index 100% rename from src/app/routes/app/users.tsx rename to apps/react-vite/src/app/routes/app/users.tsx diff --git a/src/app/routes/auth/login.tsx b/apps/react-vite/src/app/routes/auth/login.tsx similarity index 100% rename from src/app/routes/auth/login.tsx rename to apps/react-vite/src/app/routes/auth/login.tsx diff --git a/src/app/routes/auth/register.tsx b/apps/react-vite/src/app/routes/auth/register.tsx similarity index 100% rename from src/app/routes/auth/register.tsx rename to apps/react-vite/src/app/routes/auth/register.tsx diff --git a/src/app/routes/index.tsx b/apps/react-vite/src/app/routes/index.tsx similarity index 100% rename from src/app/routes/index.tsx rename to apps/react-vite/src/app/routes/index.tsx diff --git a/src/app/routes/landing.tsx b/apps/react-vite/src/app/routes/landing.tsx similarity index 100% rename from src/app/routes/landing.tsx rename to apps/react-vite/src/app/routes/landing.tsx diff --git a/src/app/routes/not-found.tsx b/apps/react-vite/src/app/routes/not-found.tsx similarity index 100% rename from src/app/routes/not-found.tsx rename to apps/react-vite/src/app/routes/not-found.tsx diff --git a/src/assets/logo.svg b/apps/react-vite/src/assets/logo.svg similarity index 100% rename from src/assets/logo.svg rename to apps/react-vite/src/assets/logo.svg diff --git a/src/components/errors/main.tsx b/apps/react-vite/src/components/errors/main.tsx similarity index 100% rename from src/components/errors/main.tsx rename to apps/react-vite/src/components/errors/main.tsx diff --git a/src/components/layouts/auth-layout.tsx b/apps/react-vite/src/components/layouts/auth-layout.tsx similarity index 100% rename from src/components/layouts/auth-layout.tsx rename to apps/react-vite/src/components/layouts/auth-layout.tsx diff --git a/src/components/layouts/content-layout.tsx b/apps/react-vite/src/components/layouts/content-layout.tsx similarity index 100% rename from src/components/layouts/content-layout.tsx rename to apps/react-vite/src/components/layouts/content-layout.tsx diff --git a/src/components/layouts/dashboard-layout.tsx b/apps/react-vite/src/components/layouts/dashboard-layout.tsx similarity index 100% rename from src/components/layouts/dashboard-layout.tsx rename to apps/react-vite/src/components/layouts/dashboard-layout.tsx diff --git a/src/components/layouts/index.ts b/apps/react-vite/src/components/layouts/index.ts similarity index 100% rename from src/components/layouts/index.ts rename to apps/react-vite/src/components/layouts/index.ts diff --git a/src/components/seo/__tests__/head.test.tsx b/apps/react-vite/src/components/seo/__tests__/head.test.tsx similarity index 100% rename from src/components/seo/__tests__/head.test.tsx rename to apps/react-vite/src/components/seo/__tests__/head.test.tsx diff --git a/src/components/seo/head.tsx b/apps/react-vite/src/components/seo/head.tsx similarity index 100% rename from src/components/seo/head.tsx rename to apps/react-vite/src/components/seo/head.tsx diff --git a/src/components/seo/index.ts b/apps/react-vite/src/components/seo/index.ts similarity index 100% rename from src/components/seo/index.ts rename to apps/react-vite/src/components/seo/index.ts diff --git a/src/components/ui/button/button.stories.tsx b/apps/react-vite/src/components/ui/button/button.stories.tsx similarity index 100% rename from src/components/ui/button/button.stories.tsx rename to apps/react-vite/src/components/ui/button/button.stories.tsx diff --git a/src/components/ui/button/button.tsx b/apps/react-vite/src/components/ui/button/button.tsx similarity index 100% rename from src/components/ui/button/button.tsx rename to apps/react-vite/src/components/ui/button/button.tsx diff --git a/src/components/ui/button/index.ts b/apps/react-vite/src/components/ui/button/index.ts similarity index 100% rename from src/components/ui/button/index.ts rename to apps/react-vite/src/components/ui/button/index.ts diff --git a/src/components/ui/dialog/__tests__/dialog.test.tsx b/apps/react-vite/src/components/ui/dialog/__tests__/dialog.test.tsx similarity index 100% rename from src/components/ui/dialog/__tests__/dialog.test.tsx rename to apps/react-vite/src/components/ui/dialog/__tests__/dialog.test.tsx diff --git a/src/components/ui/dialog/confirmation-dialog/__tests__/confirmation-dialog.test.tsx b/apps/react-vite/src/components/ui/dialog/confirmation-dialog/__tests__/confirmation-dialog.test.tsx similarity index 100% rename from src/components/ui/dialog/confirmation-dialog/__tests__/confirmation-dialog.test.tsx rename to apps/react-vite/src/components/ui/dialog/confirmation-dialog/__tests__/confirmation-dialog.test.tsx diff --git a/src/components/ui/dialog/confirmation-dialog/confirmation-dialog.stories.tsx b/apps/react-vite/src/components/ui/dialog/confirmation-dialog/confirmation-dialog.stories.tsx similarity index 100% rename from src/components/ui/dialog/confirmation-dialog/confirmation-dialog.stories.tsx rename to apps/react-vite/src/components/ui/dialog/confirmation-dialog/confirmation-dialog.stories.tsx diff --git a/src/components/ui/dialog/confirmation-dialog/confirmation-dialog.tsx b/apps/react-vite/src/components/ui/dialog/confirmation-dialog/confirmation-dialog.tsx similarity index 100% rename from src/components/ui/dialog/confirmation-dialog/confirmation-dialog.tsx rename to apps/react-vite/src/components/ui/dialog/confirmation-dialog/confirmation-dialog.tsx diff --git a/src/components/ui/dialog/confirmation-dialog/index.ts b/apps/react-vite/src/components/ui/dialog/confirmation-dialog/index.ts similarity index 100% rename from src/components/ui/dialog/confirmation-dialog/index.ts rename to apps/react-vite/src/components/ui/dialog/confirmation-dialog/index.ts diff --git a/src/components/ui/dialog/dialog.stories.tsx b/apps/react-vite/src/components/ui/dialog/dialog.stories.tsx similarity index 100% rename from src/components/ui/dialog/dialog.stories.tsx rename to apps/react-vite/src/components/ui/dialog/dialog.stories.tsx diff --git a/src/components/ui/dialog/dialog.tsx b/apps/react-vite/src/components/ui/dialog/dialog.tsx similarity index 100% rename from src/components/ui/dialog/dialog.tsx rename to apps/react-vite/src/components/ui/dialog/dialog.tsx diff --git a/src/components/ui/dialog/index.ts b/apps/react-vite/src/components/ui/dialog/index.ts similarity index 100% rename from src/components/ui/dialog/index.ts rename to apps/react-vite/src/components/ui/dialog/index.ts diff --git a/src/components/ui/drawer/__tests__/drawer.test.tsx b/apps/react-vite/src/components/ui/drawer/__tests__/drawer.test.tsx similarity index 100% rename from src/components/ui/drawer/__tests__/drawer.test.tsx rename to apps/react-vite/src/components/ui/drawer/__tests__/drawer.test.tsx diff --git a/src/components/ui/drawer/drawer.stories.tsx b/apps/react-vite/src/components/ui/drawer/drawer.stories.tsx similarity index 100% rename from src/components/ui/drawer/drawer.stories.tsx rename to apps/react-vite/src/components/ui/drawer/drawer.stories.tsx diff --git a/src/components/ui/drawer/drawer.tsx b/apps/react-vite/src/components/ui/drawer/drawer.tsx similarity index 100% rename from src/components/ui/drawer/drawer.tsx rename to apps/react-vite/src/components/ui/drawer/drawer.tsx diff --git a/src/components/ui/drawer/index.ts b/apps/react-vite/src/components/ui/drawer/index.ts similarity index 100% rename from src/components/ui/drawer/index.ts rename to apps/react-vite/src/components/ui/drawer/index.ts diff --git a/src/components/ui/dropdown/dropdown.tsx b/apps/react-vite/src/components/ui/dropdown/dropdown.tsx similarity index 100% rename from src/components/ui/dropdown/dropdown.tsx rename to apps/react-vite/src/components/ui/dropdown/dropdown.tsx diff --git a/src/components/ui/dropdown/index.ts b/apps/react-vite/src/components/ui/dropdown/index.ts similarity index 100% rename from src/components/ui/dropdown/index.ts rename to apps/react-vite/src/components/ui/dropdown/index.ts diff --git a/src/components/ui/form/__tests__/form.test.tsx b/apps/react-vite/src/components/ui/form/__tests__/form.test.tsx similarity index 100% rename from src/components/ui/form/__tests__/form.test.tsx rename to apps/react-vite/src/components/ui/form/__tests__/form.test.tsx diff --git a/src/components/ui/form/error.tsx b/apps/react-vite/src/components/ui/form/error.tsx similarity index 100% rename from src/components/ui/form/error.tsx rename to apps/react-vite/src/components/ui/form/error.tsx diff --git a/src/components/ui/form/field-wrapper.tsx b/apps/react-vite/src/components/ui/form/field-wrapper.tsx similarity index 100% rename from src/components/ui/form/field-wrapper.tsx rename to apps/react-vite/src/components/ui/form/field-wrapper.tsx diff --git a/src/components/ui/form/form-drawer.tsx b/apps/react-vite/src/components/ui/form/form-drawer.tsx similarity index 100% rename from src/components/ui/form/form-drawer.tsx rename to apps/react-vite/src/components/ui/form/form-drawer.tsx diff --git a/src/components/ui/form/form.stories.tsx b/apps/react-vite/src/components/ui/form/form.stories.tsx similarity index 100% rename from src/components/ui/form/form.stories.tsx rename to apps/react-vite/src/components/ui/form/form.stories.tsx diff --git a/src/components/ui/form/form.tsx b/apps/react-vite/src/components/ui/form/form.tsx similarity index 100% rename from src/components/ui/form/form.tsx rename to apps/react-vite/src/components/ui/form/form.tsx diff --git a/src/components/ui/form/index.ts b/apps/react-vite/src/components/ui/form/index.ts similarity index 100% rename from src/components/ui/form/index.ts rename to apps/react-vite/src/components/ui/form/index.ts diff --git a/src/components/ui/form/input.tsx b/apps/react-vite/src/components/ui/form/input.tsx similarity index 100% rename from src/components/ui/form/input.tsx rename to apps/react-vite/src/components/ui/form/input.tsx diff --git a/src/components/ui/form/label.tsx b/apps/react-vite/src/components/ui/form/label.tsx similarity index 100% rename from src/components/ui/form/label.tsx rename to apps/react-vite/src/components/ui/form/label.tsx diff --git a/src/components/ui/form/select.tsx b/apps/react-vite/src/components/ui/form/select.tsx similarity index 100% rename from src/components/ui/form/select.tsx rename to apps/react-vite/src/components/ui/form/select.tsx diff --git a/src/components/ui/form/switch.tsx b/apps/react-vite/src/components/ui/form/switch.tsx similarity index 100% rename from src/components/ui/form/switch.tsx rename to apps/react-vite/src/components/ui/form/switch.tsx diff --git a/src/components/ui/form/textarea.tsx b/apps/react-vite/src/components/ui/form/textarea.tsx similarity index 100% rename from src/components/ui/form/textarea.tsx rename to apps/react-vite/src/components/ui/form/textarea.tsx diff --git a/src/components/ui/link/index.ts b/apps/react-vite/src/components/ui/link/index.ts similarity index 100% rename from src/components/ui/link/index.ts rename to apps/react-vite/src/components/ui/link/index.ts diff --git a/src/components/ui/link/link.stories.tsx b/apps/react-vite/src/components/ui/link/link.stories.tsx similarity index 100% rename from src/components/ui/link/link.stories.tsx rename to apps/react-vite/src/components/ui/link/link.stories.tsx diff --git a/src/components/ui/link/link.tsx b/apps/react-vite/src/components/ui/link/link.tsx similarity index 100% rename from src/components/ui/link/link.tsx rename to apps/react-vite/src/components/ui/link/link.tsx diff --git a/src/components/ui/md-preview/index.ts b/apps/react-vite/src/components/ui/md-preview/index.ts similarity index 100% rename from src/components/ui/md-preview/index.ts rename to apps/react-vite/src/components/ui/md-preview/index.ts diff --git a/src/components/ui/md-preview/md-preview.stories.tsx b/apps/react-vite/src/components/ui/md-preview/md-preview.stories.tsx similarity index 100% rename from src/components/ui/md-preview/md-preview.stories.tsx rename to apps/react-vite/src/components/ui/md-preview/md-preview.stories.tsx diff --git a/src/components/ui/md-preview/md-preview.tsx b/apps/react-vite/src/components/ui/md-preview/md-preview.tsx similarity index 100% rename from src/components/ui/md-preview/md-preview.tsx rename to apps/react-vite/src/components/ui/md-preview/md-preview.tsx diff --git a/src/components/ui/notifications/__tests__/notifications.test.ts b/apps/react-vite/src/components/ui/notifications/__tests__/notifications.test.ts similarity index 100% rename from src/components/ui/notifications/__tests__/notifications.test.ts rename to apps/react-vite/src/components/ui/notifications/__tests__/notifications.test.ts diff --git a/src/components/ui/notifications/index.ts b/apps/react-vite/src/components/ui/notifications/index.ts similarity index 100% rename from src/components/ui/notifications/index.ts rename to apps/react-vite/src/components/ui/notifications/index.ts diff --git a/src/components/ui/notifications/notification.stories.tsx b/apps/react-vite/src/components/ui/notifications/notification.stories.tsx similarity index 100% rename from src/components/ui/notifications/notification.stories.tsx rename to apps/react-vite/src/components/ui/notifications/notification.stories.tsx diff --git a/src/components/ui/notifications/notification.tsx b/apps/react-vite/src/components/ui/notifications/notification.tsx similarity index 100% rename from src/components/ui/notifications/notification.tsx rename to apps/react-vite/src/components/ui/notifications/notification.tsx diff --git a/src/components/ui/notifications/notifications-store.ts b/apps/react-vite/src/components/ui/notifications/notifications-store.ts similarity index 100% rename from src/components/ui/notifications/notifications-store.ts rename to apps/react-vite/src/components/ui/notifications/notifications-store.ts diff --git a/src/components/ui/notifications/notifications.tsx b/apps/react-vite/src/components/ui/notifications/notifications.tsx similarity index 100% rename from src/components/ui/notifications/notifications.tsx rename to apps/react-vite/src/components/ui/notifications/notifications.tsx diff --git a/src/components/ui/spinner/index.ts b/apps/react-vite/src/components/ui/spinner/index.ts similarity index 100% rename from src/components/ui/spinner/index.ts rename to apps/react-vite/src/components/ui/spinner/index.ts diff --git a/src/components/ui/spinner/spinner.stories.tsx b/apps/react-vite/src/components/ui/spinner/spinner.stories.tsx similarity index 100% rename from src/components/ui/spinner/spinner.stories.tsx rename to apps/react-vite/src/components/ui/spinner/spinner.stories.tsx diff --git a/src/components/ui/spinner/spinner.tsx b/apps/react-vite/src/components/ui/spinner/spinner.tsx similarity index 100% rename from src/components/ui/spinner/spinner.tsx rename to apps/react-vite/src/components/ui/spinner/spinner.tsx diff --git a/src/components/ui/table/index.ts b/apps/react-vite/src/components/ui/table/index.ts similarity index 100% rename from src/components/ui/table/index.ts rename to apps/react-vite/src/components/ui/table/index.ts diff --git a/src/components/ui/table/table.stories.tsx b/apps/react-vite/src/components/ui/table/table.stories.tsx similarity index 100% rename from src/components/ui/table/table.stories.tsx rename to apps/react-vite/src/components/ui/table/table.stories.tsx diff --git a/src/components/ui/table/table.tsx b/apps/react-vite/src/components/ui/table/table.tsx similarity index 100% rename from src/components/ui/table/table.tsx rename to apps/react-vite/src/components/ui/table/table.tsx diff --git a/src/config/env.ts b/apps/react-vite/src/config/env.ts similarity index 100% rename from src/config/env.ts rename to apps/react-vite/src/config/env.ts diff --git a/src/features/auth/components/__tests__/login-form.test.tsx b/apps/react-vite/src/features/auth/components/__tests__/login-form.test.tsx similarity index 100% rename from src/features/auth/components/__tests__/login-form.test.tsx rename to apps/react-vite/src/features/auth/components/__tests__/login-form.test.tsx diff --git a/src/features/auth/components/__tests__/register-form.test.tsx b/apps/react-vite/src/features/auth/components/__tests__/register-form.test.tsx similarity index 100% rename from src/features/auth/components/__tests__/register-form.test.tsx rename to apps/react-vite/src/features/auth/components/__tests__/register-form.test.tsx diff --git a/src/features/auth/components/login-form.tsx b/apps/react-vite/src/features/auth/components/login-form.tsx similarity index 100% rename from src/features/auth/components/login-form.tsx rename to apps/react-vite/src/features/auth/components/login-form.tsx diff --git a/src/features/auth/components/register-form.tsx b/apps/react-vite/src/features/auth/components/register-form.tsx similarity index 100% rename from src/features/auth/components/register-form.tsx rename to apps/react-vite/src/features/auth/components/register-form.tsx diff --git a/src/features/comments/api/create-comment.ts b/apps/react-vite/src/features/comments/api/create-comment.ts similarity index 100% rename from src/features/comments/api/create-comment.ts rename to apps/react-vite/src/features/comments/api/create-comment.ts diff --git a/src/features/comments/api/delete-comment.ts b/apps/react-vite/src/features/comments/api/delete-comment.ts similarity index 100% rename from src/features/comments/api/delete-comment.ts rename to apps/react-vite/src/features/comments/api/delete-comment.ts diff --git a/src/features/comments/api/get-comments.ts b/apps/react-vite/src/features/comments/api/get-comments.ts similarity index 100% rename from src/features/comments/api/get-comments.ts rename to apps/react-vite/src/features/comments/api/get-comments.ts diff --git a/src/features/comments/components/comments-list.tsx b/apps/react-vite/src/features/comments/components/comments-list.tsx similarity index 100% rename from src/features/comments/components/comments-list.tsx rename to apps/react-vite/src/features/comments/components/comments-list.tsx diff --git a/src/features/comments/components/comments.tsx b/apps/react-vite/src/features/comments/components/comments.tsx similarity index 100% rename from src/features/comments/components/comments.tsx rename to apps/react-vite/src/features/comments/components/comments.tsx diff --git a/src/features/comments/components/create-comment.tsx b/apps/react-vite/src/features/comments/components/create-comment.tsx similarity index 100% rename from src/features/comments/components/create-comment.tsx rename to apps/react-vite/src/features/comments/components/create-comment.tsx diff --git a/src/features/comments/components/delete-comment.tsx b/apps/react-vite/src/features/comments/components/delete-comment.tsx similarity index 100% rename from src/features/comments/components/delete-comment.tsx rename to apps/react-vite/src/features/comments/components/delete-comment.tsx diff --git a/src/features/discussions/api/create-discussion.ts b/apps/react-vite/src/features/discussions/api/create-discussion.ts similarity index 100% rename from src/features/discussions/api/create-discussion.ts rename to apps/react-vite/src/features/discussions/api/create-discussion.ts diff --git a/src/features/discussions/api/delete-discussion.ts b/apps/react-vite/src/features/discussions/api/delete-discussion.ts similarity index 100% rename from src/features/discussions/api/delete-discussion.ts rename to apps/react-vite/src/features/discussions/api/delete-discussion.ts diff --git a/src/features/discussions/api/get-discussion.ts b/apps/react-vite/src/features/discussions/api/get-discussion.ts similarity index 100% rename from src/features/discussions/api/get-discussion.ts rename to apps/react-vite/src/features/discussions/api/get-discussion.ts diff --git a/src/features/discussions/api/get-discussions.ts b/apps/react-vite/src/features/discussions/api/get-discussions.ts similarity index 100% rename from src/features/discussions/api/get-discussions.ts rename to apps/react-vite/src/features/discussions/api/get-discussions.ts diff --git a/src/features/discussions/api/update-discussion.ts b/apps/react-vite/src/features/discussions/api/update-discussion.ts similarity index 100% rename from src/features/discussions/api/update-discussion.ts rename to apps/react-vite/src/features/discussions/api/update-discussion.ts diff --git a/src/features/discussions/components/create-discussion.tsx b/apps/react-vite/src/features/discussions/components/create-discussion.tsx similarity index 100% rename from src/features/discussions/components/create-discussion.tsx rename to apps/react-vite/src/features/discussions/components/create-discussion.tsx diff --git a/src/features/discussions/components/delete-discussion.tsx b/apps/react-vite/src/features/discussions/components/delete-discussion.tsx similarity index 100% rename from src/features/discussions/components/delete-discussion.tsx rename to apps/react-vite/src/features/discussions/components/delete-discussion.tsx diff --git a/src/features/discussions/components/discussion-view.tsx b/apps/react-vite/src/features/discussions/components/discussion-view.tsx similarity index 100% rename from src/features/discussions/components/discussion-view.tsx rename to apps/react-vite/src/features/discussions/components/discussion-view.tsx diff --git a/src/features/discussions/components/discussions-list.tsx b/apps/react-vite/src/features/discussions/components/discussions-list.tsx similarity index 100% rename from src/features/discussions/components/discussions-list.tsx rename to apps/react-vite/src/features/discussions/components/discussions-list.tsx diff --git a/src/features/discussions/components/update-discussion.tsx b/apps/react-vite/src/features/discussions/components/update-discussion.tsx similarity index 100% rename from src/features/discussions/components/update-discussion.tsx rename to apps/react-vite/src/features/discussions/components/update-discussion.tsx diff --git a/src/features/teams/api/get-teams.ts b/apps/react-vite/src/features/teams/api/get-teams.ts similarity index 100% rename from src/features/teams/api/get-teams.ts rename to apps/react-vite/src/features/teams/api/get-teams.ts diff --git a/src/features/users/api/delete-user.ts b/apps/react-vite/src/features/users/api/delete-user.ts similarity index 100% rename from src/features/users/api/delete-user.ts rename to apps/react-vite/src/features/users/api/delete-user.ts diff --git a/src/features/users/api/get-users.ts b/apps/react-vite/src/features/users/api/get-users.ts similarity index 100% rename from src/features/users/api/get-users.ts rename to apps/react-vite/src/features/users/api/get-users.ts diff --git a/src/features/users/api/update-profile.ts b/apps/react-vite/src/features/users/api/update-profile.ts similarity index 100% rename from src/features/users/api/update-profile.ts rename to apps/react-vite/src/features/users/api/update-profile.ts diff --git a/src/features/users/components/delete-user.tsx b/apps/react-vite/src/features/users/components/delete-user.tsx similarity index 100% rename from src/features/users/components/delete-user.tsx rename to apps/react-vite/src/features/users/components/delete-user.tsx diff --git a/src/features/users/components/update-profile.tsx b/apps/react-vite/src/features/users/components/update-profile.tsx similarity index 100% rename from src/features/users/components/update-profile.tsx rename to apps/react-vite/src/features/users/components/update-profile.tsx diff --git a/src/features/users/components/users-list.tsx b/apps/react-vite/src/features/users/components/users-list.tsx similarity index 100% rename from src/features/users/components/users-list.tsx rename to apps/react-vite/src/features/users/components/users-list.tsx diff --git a/src/hooks/__tests__/use-disclosure.test.ts b/apps/react-vite/src/hooks/__tests__/use-disclosure.test.ts similarity index 100% rename from src/hooks/__tests__/use-disclosure.test.ts rename to apps/react-vite/src/hooks/__tests__/use-disclosure.test.ts diff --git a/src/hooks/use-disclosure.ts b/apps/react-vite/src/hooks/use-disclosure.ts similarity index 100% rename from src/hooks/use-disclosure.ts rename to apps/react-vite/src/hooks/use-disclosure.ts diff --git a/src/index.css b/apps/react-vite/src/index.css similarity index 100% rename from src/index.css rename to apps/react-vite/src/index.css diff --git a/src/lib/__tests__/authorization.test.tsx b/apps/react-vite/src/lib/__tests__/authorization.test.tsx similarity index 100% rename from src/lib/__tests__/authorization.test.tsx rename to apps/react-vite/src/lib/__tests__/authorization.test.tsx diff --git a/src/lib/api-client.ts b/apps/react-vite/src/lib/api-client.ts similarity index 100% rename from src/lib/api-client.ts rename to apps/react-vite/src/lib/api-client.ts diff --git a/src/lib/auth.tsx b/apps/react-vite/src/lib/auth.tsx similarity index 100% rename from src/lib/auth.tsx rename to apps/react-vite/src/lib/auth.tsx diff --git a/src/lib/authorization.tsx b/apps/react-vite/src/lib/authorization.tsx similarity index 100% rename from src/lib/authorization.tsx rename to apps/react-vite/src/lib/authorization.tsx diff --git a/src/lib/react-query.ts b/apps/react-vite/src/lib/react-query.ts similarity index 100% rename from src/lib/react-query.ts rename to apps/react-vite/src/lib/react-query.ts diff --git a/src/main.tsx b/apps/react-vite/src/main.tsx similarity index 100% rename from src/main.tsx rename to apps/react-vite/src/main.tsx diff --git a/src/testing/data-generators.ts b/apps/react-vite/src/testing/data-generators.ts similarity index 100% rename from src/testing/data-generators.ts rename to apps/react-vite/src/testing/data-generators.ts diff --git a/src/testing/mocks/browser.ts b/apps/react-vite/src/testing/mocks/browser.ts similarity index 100% rename from src/testing/mocks/browser.ts rename to apps/react-vite/src/testing/mocks/browser.ts diff --git a/src/testing/mocks/db.ts b/apps/react-vite/src/testing/mocks/db.ts similarity index 100% rename from src/testing/mocks/db.ts rename to apps/react-vite/src/testing/mocks/db.ts diff --git a/src/testing/mocks/handlers/auth.ts b/apps/react-vite/src/testing/mocks/handlers/auth.ts similarity index 100% rename from src/testing/mocks/handlers/auth.ts rename to apps/react-vite/src/testing/mocks/handlers/auth.ts diff --git a/src/testing/mocks/handlers/comments.ts b/apps/react-vite/src/testing/mocks/handlers/comments.ts similarity index 100% rename from src/testing/mocks/handlers/comments.ts rename to apps/react-vite/src/testing/mocks/handlers/comments.ts diff --git a/src/testing/mocks/handlers/discussions.ts b/apps/react-vite/src/testing/mocks/handlers/discussions.ts similarity index 100% rename from src/testing/mocks/handlers/discussions.ts rename to apps/react-vite/src/testing/mocks/handlers/discussions.ts diff --git a/src/testing/mocks/handlers/index.ts b/apps/react-vite/src/testing/mocks/handlers/index.ts similarity index 100% rename from src/testing/mocks/handlers/index.ts rename to apps/react-vite/src/testing/mocks/handlers/index.ts diff --git a/src/testing/mocks/handlers/teams.ts b/apps/react-vite/src/testing/mocks/handlers/teams.ts similarity index 100% rename from src/testing/mocks/handlers/teams.ts rename to apps/react-vite/src/testing/mocks/handlers/teams.ts diff --git a/src/testing/mocks/handlers/users.ts b/apps/react-vite/src/testing/mocks/handlers/users.ts similarity index 100% rename from src/testing/mocks/handlers/users.ts rename to apps/react-vite/src/testing/mocks/handlers/users.ts diff --git a/src/testing/mocks/index.ts b/apps/react-vite/src/testing/mocks/index.ts similarity index 100% rename from src/testing/mocks/index.ts rename to apps/react-vite/src/testing/mocks/index.ts diff --git a/src/testing/mocks/server.ts b/apps/react-vite/src/testing/mocks/server.ts similarity index 100% rename from src/testing/mocks/server.ts rename to apps/react-vite/src/testing/mocks/server.ts diff --git a/src/testing/mocks/utils.ts b/apps/react-vite/src/testing/mocks/utils.ts similarity index 100% rename from src/testing/mocks/utils.ts rename to apps/react-vite/src/testing/mocks/utils.ts diff --git a/src/testing/setup-tests.ts b/apps/react-vite/src/testing/setup-tests.ts similarity index 100% rename from src/testing/setup-tests.ts rename to apps/react-vite/src/testing/setup-tests.ts diff --git a/src/testing/test-utils.tsx b/apps/react-vite/src/testing/test-utils.tsx similarity index 100% rename from src/testing/test-utils.tsx rename to apps/react-vite/src/testing/test-utils.tsx diff --git a/src/types/api.ts b/apps/react-vite/src/types/api.ts similarity index 100% rename from src/types/api.ts rename to apps/react-vite/src/types/api.ts diff --git a/src/utils/cn.ts b/apps/react-vite/src/utils/cn.ts similarity index 100% rename from src/utils/cn.ts rename to apps/react-vite/src/utils/cn.ts diff --git a/src/utils/format.ts b/apps/react-vite/src/utils/format.ts similarity index 100% rename from src/utils/format.ts rename to apps/react-vite/src/utils/format.ts diff --git a/src/vite-env.d.ts b/apps/react-vite/src/vite-env.d.ts similarity index 100% rename from src/vite-env.d.ts rename to apps/react-vite/src/vite-env.d.ts diff --git a/tailwind.config.cjs b/apps/react-vite/tailwind.config.cjs similarity index 100% rename from tailwind.config.cjs rename to apps/react-vite/tailwind.config.cjs diff --git a/tsconfig.json b/apps/react-vite/tsconfig.json similarity index 100% rename from tsconfig.json rename to apps/react-vite/tsconfig.json diff --git a/vite-env.d.ts b/apps/react-vite/vite-env.d.ts similarity index 100% rename from vite-env.d.ts rename to apps/react-vite/vite-env.d.ts diff --git a/vite.config.ts b/apps/react-vite/vite.config.ts similarity index 100% rename from vite.config.ts rename to apps/react-vite/vite.config.ts diff --git a/yarn.lock b/apps/react-vite/yarn.lock similarity index 100% rename from yarn.lock rename to apps/react-vite/yarn.lock diff --git a/docs/api-layer.md b/docs/api-layer.md index a13b7e3e..4c99d7f5 100644 --- a/docs/api-layer.md +++ b/docs/api-layer.md @@ -4,7 +4,7 @@ When your application interacts with either RESTful or GraphQL APIs, it is beneficial to use a single instance of the API client that has been pre-configured and can be reused throughout the application. For example, you can create a single API client instance using the native fetch API or libraries such as [axios](https://github.com/axios/axios), [graphql-request](https://github.com/prisma-labs/graphql-request), or [apollo-client](https://www.apollographql.com/docs/react/) with predefined configuration settings. -[API Client Example Code](../src/lib/api-client.ts) +[API Client Example Code](../apps/react-vite/src/lib/api-client.ts) ### Define and Export Request Declarations @@ -19,5 +19,5 @@ Every API request declaration should consist of: This approach simplifies the tracking of defined endpoints available in the application. Additionally, typing the responses and inferring them further down the application enhances application type safety. -[API Request Declarations - Query - Example Code](../src/features/discussions/api/get-discussions.ts) -[API Request Declarations - Mutation - Example Code](../src/features/discussions/api/create-discussion.ts) +[API Request Declarations - Query - Example Code](../apps/react-vite/src/features/discussions/api/get-discussions.ts) +[API Request Declarations - Mutation - Example Code](../apps/react-vite/src/features/discussions/api/create-discussion.ts) diff --git a/docs/components-and-styling.md b/docs/components-and-styling.md index f3954502..4747f657 100644 --- a/docs/components-and-styling.md +++ b/docs/components-and-styling.md @@ -41,17 +41,17 @@ Keep your code style consistent. For example, if you name your components using If your component is accepting too many props you might consider splitting it into multiple components or use the composition technique via children or slots. -[Composition Example Code](../src/components/ui/dialog/confirmation-dialog/confirmation-dialog.tsx) +[Composition Example Code](../apps/react-vite/src/components/ui/dialog/confirmation-dialog/confirmation-dialog.tsx) #### Abstract shared components into a component library For larger projects, it is a good idea to build abstractions around all the shared components. It makes the application more consistent and easier to maintain. Identify repetitions before creating the components to avoid wrong abstractions. -[Component Library Example Code](../src/components/ui/button/button.tsx) +[Component Library Example Code](../apps/react-vite/src/components/ui/button/button.tsx) It is a good idea to wrap 3rd party components as well in order to adapt them to the application's needs. It might be easier to make the underlying changes in the future without affecting the application's functionality. -[3rd Party Component Example Code](../src/components/ui/link/link.tsx) +[3rd Party Component Example Code](../apps/react-vite/src/components/ui/link/link.tsx) ## Component libraries @@ -101,4 +101,4 @@ With the rise of headless component libraries, there is another tier of componen [Storybook](https://storybook.js.org/) is a great tool for developing and testing components in isolation. Think of it as a catalogue of all the components your application is using. Very useful for developing and discoverability of components. -[Storybook Story Example Code](../src/components/ui/button/button.stories.tsx) +[Storybook Story Example Code](../apps/react-vite/src/components/ui/button/button.stories.tsx) diff --git a/docs/error-handling.md b/docs/error-handling.md index 14921f04..ef2c7a67 100644 --- a/docs/error-handling.md +++ b/docs/error-handling.md @@ -4,13 +4,13 @@ Implement an interceptor to manage errors effectively. This interceptor can be utilized to trigger notification toasts informing users of errors, log out unauthorized users, or send requests to refresh tokens to maintain secure and seamless application operation. -[API Errors Notification Example Code](../src/lib/api-client.ts) +[API Errors Notification Example Code](../apps/react-vite/src/lib/api-client.ts) ### In App Errors Utilize error boundaries in React to handle errors within specific parts of your application. Instead of having only one error boundary for the entire app, consider placing multiple error boundaries in different areas. This way, if an error occurs, it can be contained and managed locally without disrupting the entire application's functionality, ensuring a smoother user experience. -[Error Boundary Example Code](../src/app/routes/app/discussions/discussion.tsx) +[Error Boundary Example Code](../apps/react-vite/src/app/routes/app/discussions/discussion.tsx) ### Error Tracking diff --git a/docs/performance.md b/docs/performance.md index bf95fecb..ea03b1fa 100644 --- a/docs/performance.md +++ b/docs/performance.md @@ -6,7 +6,7 @@ Code splitting involves splitting production JavaScript into smaller files to op Ideally, code splitting should be implemented at the routes level, ensuring that only essential code is loaded initially, with additional parts fetched lazily as needed. It's important to avoid excessive code splitting, as this can lead to a performance decline due to the increased number of requests required to fetch all the code chunks. Strategic code splitting, focusing on critical parts of the application, helps balance performance optimization with efficient resource loading. -[Code Splitting Example Code](../src/app/routes/index.tsx) +[Code Splitting Example Code](../apps/react-vite/src/app/routes/index.tsx) ### Component and state optimizations diff --git a/docs/project-standards.md b/docs/project-standards.md index ed019e26..0a4d43fd 100644 --- a/docs/project-standards.md +++ b/docs/project-standards.md @@ -6,13 +6,13 @@ Enforcing project standards is crucial for maintaining code quality, consistency ESLint serves as a valuable linting tool for JavaScript, helping developers in maintaining code quality and adhering to coding standards. By configuring rules in the `.eslintrc.js` file, ESLint helps identify and prevent common errors, ensuring code correctness and promoting consistency throughout the codebase. This approach not only helps in catching mistakes early but also enforces uniformity in coding practices, thereby enhancing the overall quality and readability of the code. -[ESLint Configuration Example Code](../.eslintrc.cjs) +[ESLint Configuration Example Code](../apps/react-vite/.eslintrc.cjs) #### Prettier Prettier is a useful tool for maintaining consistent code formatting in your project. By enabling the "format on save" feature in your IDE, code is automatically formatted according to the rules set in the `.prettierrc` configuration file. This practice ensures a uniform code style across your codebase and provides helpful feedback on code issues. If the auto-formatting fails, it signals potential syntax error. Furthermore, Prettier can be integrated with ESLint to handle code formatting tasks alongside enforcing coding standards effectively throughout the development process. -[Prettier Configuration Example Code](../.prettierrc) +[Prettier Configuration Example Code](../apps/react-vite/.prettierrc) #### TypeScript diff --git a/docs/security.md b/docs/security.md index e38996e9..a787b527 100644 --- a/docs/security.md +++ b/docs/security.md @@ -22,7 +22,7 @@ Opting to store tokens in cookies, configured with the `HttpOnly` attribute, can In addition to securely storing tokens, it's crucial to protect the entire application from Cross-Site Scripting (XSS) attacks. One key strategy is to sanitize all user inputs before displaying them in the application. By carefully sanitizing inputs, you can reduce the risk of XSS vulnerabilities, making the application more resilient to malicious attacks and enhancing overall security for users. -[HTML Sanitization Example Code](../src/components/ui/md-preview/md-preview.tsx) +[HTML Sanitization Example Code](../apps/react-vite/src/components/ui/md-preview/md-preview.tsx) For a full list of security risks, check [OWASP](https://owasp.org/www-project-top-10-client-side-security-risks/). @@ -33,7 +33,7 @@ If you are already using `react-query`, you can use [react-query-auth](https://g User information should be treated as a central piece of data accessible throughout the application. If you are already using `react-query`, consider using it for storing user data as well. Alternatively, you can leverage React context with hooks or opt for a third-party state management library to efficiently manage user state across your application. -[Auth Configuration Example Code](../src/lib/auth.tsx) +[Auth Configuration Example Code](../apps/react-vite/src/lib/auth.tsx) The application will assume the user is authenticated if a user object is present. @@ -43,11 +43,11 @@ Authorization is the process of verifying whether a user has permission to acces #### RBAC (Role based access control) -[Authorization Configuration Example Code](../src/lib/authorization.tsx) +[Authorization Configuration Example Code](../apps/react-vite/src/lib/authorization.tsx) In a role-based authorization model, access to resources is determined by defining specific roles and associating them with permissions. For example, roles such as `USER` and `ADMIN` can be assigned different levels of access rights within the application. Users are then granted access based on their roles; for instance, restricting certain functionalities to regular users while permitting administrators to access all features and functionalities. -[RBAC Example Code](../src/features/discussions/components/create-discussion.tsx) +[RBAC Example Code](../apps/react-vite/src/features/discussions/components/create-discussion.tsx) #### PBAC (Permission based access control) @@ -55,4 +55,4 @@ While Role-Based Access Control (RBAC) provides a structured methodology for aut For RBAC protection, you can use the `RBAC` component by passing allowed roles to it. On the other hand, if you need more strict protection, you can pass policies check to it. -[PBAC Example Code](../src/features/comments/components/comments-list.tsx) +[PBAC Example Code](../apps/react-vite/src/features/comments/components/comments-list.tsx) diff --git a/docs/state-management.md b/docs/state-management.md index 1510e32d..b2691f1e 100644 --- a/docs/state-management.md +++ b/docs/state-management.md @@ -9,7 +9,7 @@ Component state is specific to individual components and should not be shared gl - [useState](https://react.dev/reference/react/useState) - for simpler states that are independent - [useReducer](https://react.dev/reference/react/useReducer) - for more complex states where on a single action you want to update several pieces of state -[Component State Example Code](../src/components/layouts/dashboard-layout.tsx) +[Component State Example Code](../apps/react-vite/src/components/layouts/dashboard-layout.tsx) ## Application State @@ -24,7 +24,7 @@ Good Application State Solutions: - [jotai](https://github.com/pmndrs/jotai) - [xstate](https://xstate.js.org/) -[Global State Example Code](../src/components/ui/notifications/notifications-store.ts) +[Global State Example Code](../apps/react-vite/src/components/ui/notifications/notifications-store.ts) ## Server Cache State @@ -38,7 +38,7 @@ Good Server Cache Libraries: - [urql](https://formidable.com/open-source/urql/) - GraphQl - [RTK](https://redux-toolkit.js.org/rtk-query) -[Server Cache State Example Code](../src/features/discussions/api/get-discussions.ts) +[Server Cache State Example Code](../apps/react-vite/src/features/discussions/api/get-discussions.ts) ## Form State @@ -56,19 +56,19 @@ Although it is possible to build any form using only React primitives, there are Create abstracted `Form` component and all the input field components that wrap the library functionality and are adapted to the application needs. -[Form Example Code](../src/components/ui/form/form.tsx) +[Form Example Code](../apps/react-vite/src/components/ui/form/form.tsx) -[Input Field Example Code](../src/components/ui/form/input.tsx) +[Input Field Example Code](../apps/react-vite/src/components/ui/form/input.tsx) You can also integrate validation libraries with the mentioned solutions to validate inputs on the client. Some good options are: - [zod](https://github.com/colinhacks/zod) - [yup](https://github.com/jquense/yup) -[Validation Example Code](../src/features/auth/components/register-form.tsx) +[Validation Example Code](../apps/react-vite/src/features/auth/components/register-form.tsx) ## URL State URL state refers to the data stored and manipulated within the address bar of the browser. This state is commonly managed through URL parameters (e.g., /app/${dynamicParam}) or query parameters (e.g., /app?dynamicParam=1). By incorporating routing solutions like react-router-dom, you can effectively access and control the URL state, enabling dynamic manipulation of application parameters directly from the browser's address bar. -[URL State Example Code](../src/features/discussions/components/discussion-view.tsx) +[URL State Example Code](../apps/react-vite/src/features/discussions/components/discussion-view.tsx) diff --git a/docs/testing.md b/docs/testing.md index c6e370c7..32b24144 100644 --- a/docs/testing.md +++ b/docs/testing.md @@ -8,19 +8,19 @@ As highlighted in this [tweet](https://twitter.com/rauchg/status/807626710350839 Unit tests are the smallest tests you can write. They test individual parts of your application in isolation. They are useful for testing shared components and functions that are used throughout the entire application. They are also useful for testing complex logic in a single component. They are fast to run and easy to write. -[Unit Test Example Code](../src/components/ui/dialog/confirmation-dialog/__tests__/confirmation-dialog.test.tsx) +[Unit Test Example Code](../apps/react-vite/src/components/ui/dialog/confirmation-dialog/__tests__/confirmation-dialog.test.tsx) ### Integration Tests Integration testing checks how different parts of your application work together. It's crucial to focus on integration tests for most of your testing, as they provide significant benefits and boost confidence in your application's reliability. While unit tests are helpful for individual parts, passing them doesn't guarantee your app will function correctly if the connections between parts are flawed. Testing various features with integration tests is vital to ensure that your application works smoothly and consistently. -[Integration Test Example Code](../src/app/routes/app/discussions/__tests__/discussion.test.tsx) +[Integration Test Example Code](../apps/react-vite/src/app/routes/app/discussions/__tests__/discussion.test.tsx) ### E2E End-to-End Testing is a method that evaluates an application as a whole. These tests involve automating the complete application, including both the frontend and backend, to confirm that the entire system functions correctly. End-to-End tests simulate how a user would interact with the application. -[E2E Example Code](../e2e/tests/smoke.spec.ts) +[E2E Example Code](../apps/react-vite/e2e/tests/smoke.spec.ts) ## Recommended Tooling: @@ -46,8 +46,8 @@ For prototyping the API use msw, which is a great tool for quickly creating fron It can be used for designing API endpoints. The business logic of the mocked API can be created in its handlers. -[API Handlers Example Code](../src/testing/mocks/handlers/auth.ts) +[API Handlers Example Code](../apps/react-vite/src/testing/mocks/handlers/auth.ts) -[Data Models Example Code](../src/testing/mocks/db.ts) +[Data Models Example Code](../apps/react-vite/src/testing/mocks/db.ts) Having a fully functional mocked API server is also handy when it comes to testing, you don't have to mock fetch, but make requests to the mocked server instead with the data your application would expect.