[
  {
    "path": ".copier/.copier-answers.yml.jinja",
    "content": "{{ _copier_answers|to_json -}}\n"
  },
  {
    "path": ".copier/update_dotenv.py",
    "content": "from pathlib import Path\nimport json\n\n# Update the .env file with the answers from the .copier-answers.yml file\n# without using Jinja2 templates in the .env file, this way the code works as is\n# without needing Copier, but if Copier is used, the .env file will be updated\nroot_path = Path(__file__).parent.parent\nanswers_path = Path(__file__).parent / \".copier-answers.yml\"\nanswers = json.loads(answers_path.read_text())\nenv_path = root_path / \".env\"\nenv_content = env_path.read_text()\nlines = []\nfor line in env_content.splitlines():\n    for key, value in answers.items():\n        upper_key = key.upper()\n        if line.startswith(f\"{upper_key}=\"):\n            if \" \" in value:\n                content = f\"{upper_key}={value!r}\"\n            else:\n                content = f\"{upper_key}={value}\"\n            new_line = line.replace(line, content)\n            lines.append(new_line)\n            break\n    else:\n        lines.append(line)\nenv_path.write_text(\"\\n\".join(lines))\n"
  },
  {
    "path": ".gitattributes",
    "content": "* text=auto\n*.sh text eol=lf\n"
  },
  {
    "path": ".github/DISCUSSION_TEMPLATE/questions.yml",
    "content": "labels: [question]\nbody:\n  - type: markdown\n    attributes:\n      value: |\n        Thanks for your interest in this project! 🚀\n\n        Please follow these instructions, fill every question, and do every step. 🙏\n\n        I'm asking this because answering questions and solving problems in GitHub is what consumes most of the time.\n\n        I end up not being able to add new features, fix bugs, review pull requests, etc. as fast as I wish because I have to spend too much time handling questions.\n\n        All that, on top of all the incredible help provided by a bunch of community members, that give a lot of their time to come here and help others.\n\n        That's a lot of work, but if more users came to help others like them just a little bit more, it would be much less effort for them (and you and me 😅).\n\n        By asking questions in a structured way (following this) it will be much easier to help you.\n\n        And there's a high chance that you will find the solution along the way and you won't even have to submit it and wait for an answer. 😎\n\n        As there are too many questions, I'll have to discard and close the incomplete ones. That will allow me (and others) to focus on helping people like you that follow the whole process and help us help you. 🤓\n  - type: checkboxes\n    id: checks\n    attributes:\n      label: First Check\n      description: Please confirm and check all the following options.\n      options:\n        - label: I added a very descriptive title here.\n          required: true\n        - label: I used the GitHub search to find a similar question and didn't find it.\n          required: true\n        - label: I searched in the documentation/README.\n          required: true\n        - label: I already searched in Google \"How to do X\" and didn't find any information.\n          required: true\n        - label: I already read and followed all the tutorial in the docs/README and didn't find an answer.\n          required: true\n  - type: checkboxes\n    id: help\n    attributes:\n      label: Commit to Help\n      description: |\n        After submitting this, I commit to one of:\n\n          * Read open questions until I find 2 where I can help someone and add a comment to help there.\n          * I already hit the \"watch\" button in this repository to receive notifications and I commit to help at least 2 people that ask questions in the future.\n\n      options:\n        - label: I commit to help with one of those options 👆\n          required: true\n  - type: textarea\n    id: example\n    attributes:\n      label: Example Code\n      description: |\n        Please add a self-contained, [minimal, reproducible, example](https://stackoverflow.com/help/minimal-reproducible-example) with your use case.\n\n        If I (or someone) can copy it, run it, and see it right away, there's a much higher chance I (or someone) will be able to help you.\n\n      placeholder: |\n        Write your example code here.\n      render: Text\n    validations:\n      required: true\n  - type: textarea\n    id: description\n    attributes:\n      label: Description\n      description: |\n        What is the problem, question, or error?\n\n        Write a short description telling me what you are doing, what you expect to happen, and what is currently happening.\n      placeholder: |\n        * Open the browser and call the endpoint `/`.\n        * It returns a JSON with `{\"message\": \"Hello World\"}`.\n        * But I expected it to return `{\"message\": \"Hello Morty\"}`.\n    validations:\n      required: true\n  - type: dropdown\n    id: os\n    attributes:\n      label: Operating System\n      description: What operating system are you on?\n      multiple: true\n      options:\n        - Linux\n        - Windows\n        - macOS\n        - Other\n    validations:\n      required: true\n  - type: textarea\n    id: os-details\n    attributes:\n      label: Operating System Details\n      description: You can add more details about your operating system here, in particular if you chose \"Other\".\n    validations:\n      required: true\n  - type: input\n    id: python-version\n    attributes:\n      label: Python Version\n      description: |\n        What Python version are you using?\n\n        You can find the Python version with:\n\n        ```bash\n        python --version\n        ```\n    validations:\n      required: true\n  - type: textarea\n    id: context\n    attributes:\n      label: Additional Context\n      description: Add any additional context information or screenshots you think are useful.\n"
  },
  {
    "path": ".github/FUNDING.yml",
    "content": "github: [tiangolo]\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/config.yml",
    "content": "blank_issues_enabled: false\ncontact_links:\n  - name: Security Contact\n    about: Please report security vulnerabilities to security@tiangolo.com\n  - name: Question or Problem\n    about: Ask a question or ask about a problem in GitHub Discussions.\n    url: https://github.com/fastapi/full-stack-fastapi-template/discussions/categories/questions\n  - name: Feature Request\n    about: To suggest an idea or ask about a feature, please start with a question saying what you would like to achieve. There might be a way to do it already.\n    url: https://github.com/fastapi/full-stack-fastapi-template/discussions/categories/questions\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/privileged.yml",
    "content": "name: Privileged\ndescription: You are @tiangolo or he asked you directly to create an issue here. If not, check the other options. 👇\nbody:\n  - type: markdown\n    attributes:\n      value: |\n        Thanks for your interest in this project! 🚀\n\n        If you are not @tiangolo or he didn't ask you directly to create an issue here, please start the conversation in a [Question in GitHub Discussions](https://github.com/tiangolo/full-stack-fastapi-template/discussions/categories/questions) instead.\n  - type: checkboxes\n    id: privileged\n    attributes:\n      label: Privileged issue\n      description: Confirm that you are allowed to create an issue here.\n      options:\n        - label: I'm @tiangolo or he asked me directly to create an issue here.\n          required: true\n  - type: textarea\n    id: content\n    attributes:\n      label: Issue Content\n      description: Add the content of the issue here.\n"
  },
  {
    "path": ".github/dependabot.yml",
    "content": "version: 2\nupdates:\n  # GitHub Actions\n  - package-ecosystem: github-actions\n    directory: /\n    schedule:\n      interval: daily\n    commit-message:\n      prefix: ⬆\n    labels: [dependencies, internal]\n  # Python uv\n  - package-ecosystem: uv\n    directory: /\n    schedule:\n      interval: weekly\n    commit-message:\n      prefix: ⬆\n    labels: [dependencies, internal]\n  # bun\n  - package-ecosystem: bun\n    directory: /\n    schedule:\n      interval: weekly\n    commit-message:\n      prefix: ⬆\n    labels: [dependencies, internal]\n    ignore:\n      - dependency-name: \"@hey-api/openapi-ts\"\n  # Docker\n  - package-ecosystem: docker\n    directories:\n      - /backend\n      - /frontend\n    schedule:\n      interval: weekly\n    commit-message:\n      prefix: ⬆\n    labels: [dependencies, internal]\n  # Docker Compose\n  - package-ecosystem: docker-compose\n    directory: /\n    schedule:\n      interval: weekly\n    commit-message:\n      prefix: ⬆\n    labels: [dependencies, internal]\n"
  },
  {
    "path": ".github/labeler.yml",
    "content": "docs:\n  - all:\n    - changed-files:\n      - any-glob-to-any-file:\n        - '**/*.md'\n      - all-globs-to-all-files:\n        - '!frontend/**'\n        - '!backend/**'\n        - '!.github/**'\n        - '!scripts/**'\n        - '!.gitignore'\n        - '!.pre-commit-config.yaml'\n\ninternal:\n  - all:\n    - changed-files:\n      - any-glob-to-any-file:\n        - .github/**\n        - scripts/**\n        - .gitignore\n        - .pre-commit-config.yaml\n      - all-globs-to-all-files:\n        - '!./**/*.md'\n        - '!frontend/**'\n        - '!backend/**'\n"
  },
  {
    "path": ".github/workflows/add-to-project.yml",
    "content": "name: Add to Project\n\non:\n  pull_request_target:\n  issues:\n    types:\n      - opened\n      - reopened\n\njobs:\n  add-to-project:\n    name: Add to project\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/add-to-project@v1.0.2\n        with:\n          project-url: https://github.com/orgs/fastapi/projects/2\n          github-token: ${{ secrets.PROJECTS_TOKEN }}\n"
  },
  {
    "path": ".github/workflows/deploy-production.yml",
    "content": "name: Deploy to Production\n\non:\n  release:\n    types:\n      - published\n\njobs:\n  deploy:\n    # Do not deploy in the main repository, only in user projects\n    if: github.repository_owner != 'fastapi'\n    runs-on:\n      - self-hosted\n      - production\n    env:\n      ENVIRONMENT: production\n      DOMAIN: ${{ secrets.DOMAIN_PRODUCTION }}\n      STACK_NAME: ${{ secrets.STACK_NAME_PRODUCTION }}\n      SECRET_KEY: ${{ secrets.SECRET_KEY }}\n      FIRST_SUPERUSER: ${{ secrets.FIRST_SUPERUSER }}\n      FIRST_SUPERUSER_PASSWORD: ${{ secrets.FIRST_SUPERUSER_PASSWORD }}\n      SMTP_HOST: ${{ secrets.SMTP_HOST }}\n      SMTP_USER: ${{ secrets.SMTP_USER }}\n      SMTP_PASSWORD: ${{ secrets.SMTP_PASSWORD }}\n      EMAILS_FROM_EMAIL: ${{ secrets.EMAILS_FROM_EMAIL }}\n      POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }}\n      SENTRY_DSN: ${{ secrets.SENTRY_DSN }}\n    steps:\n      - name: Checkout\n        uses: actions/checkout@v6\n      - run: docker compose -f compose.yml --project-name ${{ secrets.STACK_NAME_PRODUCTION }} build\n      - run: docker compose -f compose.yml --project-name ${{ secrets.STACK_NAME_PRODUCTION }} up -d\n"
  },
  {
    "path": ".github/workflows/deploy-staging.yml",
    "content": "name: Deploy to Staging\n\non:\n  push:\n    branches:\n      - master\n\njobs:\n  deploy:\n    # Do not deploy in the main repository, only in user projects\n    if: github.repository_owner != 'fastapi'\n    runs-on:\n      - self-hosted\n      - staging\n    env:\n      ENVIRONMENT: staging\n      DOMAIN: ${{ secrets.DOMAIN_STAGING }}\n      STACK_NAME: ${{ secrets.STACK_NAME_STAGING }}\n      SECRET_KEY: ${{ secrets.SECRET_KEY }}\n      FIRST_SUPERUSER: ${{ secrets.FIRST_SUPERUSER }}\n      FIRST_SUPERUSER_PASSWORD: ${{ secrets.FIRST_SUPERUSER_PASSWORD }}\n      SMTP_HOST: ${{ secrets.SMTP_HOST }}\n      SMTP_USER: ${{ secrets.SMTP_USER }}\n      SMTP_PASSWORD: ${{ secrets.SMTP_PASSWORD }}\n      EMAILS_FROM_EMAIL: ${{ secrets.EMAILS_FROM_EMAIL }}\n      POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }}\n      SENTRY_DSN: ${{ secrets.SENTRY_DSN }}\n    steps:\n      - name: Checkout\n        uses: actions/checkout@v6\n      - run: docker compose -f compose.yml --project-name ${{ secrets.STACK_NAME_STAGING }} build\n      - run: docker compose -f compose.yml --project-name ${{ secrets.STACK_NAME_STAGING }} up -d\n"
  },
  {
    "path": ".github/workflows/detect-conflicts.yml",
    "content": "name: \"Conflict detector\"\non:\n  push:\n  pull_request_target:\n    types: [synchronize]\n\njobs:\n  main:\n    permissions:\n      contents: read\n      pull-requests: write\n    runs-on: ubuntu-latest\n    steps:\n      - name: Check if PRs have merge conflicts\n        uses: eps1lon/actions-label-merge-conflict@v3\n        with:\n          dirtyLabel: \"conflicts\"\n          repoToken: \"${{ secrets.GITHUB_TOKEN }}\"\n          commentOnDirty: \"This pull request has a merge conflict that needs to be resolved.\"\n"
  },
  {
    "path": ".github/workflows/issue-manager.yml",
    "content": "name: Issue Manager\n\non:\n  schedule:\n    - cron: \"21 17 * * *\"\n  issue_comment:\n    types:\n      - created\n  issues:\n    types:\n      - labeled\n  pull_request_target:\n    types:\n      - labeled\n  workflow_dispatch:\n\npermissions:\n  issues: write\n  pull-requests: write\n\njobs:\n  issue-manager:\n    if: github.repository_owner == 'fastapi'\n    runs-on: ubuntu-latest\n    steps:\n      - name: Dump GitHub context\n        env:\n          GITHUB_CONTEXT: ${{ toJson(github) }}\n        run: echo \"$GITHUB_CONTEXT\"\n      - uses: tiangolo/issue-manager@0.6.0\n        with:\n          token: ${{ secrets.GITHUB_TOKEN }}\n          config: >\n            {\n              \"answered\": {\n                \"delay\": 864000,\n                \"message\": \"Assuming the original need was handled, this will be automatically closed now. But feel free to add more comments or create new issues or PRs.\"\n              },\n              \"waiting\": {\n                \"delay\": 2628000,\n                \"message\": \"As this PR has been waiting for the original user for a while but seems to be inactive, it's now going to be closed. But if there's anyone interested, feel free to create a new PR.\",\n                \"reminder\": {\n                  \"before\": \"P3D\",\n                  \"message\": \"Heads-up: this will be closed in 3 days unless there's new activity.\"\n                }\n              },\n              \"invalid\": {\n                \"delay\": 0,\n                \"message\": \"This was marked as invalid and will be closed now. If this is an error, please provide additional details.\"\n              },\n              \"maybe-ai\": {\n                \"delay\": 0,\n                \"message\": \"This was marked as potentially AI generated and will be closed now. If this is an error, please provide additional details, make sure to read the docs about contributing and AI.\"\n              }\n            }\n"
  },
  {
    "path": ".github/workflows/labeler.yml",
    "content": "name: Labels\non:\n  pull_request_target:\n    types:\n      - opened\n      - synchronize\n      - reopened\n      # For label-checker\n      - labeled\n      - unlabeled\n\njobs:\n  labeler:\n    permissions:\n      contents: read\n      pull-requests: write\n    runs-on: ubuntu-latest\n    steps:\n    - uses: actions/labeler@v6\n      if: ${{ github.event.action != 'labeled' && github.event.action != 'unlabeled' }}\n    - run: echo \"Done adding labels\"\n  # Run this after labeler applied labels\n  check-labels:\n    needs:\n      - labeler\n    permissions:\n      pull-requests: read\n    runs-on: ubuntu-latest\n    steps:\n      - uses: docker://agilepathway/pull-request-label-checker:latest\n        with:\n          one_of: breaking,security,feature,bug,refactor,upgrade,docs,lang-all,internal\n          repo_token: ${{ secrets.GITHUB_TOKEN }}\n"
  },
  {
    "path": ".github/workflows/latest-changes.yml",
    "content": "name: Latest Changes\n\non:\n  pull_request_target:\n    branches:\n      - master\n    types:\n      - closed\n  workflow_dispatch:\n    inputs:\n      number:\n        description: PR number\n        required: true\n      debug_enabled:\n        description: \"Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)\"\n        required: false\n        default: \"false\"\n\njobs:\n  latest-changes:\n    runs-on: ubuntu-latest\n    permissions:\n      pull-requests: read\n    steps:\n      - name: Dump GitHub context\n        env:\n          GITHUB_CONTEXT: ${{ toJson(github) }}\n        run: echo \"$GITHUB_CONTEXT\"\n      - uses: actions/checkout@v6\n        with:\n          # To allow latest-changes to commit to the main branch\n          token: ${{ secrets.LATEST_CHANGES }}\n      - uses: tiangolo/latest-changes@0.4.1\n        with:\n          token: ${{ secrets.GITHUB_TOKEN }}\n          latest_changes_file: ./release-notes.md\n          latest_changes_header: \"## Latest Changes\"\n          end_regex: \"^## \"\n          debug_logs: true\n          label_header_prefix: \"### \"\n"
  },
  {
    "path": ".github/workflows/playwright.yml",
    "content": "name: Playwright Tests\n\non:\n  push:\n    branches:\n    - master\n  pull_request:\n    types:\n    - opened\n    - synchronize\n  workflow_dispatch:\n    inputs:\n      debug_enabled:\n        description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)'\n        required: false\n        default: 'false'\n\njobs:\n  changes:\n    runs-on: ubuntu-latest\n    # Set job outputs to values from filter step\n    outputs:\n      changed: ${{ steps.filter.outputs.changed }}\n    steps:\n    - uses: actions/checkout@v6\n    # For pull requests it's not necessary to checkout the code but for the main branch it is\n    - uses: dorny/paths-filter@v4\n      id: filter\n      with:\n        filters: |\n          changed:\n            - backend/**\n            - frontend/**\n            - .env\n            - compose*.yml\n            - .github/workflows/playwright.yml\n\n  test-playwright:\n    needs:\n      - changes\n    if: ${{ needs.changes.outputs.changed == 'true' }}\n    timeout-minutes: 60\n    runs-on: ubuntu-latest\n    strategy:\n      matrix:\n        shardIndex: [1, 2, 3, 4]\n        shardTotal: [4]\n      fail-fast: false\n    steps:\n    - uses: actions/checkout@v6\n    - uses: oven-sh/setup-bun@v2\n    - uses: actions/setup-python@v6\n      with:\n        python-version: '3.10'\n    - name: Setup tmate session\n      uses: mxschmitt/action-tmate@v3\n      if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled == 'true' }}\n      with:\n        limit-access-to-actor: true\n    - name: Install uv\n      uses: astral-sh/setup-uv@v7\n    - run: uv sync\n      working-directory: backend\n    - run: bun ci\n      working-directory: frontend\n    - run: bash scripts/generate-client.sh\n    - run: docker compose build\n    - run: docker compose down -v --remove-orphans\n    - name: Run Playwright tests\n      run: docker compose run --rm playwright bunx playwright test --fail-on-flaky-tests --trace=retain-on-failure --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }}\n    - run: docker compose down -v --remove-orphans\n    - name: Upload blob report to GitHub Actions Artifacts\n      if: ${{ !cancelled() }}\n      uses: actions/upload-artifact@v7\n      with:\n        name: blob-report-${{ matrix.shardIndex }}\n        path: frontend/blob-report\n        include-hidden-files: true\n        retention-days: 1\n\n  merge-playwright-reports:\n    needs:\n      - test-playwright\n      - changes\n    # Merge reports after playwright-tests, even if some shards have failed\n    if: ${{ !cancelled() && needs.changes.outputs.changed == 'true' }}\n    runs-on: ubuntu-latest\n    steps:\n    - uses: actions/checkout@v6\n    - uses: oven-sh/setup-bun@v2\n    - name: Install dependencies\n      run: bun ci\n    - name: Download blob reports from GitHub Actions Artifacts\n      uses: actions/download-artifact@v8\n      with:\n        path: frontend/all-blob-reports\n        pattern: blob-report-*\n        merge-multiple: true\n    - name: Merge into HTML Report\n      run: bunx playwright merge-reports --reporter html ./all-blob-reports\n      working-directory: frontend\n    - name: Upload HTML report\n      uses: actions/upload-artifact@v7\n      with:\n        name: html-report--attempt-${{ github.run_attempt }}\n        path: frontend/playwright-report\n        retention-days: 30\n        include-hidden-files: true\n\n  # https://github.com/marketplace/actions/alls-green#why\n  alls-green-playwright:  # This job does nothing and is only used for the branch protection\n    if: always()\n    needs:\n      - test-playwright\n    runs-on: ubuntu-latest\n    steps:\n      - name: Decide whether the needed jobs succeeded or failed\n        uses: re-actors/alls-green@release/v1\n        with:\n          jobs: ${{ toJSON(needs) }}\n          allowed-skips: test-playwright\n"
  },
  {
    "path": ".github/workflows/pre-commit.yml",
    "content": "name: pre-commit\n\non:\n  pull_request:\n    types:\n      - opened\n      - synchronize\n\nenv:\n  # Forks and Dependabot don't have access to secrets\n  HAS_SECRETS: ${{ secrets.PRE_COMMIT != '' }}\n\njobs:\n  pre-commit:\n    runs-on: ubuntu-latest\n    steps:\n      - name: Dump GitHub context\n        env:\n          GITHUB_CONTEXT: ${{ toJson(github) }}\n        run: echo \"$GITHUB_CONTEXT\"\n      - uses: actions/checkout@v6\n        name: Checkout PR for own repo\n        if: env.HAS_SECRETS == 'true'\n        with:\n          # To be able to commit it needs to fetch the head of the branch, not the\n          # merge commit\n          ref: ${{ github.head_ref }}\n          # And it needs the full history to be able to compute diffs\n          fetch-depth: 0\n          # A token other than the default GITHUB_TOKEN is needed to be able to trigger CI\n          token: ${{ secrets.PRE_COMMIT }}\n      # pre-commit lite ci needs the default checkout configs to work\n      - uses: actions/checkout@v6\n        name: Checkout PR for fork\n        if: env.HAS_SECRETS == 'false'\n        with:\n        # To be able to commit it needs the head branch of the PR, the remote one\n          ref: ${{ github.event.pull_request.head.sha }}\n          fetch-depth: 0\n      - uses: oven-sh/setup-bun@v2\n      - name: Set up Python\n        uses: actions/setup-python@v6\n        with:\n          python-version: \"3.11\"\n      - name: Setup uv\n        uses: astral-sh/setup-uv@v7\n        with:\n          cache-dependency-glob: |\n            requirements**.txt\n            pyproject.toml\n            uv.lock\n      - name: Install backend dependencies\n        run: uv sync --all-packages\n      - name: Install frontend dependencies\n        run: bun ci\n      - name: Run prek - pre-commit\n        id: precommit\n        run: uvx prek run --from-ref origin/${GITHUB_BASE_REF} --to-ref HEAD --show-diff-on-failure\n        continue-on-error: true\n      - name: Commit and push changes\n        if: env.HAS_SECRETS == 'true'\n        run: |\n          git config user.name \"github-actions[bot]\"\n          git config user.email \"github-actions[bot]@users.noreply.github.com\"\n          git add -A\n          if git diff --staged --quiet; then\n            echo \"No changes to commit\"\n          else\n            git commit -m \"🎨 Auto format and update with pre-commit\"\n            git push\n          fi\n      - uses: pre-commit-ci/lite-action@v1.1.0\n        if: env.HAS_SECRETS == 'false'\n        with:\n          msg: 🎨 Auto format and update with pre-commit\n      - name: Error out on pre-commit errors\n        if: steps.precommit.outcome == 'failure'\n        run: exit 1\n\n  # https://github.com/marketplace/actions/alls-green#why\n  pre-commit-alls-green:  # This job does nothing and is only used for the branch protection\n    if: always()\n    needs:\n      - pre-commit\n    runs-on: ubuntu-latest\n    steps:\n      - name: Dump GitHub context\n        env:\n          GITHUB_CONTEXT: ${{ toJson(github) }}\n        run: echo \"$GITHUB_CONTEXT\"\n      - name: Decide whether the needed jobs succeeded or failed\n        uses: re-actors/alls-green@release/v1\n        with:\n          jobs: ${{ toJSON(needs) }}\n"
  },
  {
    "path": ".github/workflows/smokeshow.yml",
    "content": "name: Smokeshow\n\non:\n  workflow_run:\n    workflows: [Test Backend]\n    types: [completed]\n\njobs:\n  smokeshow:\n    runs-on: ubuntu-latest\n    permissions:\n      actions: read\n      statuses: write\n\n    steps:\n      - uses: actions/checkout@v6\n      - uses: actions/setup-python@v6\n        with:\n          python-version: \"3.13\"\n      - run: pip install smokeshow\n      - uses: actions/download-artifact@v8\n        with:\n          name: coverage-html\n          path: backend/htmlcov\n          github-token: ${{ secrets.GITHUB_TOKEN }}\n          run-id: ${{ github.event.workflow_run.id }}\n      - run: smokeshow upload backend/htmlcov\n        env:\n          SMOKESHOW_GITHUB_STATUS_DESCRIPTION: Coverage {coverage-percentage}\n          SMOKESHOW_GITHUB_COVERAGE_THRESHOLD: 90\n          SMOKESHOW_GITHUB_CONTEXT: coverage\n          SMOKESHOW_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n          SMOKESHOW_GITHUB_PR_HEAD_SHA: ${{ github.event.workflow_run.head_sha }}\n          SMOKESHOW_AUTH_KEY: ${{ secrets.SMOKESHOW_AUTH_KEY }}\n"
  },
  {
    "path": ".github/workflows/test-backend.yml",
    "content": "name: Test Backend\n\non:\n  push:\n    branches:\n      - master\n  pull_request:\n    types:\n      - opened\n      - synchronize\n\njobs:\n  test-backend:\n    runs-on: ubuntu-latest\n    steps:\n      - name: Checkout\n        uses: actions/checkout@v6\n      - name: Set up Python\n        uses: actions/setup-python@v6\n        with:\n          python-version: \"3.10\"\n      - name: Install uv\n        uses: astral-sh/setup-uv@v7\n      - run: docker compose down -v --remove-orphans\n      - run: docker compose up -d db mailcatcher\n      - name: Migrate DB\n        run: uv run bash scripts/prestart.sh\n        working-directory: backend\n      - name: Run tests\n        run: uv run bash scripts/tests-start.sh \"Coverage for ${{ github.sha }}\"\n        working-directory: backend\n      - run: docker compose down -v --remove-orphans\n      - name: Store coverage files\n        uses: actions/upload-artifact@v7\n        with:\n          name: coverage-html\n          path: backend/htmlcov\n          include-hidden-files: true\n      - name: Coverage report\n        run: uv run coverage report --fail-under=90\n        working-directory: backend\n"
  },
  {
    "path": ".github/workflows/test-docker-compose.yml",
    "content": "name: Test Docker Compose\n\non:\n  push:\n    branches:\n      - master\n  pull_request:\n    types:\n      - opened\n      - synchronize\n\njobs:\n\n  test-docker-compose:\n    runs-on: ubuntu-latest\n    steps:\n      - name: Checkout\n        uses: actions/checkout@v6\n      - run: docker compose build\n      - run: docker compose down -v --remove-orphans\n      - run: docker compose up -d --wait backend frontend adminer\n      - name: Test backend is up\n        run: curl http://localhost:8000/api/v1/utils/health-check\n      - name: Test frontend is up\n        run: curl http://localhost:5173\n      - run: docker compose down -v --remove-orphans\n"
  },
  {
    "path": ".gitignore",
    "content": ".vscode/*\n!.vscode/extensions.json\nnode_modules/\n/test-results/\n/playwright-report/\n/blob-report/\n/playwright/.cache/\n"
  },
  {
    "path": ".pre-commit-config.yaml",
    "content": "# See https://pre-commit.com for more information\n# See https://pre-commit.com/hooks.html for more hooks\nrepos:\n  - repo: https://github.com/pre-commit/pre-commit-hooks\n    rev: v4.4.0\n    hooks:\n      - id: check-added-large-files\n      - id: check-toml\n      - id: check-yaml\n        args:\n          - --unsafe\n      - id: end-of-file-fixer\n        exclude: |\n            (?x)^(\n                frontend/src/client/.*|\n                backend/app/email-templates/build/.*\n            )$\n      - id: trailing-whitespace\n        exclude: ^frontend/src/client/.*\n  - repo: local\n    hooks:\n      - id: local-biome-check\n        name: biome check\n        entry: npm run lint\n        language: system\n        types: [text]\n        files: ^frontend/\n\n      - id: local-ruff-check\n        name: ruff check\n        entry: uv run ruff check --force-exclude --fix --exit-non-zero-on-fix\n        require_serial: true\n        language: unsupported\n        types: [python]\n\n      - id: local-ruff-format\n        name: ruff format\n        entry: uv run ruff format --force-exclude --exit-non-zero-on-format\n        require_serial: true\n        language: unsupported\n        types: [python]\n\n      - id: local-mypy\n        name: mypy check\n        entry: uv run mypy backend/app\n        require_serial: true\n        language: unsupported\n        pass_filenames: false\n\n      - id: generate-frontend-sdk\n        name: Generate Frontend SDK\n        entry: bash ./scripts/generate-client.sh\n        pass_filenames: false\n        language: unsupported\n        files: ^backend/.*$|^scripts/generate-client\\.sh$\n"
  },
  {
    "path": ".vscode/extensions.json",
    "content": "{\n    \"recommendations\": [\n        \"FastAPILabs.fastapi-vscode\",\n        \"astral-sh.ty\",\n        \"biomejs.biome\",\n        \"bradlc.vscode-tailwindcss\",\n        \"charliermarsh.ruff\",\n        \"docker.docker\",\n        \"github.vscode-github-actions\",\n        \"mjmlio.vscode-mjml\",\n        \"ms-playwright.playwright\",\n        \"ms-python.python\",\n        \"tombi-toml.tombi\"\n    ]\n}\n"
  },
  {
    "path": "CONTRIBUTING.md",
    "content": "# Contributing\n\nThank you for your interest in contributing to the Full Stack FastAPI Template! 🙇\n\n## Discussions First\n\nFor **big changes** (new features, architectural changes, significant refactoring), please start by opening a [GitHub Discussion](https://github.com/fastapi/full-stack-fastapi-template/discussions) first. This allows the community and maintainers to provide feedback on the approach before you invest significant time in implementation.\n\nFor small, straightforward changes, you can go directly to a Pull Request without starting a discussion first. This includes:\n\n- Typos and grammatical fixes\n- Small reproducible bug fixes\n- Fixing lint warnings or type errors\n- Minor code improvements (e.g., removing unused code)\n\n## Developing\n\nFor detailed instructions on setting up your development environment, running the stack, linting, pre-commit hooks, and more, see the [Development Guide](development.md).\n\n## Pull Requests\n\nWhen submitting a pull request:\n\n1. Make sure all tests pass before submitting.\n2. Keep PRs focused on a single change.\n3. Update tests if you're changing functionality.\n4. Reference any related issues in your PR description.\n\n## Automated Code and AI\n\nYou are encouraged to use all the tools you want to do your work and contribute as efficiently as possible, this includes AI (LLM) tools, etc. Nevertheless, contributions should have meaningful human intervention, judgement, context, etc.\n\nIf the **human effort** put in a PR, e.g. writing LLM prompts, is **less** than the **effort we would need to put** to **review it**, please **don't** submit the PR.\n\nThink of it this way: we can already write LLM prompts or run automated tools ourselves, and that would be faster than reviewing external PRs.\n\n### Closing Automated and AI PRs\n\nIf we see PRs that seem AI generated or automated in similar ways, we'll flag them and close them.\n\nThe same applies to comments and descriptions, please don't copy paste the content generated by an LLM.\n\n### Human Effort Denial of Service\n\nUsing automated tools and AI to submit PRs or comments that we have to carefully review and handle would be the equivalent of a [Denial-of-service attack](https://en.wikipedia.org/wiki/Denial-of-service_attack) on our human effort.\n\nIt would be very little effort from the person submitting the PR (an LLM prompt) that generates a large amount of effort on our side (carefully reviewing code).\n\nPlease don't do that.\n\nWe'll need to block accounts that spam us with repeated automated PRs or comments.\n\n### Use Tools Wisely\n\nAs Uncle Ben said:\n\n> With great ~~power~~ **tools** comes great responsibility.\n\nAvoid inadvertently doing harm.\n\nYou have amazing tools at hand, use them wisely to help effectively.\n\n## Questions?\n\nIf you have questions about contributing, feel free to open a [GitHub Discussion](https://github.com/fastapi/full-stack-fastapi-template/discussions).\n"
  },
  {
    "path": "LICENSE",
    "content": "MIT License\n\nCopyright (c) 2019 Sebastián Ramírez\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "README.md",
    "content": "# Full Stack FastAPI Template\n\n<a href=\"https://github.com/fastapi/full-stack-fastapi-template/actions?query=workflow%3A%22Test+Docker+Compose%22\" target=\"_blank\"><img src=\"https://github.com/fastapi/full-stack-fastapi-template/workflows/Test%20Docker%20Compose/badge.svg\" alt=\"Test Docker Compose\"></a>\n<a href=\"https://github.com/fastapi/full-stack-fastapi-template/actions?query=workflow%3A%22Test+Backend%22\" target=\"_blank\"><img src=\"https://github.com/fastapi/full-stack-fastapi-template/workflows/Test%20Backend/badge.svg\" alt=\"Test Backend\"></a>\n<a href=\"https://coverage-badge.samuelcolvin.workers.dev/redirect/fastapi/full-stack-fastapi-template\" target=\"_blank\"><img src=\"https://coverage-badge.samuelcolvin.workers.dev/fastapi/full-stack-fastapi-template.svg\" alt=\"Coverage\"></a>\n\n## Technology Stack and Features\n\n- ⚡ [**FastAPI**](https://fastapi.tiangolo.com) for the Python backend API.\n  - 🧰 [SQLModel](https://sqlmodel.tiangolo.com) for the Python SQL database interactions (ORM).\n  - 🔍 [Pydantic](https://docs.pydantic.dev), used by FastAPI, for the data validation and settings management.\n  - 💾 [PostgreSQL](https://www.postgresql.org) as the SQL database.\n- 🚀 [React](https://react.dev) for the frontend.\n  - 💃 Using TypeScript, hooks, [Vite](https://vitejs.dev), and other parts of a modern frontend stack.\n  - 🎨 [Tailwind CSS](https://tailwindcss.com) and [shadcn/ui](https://ui.shadcn.com) for the frontend components.\n  - 🤖 An automatically generated frontend client.\n  - 🧪 [Playwright](https://playwright.dev) for End-to-End testing.\n  - 🦇 Dark mode support.\n- 🐋 [Docker Compose](https://www.docker.com) for development and production.\n- 🔒 Secure password hashing by default.\n- 🔑 JWT (JSON Web Token) authentication.\n- 📫 Email based password recovery.\n- 📬 [Mailcatcher](https://mailcatcher.me) for local email testing during development.\n- ✅ Tests with [Pytest](https://pytest.org).\n- 📞 [Traefik](https://traefik.io) as a reverse proxy / load balancer.\n- 🚢 Deployment instructions using Docker Compose, including how to set up a frontend Traefik proxy to handle automatic HTTPS certificates.\n- 🏭 CI (continuous integration) and CD (continuous deployment) based on GitHub Actions.\n\n### Dashboard Login\n\n[![API docs](img/login.png)](https://github.com/fastapi/full-stack-fastapi-template)\n\n### Dashboard - Admin\n\n[![API docs](img/dashboard.png)](https://github.com/fastapi/full-stack-fastapi-template)\n\n### Dashboard - Items\n\n[![API docs](img/dashboard-items.png)](https://github.com/fastapi/full-stack-fastapi-template)\n\n### Dashboard - Dark Mode\n\n[![API docs](img/dashboard-dark.png)](https://github.com/fastapi/full-stack-fastapi-template)\n\n### Interactive API Documentation\n\n[![API docs](img/docs.png)](https://github.com/fastapi/full-stack-fastapi-template)\n\n## How To Use It\n\nYou can **just fork or clone** this repository and use it as is.\n\n✨ It just works. ✨\n\n### How to Use a Private Repository\n\nIf you want to have a private repository, GitHub won't allow you to simply fork it as it doesn't allow changing the visibility of forks.\n\nBut you can do the following:\n\n- Create a new GitHub repo, for example `my-full-stack`.\n- Clone this repository manually, set the name with the name of the project you want to use, for example `my-full-stack`:\n\n```bash\ngit clone git@github.com:fastapi/full-stack-fastapi-template.git my-full-stack\n```\n\n- Enter into the new directory:\n\n```bash\ncd my-full-stack\n```\n\n- Set the new origin to your new repository, copy it from the GitHub interface, for example:\n\n```bash\ngit remote set-url origin git@github.com:octocat/my-full-stack.git\n```\n\n- Add this repo as another \"remote\" to allow you to get updates later:\n\n```bash\ngit remote add upstream git@github.com:fastapi/full-stack-fastapi-template.git\n```\n\n- Push the code to your new repository:\n\n```bash\ngit push -u origin master\n```\n\n### Update From the Original Template\n\nAfter cloning the repository, and after doing changes, you might want to get the latest changes from this original template.\n\n- Make sure you added the original repository as a remote, you can check it with:\n\n```bash\ngit remote -v\n\norigin    git@github.com:octocat/my-full-stack.git (fetch)\norigin    git@github.com:octocat/my-full-stack.git (push)\nupstream    git@github.com:fastapi/full-stack-fastapi-template.git (fetch)\nupstream    git@github.com:fastapi/full-stack-fastapi-template.git (push)\n```\n\n- Pull the latest changes without merging:\n\n```bash\ngit pull --no-commit upstream master\n```\n\nThis will download the latest changes from this template without committing them, that way you can check everything is right before committing.\n\n- If there are conflicts, solve them in your editor.\n\n- Once you are done, commit the changes:\n\n```bash\ngit merge --continue\n```\n\n### Configure\n\nYou can then update configs in the `.env` files to customize your configurations.\n\nBefore deploying it, make sure you change at least the values for:\n\n- `SECRET_KEY`\n- `FIRST_SUPERUSER_PASSWORD`\n- `POSTGRES_PASSWORD`\n\nYou can (and should) pass these as environment variables from secrets.\n\nRead the [deployment.md](./deployment.md) docs for more details.\n\n### Generate Secret Keys\n\nSome environment variables in the `.env` file have a default value of `changethis`.\n\nYou have to change them with a secret key, to generate secret keys you can run the following command:\n\n```bash\npython -c \"import secrets; print(secrets.token_urlsafe(32))\"\n```\n\nCopy the content and use that as password / secret key. And run that again to generate another secure key.\n\n## How To Use It - Alternative With Copier\n\nThis repository also supports generating a new project using [Copier](https://copier.readthedocs.io).\n\nIt will copy all the files, ask you configuration questions, and update the `.env` files with your answers.\n\n### Install Copier\n\nYou can install Copier with:\n\n```bash\npip install copier\n```\n\nOr better, if you have [`pipx`](https://pipx.pypa.io/), you can run it with:\n\n```bash\npipx install copier\n```\n\n**Note**: If you have `pipx`, installing copier is optional, you could run it directly.\n\n### Generate a Project With Copier\n\nDecide a name for your new project's directory, you will use it below. For example, `my-awesome-project`.\n\nGo to the directory that will be the parent of your project, and run the command with your project's name:\n\n```bash\ncopier copy https://github.com/fastapi/full-stack-fastapi-template my-awesome-project --trust\n```\n\nIf you have `pipx` and you didn't install `copier`, you can run it directly:\n\n```bash\npipx run copier copy https://github.com/fastapi/full-stack-fastapi-template my-awesome-project --trust\n```\n\n**Note** the `--trust` option is necessary to be able to execute a [post-creation script](https://github.com/fastapi/full-stack-fastapi-template/blob/master/.copier/update_dotenv.py) that updates your `.env` files.\n\n### Input Variables\n\nCopier will ask you for some data, you might want to have at hand before generating the project.\n\nBut don't worry, you can just update any of that in the `.env` files afterwards.\n\nThe input variables, with their default values (some auto generated) are:\n\n- `project_name`: (default: `\"FastAPI Project\"`) The name of the project, shown to API users (in .env).\n- `stack_name`: (default: `\"fastapi-project\"`) The name of the stack used for Docker Compose labels and project name (no spaces, no periods) (in .env).\n- `secret_key`: (default: `\"changethis\"`) The secret key for the project, used for security, stored in .env, you can generate one with the method above.\n- `first_superuser`: (default: `\"admin@example.com\"`) The email of the first superuser (in .env).\n- `first_superuser_password`: (default: `\"changethis\"`) The password of the first superuser (in .env).\n- `smtp_host`: (default: \"\") The SMTP server host to send emails, you can set it later in .env.\n- `smtp_user`: (default: \"\") The SMTP server user to send emails, you can set it later in .env.\n- `smtp_password`: (default: \"\") The SMTP server password to send emails, you can set it later in .env.\n- `emails_from_email`: (default: `\"info@example.com\"`) The email account to send emails from, you can set it later in .env.\n- `postgres_password`: (default: `\"changethis\"`) The password for the PostgreSQL database, stored in .env, you can generate one with the method above.\n- `sentry_dsn`: (default: \"\") The DSN for Sentry, if you are using it, you can set it later in .env.\n\n## Backend Development\n\nBackend docs: [backend/README.md](./backend/README.md).\n\n## Frontend Development\n\nFrontend docs: [frontend/README.md](./frontend/README.md).\n\n## Deployment\n\nDeployment docs: [deployment.md](./deployment.md).\n\n## Development\n\nGeneral development docs: [development.md](./development.md).\n\nThis includes using Docker Compose, custom local domains, `.env` configurations, etc.\n\n## Release Notes\n\nCheck the file [release-notes.md](./release-notes.md).\n\n## License\n\nThe Full Stack FastAPI Template is licensed under the terms of the MIT license.\n"
  },
  {
    "path": "SECURITY.md",
    "content": "# Security Policy\n\nSecurity is very important for this project and its community. 🔒\n\nLearn more about it below. 👇\n\n## Versions\n\nThe latest version or release is supported.\n\nYou are encouraged to write tests for your application and update your versions frequently after ensuring that your tests are passing. This way you will benefit from the latest features, bug fixes, and **security fixes**.\n\n## Reporting a Vulnerability\n\nIf you think you found a vulnerability, and even if you are not sure about it, please report it right away by sending an email to: security@tiangolo.com. Please try to be as explicit as possible, describing all the steps and example code to reproduce the security issue.\n\nI (the author, [@tiangolo](https://twitter.com/tiangolo)) will review it thoroughly and get back to you.\n\n## Public Discussions\n\nPlease restrain from publicly discussing a potential security vulnerability. 🙊\n\nIt's better to discuss privately and try to find a solution first, to limit the potential impact as much as possible.\n\n---\n\nThanks for your help!\n\nThe community and I thank you for that. 🙇\n"
  },
  {
    "path": "backend/.dockerignore",
    "content": "# Python\n__pycache__\napp.egg-info\n*.pyc\n.mypy_cache\n.coverage\nhtmlcov\n.venv\n"
  },
  {
    "path": "backend/.gitignore",
    "content": "__pycache__\napp.egg-info\n*.pyc\n.mypy_cache\n.coverage\nhtmlcov\n.cache\n.venv\n"
  },
  {
    "path": "backend/Dockerfile",
    "content": "FROM python:3.10\n\nENV PYTHONUNBUFFERED=1\n\n# Install uv\n# Ref: https://docs.astral.sh/uv/guides/integration/docker/#installing-uv\nCOPY --from=ghcr.io/astral-sh/uv:0.9.26 /uv /uvx /bin/\n\n# Compile bytecode\n# Ref: https://docs.astral.sh/uv/guides/integration/docker/#compiling-bytecode\nENV UV_COMPILE_BYTECODE=1\n\n# uv Cache\n# Ref: https://docs.astral.sh/uv/guides/integration/docker/#caching\nENV UV_LINK_MODE=copy\n\nWORKDIR /app/\n\n# Place executables in the environment at the front of the path\n# Ref: https://docs.astral.sh/uv/guides/integration/docker/#using-the-environment\nENV PATH=\"/app/.venv/bin:$PATH\"\n\n# Install dependencies\n# Ref: https://docs.astral.sh/uv/guides/integration/docker/#intermediate-layers\nRUN --mount=type=cache,target=/root/.cache/uv \\\n    --mount=type=bind,source=uv.lock,target=uv.lock \\\n    --mount=type=bind,source=pyproject.toml,target=pyproject.toml \\\n    uv sync --frozen --no-install-workspace --package app\n\nCOPY ./backend/scripts /app/backend/scripts\n\nCOPY ./backend/pyproject.toml ./backend/alembic.ini /app/backend/\n\nCOPY ./backend/app /app/backend/app\n\n# Sync the project\n# Ref: https://docs.astral.sh/uv/guides/integration/docker/#intermediate-layers\nRUN --mount=type=cache,target=/root/.cache/uv \\\n    --mount=type=bind,source=uv.lock,target=uv.lock \\\n    --mount=type=bind,source=pyproject.toml,target=pyproject.toml \\\n    uv sync --frozen --package app\n\nWORKDIR /app/backend/\n\nCMD [\"fastapi\", \"run\", \"--workers\", \"4\", \"app/main.py\"]\n"
  },
  {
    "path": "backend/README.md",
    "content": "# FastAPI Project - Backend\n\n## Requirements\n\n* [Docker](https://www.docker.com/).\n* [uv](https://docs.astral.sh/uv/) for Python package and environment management.\n\n## Docker Compose\n\nStart the local development environment with Docker Compose following the guide in [../development.md](../development.md).\n\n## General Workflow\n\nBy default, the dependencies are managed with [uv](https://docs.astral.sh/uv/), go there and install it.\n\nFrom `./backend/` you can install all the dependencies with:\n\n```console\n$ uv sync\n```\n\nThen you can activate the virtual environment with:\n\n```console\n$ source .venv/bin/activate\n```\n\nMake sure your editor is using the correct Python virtual environment, with the interpreter at `backend/.venv/bin/python`.\n\nModify or add SQLModel models for data and SQL tables in `./backend/app/models.py`, API endpoints in `./backend/app/api/`, CRUD (Create, Read, Update, Delete) utils in `./backend/app/crud.py`.\n\n## VS Code\n\nThere are already configurations in place to run the backend through the VS Code debugger, so that you can use breakpoints, pause and explore variables, etc.\n\nThe setup is also already configured so you can run the tests through the VS Code Python tests tab.\n\n## Docker Compose Override\n\nDuring development, you can change Docker Compose settings that will only affect the local development environment in the file `compose.override.yml`.\n\nThe changes to that file only affect the local development environment, not the production environment. So, you can add \"temporary\" changes that help the development workflow.\n\nFor example, the directory with the backend code is synchronized in the Docker container, copying the code you change live to the directory inside the container. That allows you to test your changes right away, without having to build the Docker image again. It should only be done during development, for production, you should build the Docker image with a recent version of the backend code. But during development, it allows you to iterate very fast.\n\nThere is also a command override that runs `fastapi run --reload` instead of the default `fastapi run`. It starts a single server process (instead of multiple, as would be for production) and reloads the process whenever the code changes. Have in mind that if you have a syntax error and save the Python file, it will break and exit, and the container will stop. After that, you can restart the container by fixing the error and running again:\n\n```console\n$ docker compose watch\n```\n\nThere is also a commented out `command` override, you can uncomment it and comment the default one. It makes the backend container run a process that does \"nothing\", but keeps the container alive. That allows you to get inside your running container and execute commands inside, for example a Python interpreter to test installed dependencies, or start the development server that reloads when it detects changes.\n\nTo get inside the container with a `bash` session you can start the stack with:\n\n```console\n$ docker compose watch\n```\n\nand then in another terminal, `exec` inside the running container:\n\n```console\n$ docker compose exec backend bash\n```\n\nYou should see an output like:\n\n```console\nroot@7f2607af31c3:/app#\n```\n\nthat means that you are in a `bash` session inside your container, as a `root` user, under the `/app` directory, this directory has another directory called \"app\" inside, that's where your code lives inside the container: `/app/app`.\n\nThere you can use the `fastapi run --reload` command to run the debug live reloading server.\n\n```console\n$ fastapi run --reload app/main.py\n```\n\n...it will look like:\n\n```console\nroot@7f2607af31c3:/app# fastapi run --reload app/main.py\n```\n\nand then hit enter. That runs the live reloading server that auto reloads when it detects code changes.\n\nNevertheless, if it doesn't detect a change but a syntax error, it will just stop with an error. But as the container is still alive and you are in a Bash session, you can quickly restart it after fixing the error, running the same command (\"up arrow\" and \"Enter\").\n\n...this previous detail is what makes it useful to have the container alive doing nothing and then, in a Bash session, make it run the live reload server.\n\n## Backend tests\n\nTo test the backend run:\n\n```console\n$ bash ./scripts/test.sh\n```\n\nThe tests run with Pytest, modify and add tests to `./backend/tests/`.\n\nIf you use GitHub Actions the tests will run automatically.\n\n### Test running stack\n\nIf your stack is already up and you just want to run the tests, you can use:\n\n```bash\ndocker compose exec backend bash scripts/tests-start.sh\n```\n\nThat `/app/scripts/tests-start.sh` script just calls `pytest` after making sure that the rest of the stack is running. If you need to pass extra arguments to `pytest`, you can pass them to that command and they will be forwarded.\n\nFor example, to stop on first error:\n\n```bash\ndocker compose exec backend bash scripts/tests-start.sh -x\n```\n\n### Test Coverage\n\nWhen the tests are run, a file `htmlcov/index.html` is generated, you can open it in your browser to see the coverage of the tests.\n\n## Migrations\n\nAs during local development your app directory is mounted as a volume inside the container, you can also run the migrations with `alembic` commands inside the container and the migration code will be in your app directory (instead of being only inside the container). So you can add it to your git repository.\n\nMake sure you create a \"revision\" of your models and that you \"upgrade\" your database with that revision every time you change them. As this is what will update the tables in your database. Otherwise, your application will have errors.\n\n* Start an interactive session in the backend container:\n\n```console\n$ docker compose exec backend bash\n```\n\n* Alembic is already configured to import your SQLModel models from `./backend/app/models.py`.\n\n* After changing a model (for example, adding a column), inside the container, create a revision, e.g.:\n\n```console\n$ alembic revision --autogenerate -m \"Add column last_name to User model\"\n```\n\n* Commit to the git repository the files generated in the alembic directory.\n\n* After creating the revision, run the migration in the database (this is what will actually change the database):\n\n```console\n$ alembic upgrade head\n```\n\nIf you don't want to use migrations at all, uncomment the lines in the file at `./backend/app/core/db.py` that end in:\n\n```python\nSQLModel.metadata.create_all(engine)\n```\n\nand comment the line in the file `scripts/prestart.sh` that contains:\n\n```console\n$ alembic upgrade head\n```\n\nIf you don't want to start with the default models and want to remove them / modify them, from the beginning, without having any previous revision, you can remove the revision files (`.py` Python files) under `./backend/app/alembic/versions/`. And then create a first migration as described above.\n\n## Email Templates\n\nThe email templates are in `./backend/app/email-templates/`. Here, there are two directories: `build` and `src`. The `src` directory contains the source files that are used to build the final email templates. The `build` directory contains the final email templates that are used by the application.\n\nBefore continuing, ensure you have the [MJML extension](https://github.com/mjmlio/vscode-mjml) installed in your VS Code.\n\nOnce you have the MJML extension installed, you can create a new email template in the `src` directory. After creating the new email template and with the `.mjml` file open in your editor, open the command palette with `Ctrl+Shift+P` and search for `MJML: Export to HTML`. This will convert the `.mjml` file to a `.html` file and now you can save it in the build directory.\n"
  },
  {
    "path": "backend/alembic.ini",
    "content": "# A generic, single database configuration.\n\n[alembic]\n# path to migration scripts\nscript_location = app/alembic\n\n# template used to generate migration files\n# file_template = %%(rev)s_%%(slug)s\n\n# timezone to use when rendering the date\n# within the migration file as well as the filename.\n# string value is passed to dateutil.tz.gettz()\n# leave blank for localtime\n# timezone =\n\n# max length of characters to apply to the\n# \"slug\" field\n#truncate_slug_length = 40\n\n# set to 'true' to run the environment during\n# the 'revision' command, regardless of autogenerate\n# revision_environment = false\n\n# set to 'true' to allow .pyc and .pyo files without\n# a source .py file to be detected as revisions in the\n# versions/ directory\n# sourceless = false\n\n# version location specification; this defaults\n# to alembic/versions.  When using multiple version\n# directories, initial revisions must be specified with --version-path\n# version_locations = %(here)s/bar %(here)s/bat alembic/versions\n\n# the output encoding used when revision files\n# are written from script.py.mako\n# output_encoding = utf-8\n\n# Logging configuration\n[loggers]\nkeys = root,sqlalchemy,alembic\n\n[handlers]\nkeys = console\n\n[formatters]\nkeys = generic\n\n[logger_root]\nlevel = WARN\nhandlers = console\nqualname =\n\n[logger_sqlalchemy]\nlevel = WARN\nhandlers =\nqualname = sqlalchemy.engine\n\n[logger_alembic]\nlevel = INFO\nhandlers =\nqualname = alembic\n\n[handler_console]\nclass = StreamHandler\nargs = (sys.stderr,)\nlevel = NOTSET\nformatter = generic\n\n[formatter_generic]\nformat = %(levelname)-5.5s [%(name)s] %(message)s\ndatefmt = %H:%M:%S\n"
  },
  {
    "path": "backend/app/__init__.py",
    "content": ""
  },
  {
    "path": "backend/app/alembic/README",
    "content": "Generic single-database configuration.\n"
  },
  {
    "path": "backend/app/alembic/env.py",
    "content": "import os\nfrom logging.config import fileConfig\n\nfrom alembic import context\nfrom sqlalchemy import engine_from_config, pool\n\n# this is the Alembic Config object, which provides\n# access to the values within the .ini file in use.\nconfig = context.config\n\n# Interpret the config file for Python logging.\n# This line sets up loggers basically.\nassert config.config_file_name is not None\nfileConfig(config.config_file_name)\n\n# add your model's MetaData object here\n# for 'autogenerate' support\n# from myapp import mymodel\n# target_metadata = mymodel.Base.metadata\n# target_metadata = None\n\nfrom app.models import SQLModel  # noqa\nfrom app.core.config import settings # noqa\n\ntarget_metadata = SQLModel.metadata\n\n# other values from the config, defined by the needs of env.py,\n# can be acquired:\n# my_important_option = config.get_main_option(\"my_important_option\")\n# ... etc.\n\n\ndef get_url():\n    return str(settings.SQLALCHEMY_DATABASE_URI)\n\n\ndef run_migrations_offline():\n    \"\"\"Run migrations in 'offline' mode.\n\n    This configures the context with just a URL\n    and not an Engine, though an Engine is acceptable\n    here as well.  By skipping the Engine creation\n    we don't even need a DBAPI to be available.\n\n    Calls to context.execute() here emit the given string to the\n    script output.\n\n    \"\"\"\n    url = get_url()\n    context.configure(\n        url=url, target_metadata=target_metadata, literal_binds=True, compare_type=True\n    )\n\n    with context.begin_transaction():\n        context.run_migrations()\n\n\ndef run_migrations_online():\n    \"\"\"Run migrations in 'online' mode.\n\n    In this scenario we need to create an Engine\n    and associate a connection with the context.\n\n    \"\"\"\n    configuration = config.get_section(config.config_ini_section)\n    configuration[\"sqlalchemy.url\"] = get_url()\n    connectable = engine_from_config(\n        configuration,\n        prefix=\"sqlalchemy.\",\n        poolclass=pool.NullPool,\n    )\n\n    with connectable.connect() as connection:\n        context.configure(\n            connection=connection, target_metadata=target_metadata, compare_type=True\n        )\n\n        with context.begin_transaction():\n            context.run_migrations()\n\n\nif context.is_offline_mode():\n    run_migrations_offline()\nelse:\n    run_migrations_online()\n"
  },
  {
    "path": "backend/app/alembic/script.py.mako",
    "content": "\"\"\"${message}\n\nRevision ID: ${up_revision}\nRevises: ${down_revision | comma,n}\nCreate Date: ${create_date}\n\n\"\"\"\nfrom alembic import op\nimport sqlalchemy as sa\nimport sqlmodel.sql.sqltypes\n${imports if imports else \"\"}\n\n# revision identifiers, used by Alembic.\nrevision = ${repr(up_revision)}\ndown_revision = ${repr(down_revision)}\nbranch_labels = ${repr(branch_labels)}\ndepends_on = ${repr(depends_on)}\n\n\ndef upgrade():\n    ${upgrades if upgrades else \"pass\"}\n\n\ndef downgrade():\n    ${downgrades if downgrades else \"pass\"}\n"
  },
  {
    "path": "backend/app/alembic/versions/.keep",
    "content": ""
  },
  {
    "path": "backend/app/alembic/versions/1a31ce608336_add_cascade_delete_relationships.py",
    "content": "\"\"\"Add cascade delete relationships\n\nRevision ID: 1a31ce608336\nRevises: d98dd8ec85a3\nCreate Date: 2024-07-31 22:24:34.447891\n\n\"\"\"\nfrom alembic import op\nimport sqlalchemy as sa\nimport sqlmodel.sql.sqltypes\n\n\n# revision identifiers, used by Alembic.\nrevision = '1a31ce608336'\ndown_revision = 'd98dd8ec85a3'\nbranch_labels = None\ndepends_on = None\n\n\ndef upgrade():\n    # ### commands auto generated by Alembic - please adjust! ###\n    op.alter_column('item', 'owner_id',\n               existing_type=sa.UUID(),\n               nullable=False)\n    op.drop_constraint('item_owner_id_fkey', 'item', type_='foreignkey')\n    op.create_foreign_key(None, 'item', 'user', ['owner_id'], ['id'], ondelete='CASCADE')\n    # ### end Alembic commands ###\n\n\ndef downgrade():\n    # ### commands auto generated by Alembic - please adjust! ###\n    op.drop_constraint(None, 'item', type_='foreignkey')\n    op.create_foreign_key('item_owner_id_fkey', 'item', 'user', ['owner_id'], ['id'])\n    op.alter_column('item', 'owner_id',\n               existing_type=sa.UUID(),\n               nullable=True)\n    # ### end Alembic commands ###\n"
  },
  {
    "path": "backend/app/alembic/versions/9c0a54914c78_add_max_length_for_string_varchar_.py",
    "content": "\"\"\"Add max length for string(varchar) fields in User and Items models\n\nRevision ID: 9c0a54914c78\nRevises: e2412789c190\nCreate Date: 2024-06-17 14:42:44.639457\n\n\"\"\"\nfrom alembic import op\nimport sqlalchemy as sa\nimport sqlmodel.sql.sqltypes\n\n\n# revision identifiers, used by Alembic.\nrevision = '9c0a54914c78'\ndown_revision = 'e2412789c190'\nbranch_labels = None\ndepends_on = None\n\n\ndef upgrade():\n    # Adjust the length of the email field in the User table\n    op.alter_column('user', 'email',\n               existing_type=sa.String(),\n               type_=sa.String(length=255),\n               existing_nullable=False)\n\n    # Adjust the length of the full_name field in the User table\n    op.alter_column('user', 'full_name',\n               existing_type=sa.String(),\n               type_=sa.String(length=255),\n               existing_nullable=True)\n\n    # Adjust the length of the title field in the Item table\n    op.alter_column('item', 'title',\n               existing_type=sa.String(),\n               type_=sa.String(length=255),\n               existing_nullable=False)\n\n    # Adjust the length of the description field in the Item table\n    op.alter_column('item', 'description',\n               existing_type=sa.String(),\n               type_=sa.String(length=255),\n               existing_nullable=True)\n\n\ndef downgrade():\n    # Revert the length of the email field in the User table\n    op.alter_column('user', 'email',\n               existing_type=sa.String(length=255),\n               type_=sa.String(),\n               existing_nullable=False)\n\n    # Revert the length of the full_name field in the User table\n    op.alter_column('user', 'full_name',\n               existing_type=sa.String(length=255),\n               type_=sa.String(),\n               existing_nullable=True)\n\n    # Revert the length of the title field in the Item table\n    op.alter_column('item', 'title',\n               existing_type=sa.String(length=255),\n               type_=sa.String(),\n               existing_nullable=False)\n\n    # Revert the length of the description field in the Item table\n    op.alter_column('item', 'description',\n               existing_type=sa.String(length=255),\n               type_=sa.String(),\n               existing_nullable=True)\n"
  },
  {
    "path": "backend/app/alembic/versions/d98dd8ec85a3_edit_replace_id_integers_in_all_models_.py",
    "content": "\"\"\"Edit replace id integers in all models to use UUID instead\n\nRevision ID: d98dd8ec85a3\nRevises: 9c0a54914c78\nCreate Date: 2024-07-19 04:08:04.000976\n\n\"\"\"\nfrom alembic import op\nimport sqlalchemy as sa\nimport sqlmodel.sql.sqltypes\nfrom sqlalchemy.dialects import postgresql\n\n\n# revision identifiers, used by Alembic.\nrevision = 'd98dd8ec85a3'\ndown_revision = '9c0a54914c78'\nbranch_labels = None\ndepends_on = None\n\n\ndef upgrade():\n    # Ensure uuid-ossp extension is available\n    op.execute('CREATE EXTENSION IF NOT EXISTS \"uuid-ossp\"')\n\n    # Create a new UUID column with a default UUID value\n    op.add_column('user', sa.Column('new_id', postgresql.UUID(as_uuid=True), default=sa.text('uuid_generate_v4()')))\n    op.add_column('item', sa.Column('new_id', postgresql.UUID(as_uuid=True), default=sa.text('uuid_generate_v4()')))\n    op.add_column('item', sa.Column('new_owner_id', postgresql.UUID(as_uuid=True), nullable=True))\n\n    # Populate the new columns with UUIDs\n    op.execute('UPDATE \"user\" SET new_id = uuid_generate_v4()')\n    op.execute('UPDATE item SET new_id = uuid_generate_v4()')\n    op.execute('UPDATE item SET new_owner_id = (SELECT new_id FROM \"user\" WHERE \"user\".id = item.owner_id)')\n\n    # Set the new_id as not nullable\n    op.alter_column('user', 'new_id', nullable=False)\n    op.alter_column('item', 'new_id', nullable=False)\n\n    # Drop old columns and rename new columns\n    op.drop_constraint('item_owner_id_fkey', 'item', type_='foreignkey')\n    op.drop_column('item', 'owner_id')\n    op.alter_column('item', 'new_owner_id', new_column_name='owner_id')\n\n    op.drop_column('user', 'id')\n    op.alter_column('user', 'new_id', new_column_name='id')\n\n    op.drop_column('item', 'id')\n    op.alter_column('item', 'new_id', new_column_name='id')\n\n    # Create primary key constraint\n    op.create_primary_key('user_pkey', 'user', ['id'])\n    op.create_primary_key('item_pkey', 'item', ['id'])\n\n    # Recreate foreign key constraint\n    op.create_foreign_key('item_owner_id_fkey', 'item', 'user', ['owner_id'], ['id'])\n\ndef downgrade():\n    # Reverse the upgrade process\n    op.add_column('user', sa.Column('old_id', sa.Integer, autoincrement=True))\n    op.add_column('item', sa.Column('old_id', sa.Integer, autoincrement=True))\n    op.add_column('item', sa.Column('old_owner_id', sa.Integer, nullable=True))\n\n    # Populate the old columns with default values\n    # Generate sequences for the integer IDs if not exist\n    op.execute('CREATE SEQUENCE IF NOT EXISTS user_id_seq AS INTEGER OWNED BY \"user\".old_id')\n    op.execute('CREATE SEQUENCE IF NOT EXISTS item_id_seq AS INTEGER OWNED BY item.old_id')\n\n    op.execute('SELECT setval(\\'user_id_seq\\', COALESCE((SELECT MAX(old_id) + 1 FROM \"user\"), 1), false)')\n    op.execute('SELECT setval(\\'item_id_seq\\', COALESCE((SELECT MAX(old_id) + 1 FROM item), 1), false)')\n\n    op.execute('UPDATE \"user\" SET old_id = nextval(\\'user_id_seq\\')')\n    op.execute('UPDATE item SET old_id = nextval(\\'item_id_seq\\'), old_owner_id = (SELECT old_id FROM \"user\" WHERE \"user\".id = item.owner_id)')\n\n    # Drop new columns and rename old columns back\n    op.drop_constraint('item_owner_id_fkey', 'item', type_='foreignkey')\n    op.drop_column('item', 'owner_id')\n    op.alter_column('item', 'old_owner_id', new_column_name='owner_id')\n\n    op.drop_column('user', 'id')\n    op.alter_column('user', 'old_id', new_column_name='id')\n\n    op.drop_column('item', 'id')\n    op.alter_column('item', 'old_id', new_column_name='id')\n\n    # Create primary key constraint\n    op.create_primary_key('user_pkey', 'user', ['id'])\n    op.create_primary_key('item_pkey', 'item', ['id'])\n\n    # Recreate foreign key constraint\n    op.create_foreign_key('item_owner_id_fkey', 'item', 'user', ['owner_id'], ['id'])\n"
  },
  {
    "path": "backend/app/alembic/versions/e2412789c190_initialize_models.py",
    "content": "\"\"\"Initialize models\n\nRevision ID: e2412789c190\nRevises:\nCreate Date: 2023-11-24 22:55:43.195942\n\n\"\"\"\nimport sqlalchemy as sa\nimport sqlmodel.sql.sqltypes\nfrom alembic import op\n\n# revision identifiers, used by Alembic.\nrevision = \"e2412789c190\"\ndown_revision = None\nbranch_labels = None\ndepends_on = None\n\n\ndef upgrade():\n    # ### commands auto generated by Alembic - please adjust! ###\n    op.create_table(\n        \"user\",\n        sa.Column(\"email\", sqlmodel.sql.sqltypes.AutoString(), nullable=False),\n        sa.Column(\"is_active\", sa.Boolean(), nullable=False),\n        sa.Column(\"is_superuser\", sa.Boolean(), nullable=False),\n        sa.Column(\"full_name\", sqlmodel.sql.sqltypes.AutoString(), nullable=True),\n        sa.Column(\"id\", sa.Integer(), nullable=False),\n        sa.Column(\n            \"hashed_password\", sqlmodel.sql.sqltypes.AutoString(), nullable=False\n        ),\n        sa.PrimaryKeyConstraint(\"id\"),\n    )\n    op.create_index(op.f(\"ix_user_email\"), \"user\", [\"email\"], unique=True)\n    op.create_table(\n        \"item\",\n        sa.Column(\"description\", sqlmodel.sql.sqltypes.AutoString(), nullable=True),\n        sa.Column(\"id\", sa.Integer(), nullable=False),\n        sa.Column(\"title\", sqlmodel.sql.sqltypes.AutoString(), nullable=False),\n        sa.Column(\"owner_id\", sa.Integer(), nullable=False),\n        sa.ForeignKeyConstraint(\n            [\"owner_id\"],\n            [\"user.id\"],\n        ),\n        sa.PrimaryKeyConstraint(\"id\"),\n    )\n    # ### end Alembic commands ###\n\n\ndef downgrade():\n    # ### commands auto generated by Alembic - please adjust! ###\n    op.drop_table(\"item\")\n    op.drop_index(op.f(\"ix_user_email\"), table_name=\"user\")\n    op.drop_table(\"user\")\n    # ### end Alembic commands ###\n"
  },
  {
    "path": "backend/app/alembic/versions/fe56fa70289e_add_created_at_to_user_and_item.py",
    "content": "\"\"\"Add created_at to User and Item\n\nRevision ID: fe56fa70289e\nRevises: 1a31ce608336\nCreate Date: 2026-01-23 15:50:37.171462\n\n\"\"\"\nfrom alembic import op\nimport sqlalchemy as sa\nimport sqlmodel.sql.sqltypes\n\n\n# revision identifiers, used by Alembic.\nrevision = 'fe56fa70289e'\ndown_revision = '1a31ce608336'\nbranch_labels = None\ndepends_on = None\n\n\ndef upgrade():\n    # ### commands auto generated by Alembic - please adjust! ###\n    op.add_column('item', sa.Column('created_at', sa.DateTime(timezone=True), nullable=True))\n    op.add_column('user', sa.Column('created_at', sa.DateTime(timezone=True), nullable=True))\n    # ### end Alembic commands ###\n\n\ndef downgrade():\n    # ### commands auto generated by Alembic - please adjust! ###\n    op.drop_column('user', 'created_at')\n    op.drop_column('item', 'created_at')\n    # ### end Alembic commands ###\n"
  },
  {
    "path": "backend/app/api/__init__.py",
    "content": ""
  },
  {
    "path": "backend/app/api/deps.py",
    "content": "from collections.abc import Generator\nfrom typing import Annotated\n\nimport jwt\nfrom fastapi import Depends, HTTPException, status\nfrom fastapi.security import OAuth2PasswordBearer\nfrom jwt.exceptions import InvalidTokenError\nfrom pydantic import ValidationError\nfrom sqlmodel import Session\n\nfrom app.core import security\nfrom app.core.config import settings\nfrom app.core.db import engine\nfrom app.models import TokenPayload, User\n\nreusable_oauth2 = OAuth2PasswordBearer(\n    tokenUrl=f\"{settings.API_V1_STR}/login/access-token\"\n)\n\n\ndef get_db() -> Generator[Session, None, None]:\n    with Session(engine) as session:\n        yield session\n\n\nSessionDep = Annotated[Session, Depends(get_db)]\nTokenDep = Annotated[str, Depends(reusable_oauth2)]\n\n\ndef get_current_user(session: SessionDep, token: TokenDep) -> User:\n    try:\n        payload = jwt.decode(\n            token, settings.SECRET_KEY, algorithms=[security.ALGORITHM]\n        )\n        token_data = TokenPayload(**payload)\n    except (InvalidTokenError, ValidationError):\n        raise HTTPException(\n            status_code=status.HTTP_403_FORBIDDEN,\n            detail=\"Could not validate credentials\",\n        )\n    user = session.get(User, token_data.sub)\n    if not user:\n        raise HTTPException(status_code=404, detail=\"User not found\")\n    if not user.is_active:\n        raise HTTPException(status_code=400, detail=\"Inactive user\")\n    return user\n\n\nCurrentUser = Annotated[User, Depends(get_current_user)]\n\n\ndef get_current_active_superuser(current_user: CurrentUser) -> User:\n    if not current_user.is_superuser:\n        raise HTTPException(\n            status_code=403, detail=\"The user doesn't have enough privileges\"\n        )\n    return current_user\n"
  },
  {
    "path": "backend/app/api/main.py",
    "content": "from fastapi import APIRouter\n\nfrom app.api.routes import items, login, private, users, utils\nfrom app.core.config import settings\n\napi_router = APIRouter()\napi_router.include_router(login.router)\napi_router.include_router(users.router)\napi_router.include_router(utils.router)\napi_router.include_router(items.router)\n\n\nif settings.ENVIRONMENT == \"local\":\n    api_router.include_router(private.router)\n"
  },
  {
    "path": "backend/app/api/routes/__init__.py",
    "content": ""
  },
  {
    "path": "backend/app/api/routes/items.py",
    "content": "import uuid\nfrom typing import Any\n\nfrom fastapi import APIRouter, HTTPException\nfrom sqlmodel import col, func, select\n\nfrom app.api.deps import CurrentUser, SessionDep\nfrom app.models import Item, ItemCreate, ItemPublic, ItemsPublic, ItemUpdate, Message\n\nrouter = APIRouter(prefix=\"/items\", tags=[\"items\"])\n\n\n@router.get(\"/\", response_model=ItemsPublic)\ndef read_items(\n    session: SessionDep, current_user: CurrentUser, skip: int = 0, limit: int = 100\n) -> Any:\n    \"\"\"\n    Retrieve items.\n    \"\"\"\n\n    if current_user.is_superuser:\n        count_statement = select(func.count()).select_from(Item)\n        count = session.exec(count_statement).one()\n        statement = (\n            select(Item).order_by(col(Item.created_at).desc()).offset(skip).limit(limit)\n        )\n        items = session.exec(statement).all()\n    else:\n        count_statement = (\n            select(func.count())\n            .select_from(Item)\n            .where(Item.owner_id == current_user.id)\n        )\n        count = session.exec(count_statement).one()\n        statement = (\n            select(Item)\n            .where(Item.owner_id == current_user.id)\n            .order_by(col(Item.created_at).desc())\n            .offset(skip)\n            .limit(limit)\n        )\n        items = session.exec(statement).all()\n\n    return ItemsPublic(data=items, count=count)\n\n\n@router.get(\"/{id}\", response_model=ItemPublic)\ndef read_item(session: SessionDep, current_user: CurrentUser, id: uuid.UUID) -> Any:\n    \"\"\"\n    Get item by ID.\n    \"\"\"\n    item = session.get(Item, id)\n    if not item:\n        raise HTTPException(status_code=404, detail=\"Item not found\")\n    if not current_user.is_superuser and (item.owner_id != current_user.id):\n        raise HTTPException(status_code=403, detail=\"Not enough permissions\")\n    return item\n\n\n@router.post(\"/\", response_model=ItemPublic)\ndef create_item(\n    *, session: SessionDep, current_user: CurrentUser, item_in: ItemCreate\n) -> Any:\n    \"\"\"\n    Create new item.\n    \"\"\"\n    item = Item.model_validate(item_in, update={\"owner_id\": current_user.id})\n    session.add(item)\n    session.commit()\n    session.refresh(item)\n    return item\n\n\n@router.put(\"/{id}\", response_model=ItemPublic)\ndef update_item(\n    *,\n    session: SessionDep,\n    current_user: CurrentUser,\n    id: uuid.UUID,\n    item_in: ItemUpdate,\n) -> Any:\n    \"\"\"\n    Update an item.\n    \"\"\"\n    item = session.get(Item, id)\n    if not item:\n        raise HTTPException(status_code=404, detail=\"Item not found\")\n    if not current_user.is_superuser and (item.owner_id != current_user.id):\n        raise HTTPException(status_code=403, detail=\"Not enough permissions\")\n    update_dict = item_in.model_dump(exclude_unset=True)\n    item.sqlmodel_update(update_dict)\n    session.add(item)\n    session.commit()\n    session.refresh(item)\n    return item\n\n\n@router.delete(\"/{id}\")\ndef delete_item(\n    session: SessionDep, current_user: CurrentUser, id: uuid.UUID\n) -> Message:\n    \"\"\"\n    Delete an item.\n    \"\"\"\n    item = session.get(Item, id)\n    if not item:\n        raise HTTPException(status_code=404, detail=\"Item not found\")\n    if not current_user.is_superuser and (item.owner_id != current_user.id):\n        raise HTTPException(status_code=403, detail=\"Not enough permissions\")\n    session.delete(item)\n    session.commit()\n    return Message(message=\"Item deleted successfully\")\n"
  },
  {
    "path": "backend/app/api/routes/login.py",
    "content": "from datetime import timedelta\nfrom typing import Annotated, Any\n\nfrom fastapi import APIRouter, Depends, HTTPException\nfrom fastapi.responses import HTMLResponse\nfrom fastapi.security import OAuth2PasswordRequestForm\n\nfrom app import crud\nfrom app.api.deps import CurrentUser, SessionDep, get_current_active_superuser\nfrom app.core import security\nfrom app.core.config import settings\nfrom app.models import Message, NewPassword, Token, UserPublic, UserUpdate\nfrom app.utils import (\n    generate_password_reset_token,\n    generate_reset_password_email,\n    send_email,\n    verify_password_reset_token,\n)\n\nrouter = APIRouter(tags=[\"login\"])\n\n\n@router.post(\"/login/access-token\")\ndef login_access_token(\n    session: SessionDep, form_data: Annotated[OAuth2PasswordRequestForm, Depends()]\n) -> Token:\n    \"\"\"\n    OAuth2 compatible token login, get an access token for future requests\n    \"\"\"\n    user = crud.authenticate(\n        session=session, email=form_data.username, password=form_data.password\n    )\n    if not user:\n        raise HTTPException(status_code=400, detail=\"Incorrect email or password\")\n    elif not user.is_active:\n        raise HTTPException(status_code=400, detail=\"Inactive user\")\n    access_token_expires = timedelta(minutes=settings.ACCESS_TOKEN_EXPIRE_MINUTES)\n    return Token(\n        access_token=security.create_access_token(\n            user.id, expires_delta=access_token_expires\n        )\n    )\n\n\n@router.post(\"/login/test-token\", response_model=UserPublic)\ndef test_token(current_user: CurrentUser) -> Any:\n    \"\"\"\n    Test access token\n    \"\"\"\n    return current_user\n\n\n@router.post(\"/password-recovery/{email}\")\ndef recover_password(email: str, session: SessionDep) -> Message:\n    \"\"\"\n    Password Recovery\n    \"\"\"\n    user = crud.get_user_by_email(session=session, email=email)\n\n    # Always return the same response to prevent email enumeration attacks\n    # Only send email if user actually exists\n    if user:\n        password_reset_token = generate_password_reset_token(email=email)\n        email_data = generate_reset_password_email(\n            email_to=user.email, email=email, token=password_reset_token\n        )\n        send_email(\n            email_to=user.email,\n            subject=email_data.subject,\n            html_content=email_data.html_content,\n        )\n    return Message(\n        message=\"If that email is registered, we sent a password recovery link\"\n    )\n\n\n@router.post(\"/reset-password/\")\ndef reset_password(session: SessionDep, body: NewPassword) -> Message:\n    \"\"\"\n    Reset password\n    \"\"\"\n    email = verify_password_reset_token(token=body.token)\n    if not email:\n        raise HTTPException(status_code=400, detail=\"Invalid token\")\n    user = crud.get_user_by_email(session=session, email=email)\n    if not user:\n        # Don't reveal that the user doesn't exist - use same error as invalid token\n        raise HTTPException(status_code=400, detail=\"Invalid token\")\n    elif not user.is_active:\n        raise HTTPException(status_code=400, detail=\"Inactive user\")\n    user_in_update = UserUpdate(password=body.new_password)\n    crud.update_user(\n        session=session,\n        db_user=user,\n        user_in=user_in_update,\n    )\n    return Message(message=\"Password updated successfully\")\n\n\n@router.post(\n    \"/password-recovery-html-content/{email}\",\n    dependencies=[Depends(get_current_active_superuser)],\n    response_class=HTMLResponse,\n)\ndef recover_password_html_content(email: str, session: SessionDep) -> Any:\n    \"\"\"\n    HTML Content for Password Recovery\n    \"\"\"\n    user = crud.get_user_by_email(session=session, email=email)\n\n    if not user:\n        raise HTTPException(\n            status_code=404,\n            detail=\"The user with this username does not exist in the system.\",\n        )\n    password_reset_token = generate_password_reset_token(email=email)\n    email_data = generate_reset_password_email(\n        email_to=user.email, email=email, token=password_reset_token\n    )\n\n    return HTMLResponse(\n        content=email_data.html_content, headers={\"subject:\": email_data.subject}\n    )\n"
  },
  {
    "path": "backend/app/api/routes/private.py",
    "content": "from typing import Any\n\nfrom fastapi import APIRouter\nfrom pydantic import BaseModel\n\nfrom app.api.deps import SessionDep\nfrom app.core.security import get_password_hash\nfrom app.models import (\n    User,\n    UserPublic,\n)\n\nrouter = APIRouter(tags=[\"private\"], prefix=\"/private\")\n\n\nclass PrivateUserCreate(BaseModel):\n    email: str\n    password: str\n    full_name: str\n    is_verified: bool = False\n\n\n@router.post(\"/users/\", response_model=UserPublic)\ndef create_user(user_in: PrivateUserCreate, session: SessionDep) -> Any:\n    \"\"\"\n    Create a new user.\n    \"\"\"\n\n    user = User(\n        email=user_in.email,\n        full_name=user_in.full_name,\n        hashed_password=get_password_hash(user_in.password),\n    )\n\n    session.add(user)\n    session.commit()\n\n    return user\n"
  },
  {
    "path": "backend/app/api/routes/users.py",
    "content": "import uuid\nfrom typing import Any\n\nfrom fastapi import APIRouter, Depends, HTTPException\nfrom sqlmodel import col, delete, func, select\n\nfrom app import crud\nfrom app.api.deps import (\n    CurrentUser,\n    SessionDep,\n    get_current_active_superuser,\n)\nfrom app.core.config import settings\nfrom app.core.security import get_password_hash, verify_password\nfrom app.models import (\n    Item,\n    Message,\n    UpdatePassword,\n    User,\n    UserCreate,\n    UserPublic,\n    UserRegister,\n    UsersPublic,\n    UserUpdate,\n    UserUpdateMe,\n)\nfrom app.utils import generate_new_account_email, send_email\n\nrouter = APIRouter(prefix=\"/users\", tags=[\"users\"])\n\n\n@router.get(\n    \"/\",\n    dependencies=[Depends(get_current_active_superuser)],\n    response_model=UsersPublic,\n)\ndef read_users(session: SessionDep, skip: int = 0, limit: int = 100) -> Any:\n    \"\"\"\n    Retrieve users.\n    \"\"\"\n\n    count_statement = select(func.count()).select_from(User)\n    count = session.exec(count_statement).one()\n\n    statement = (\n        select(User).order_by(col(User.created_at).desc()).offset(skip).limit(limit)\n    )\n    users = session.exec(statement).all()\n\n    return UsersPublic(data=users, count=count)\n\n\n@router.post(\n    \"/\", dependencies=[Depends(get_current_active_superuser)], response_model=UserPublic\n)\ndef create_user(*, session: SessionDep, user_in: UserCreate) -> Any:\n    \"\"\"\n    Create new user.\n    \"\"\"\n    user = crud.get_user_by_email(session=session, email=user_in.email)\n    if user:\n        raise HTTPException(\n            status_code=400,\n            detail=\"The user with this email already exists in the system.\",\n        )\n\n    user = crud.create_user(session=session, user_create=user_in)\n    if settings.emails_enabled and user_in.email:\n        email_data = generate_new_account_email(\n            email_to=user_in.email, username=user_in.email, password=user_in.password\n        )\n        send_email(\n            email_to=user_in.email,\n            subject=email_data.subject,\n            html_content=email_data.html_content,\n        )\n    return user\n\n\n@router.patch(\"/me\", response_model=UserPublic)\ndef update_user_me(\n    *, session: SessionDep, user_in: UserUpdateMe, current_user: CurrentUser\n) -> Any:\n    \"\"\"\n    Update own user.\n    \"\"\"\n\n    if user_in.email:\n        existing_user = crud.get_user_by_email(session=session, email=user_in.email)\n        if existing_user and existing_user.id != current_user.id:\n            raise HTTPException(\n                status_code=409, detail=\"User with this email already exists\"\n            )\n    user_data = user_in.model_dump(exclude_unset=True)\n    current_user.sqlmodel_update(user_data)\n    session.add(current_user)\n    session.commit()\n    session.refresh(current_user)\n    return current_user\n\n\n@router.patch(\"/me/password\", response_model=Message)\ndef update_password_me(\n    *, session: SessionDep, body: UpdatePassword, current_user: CurrentUser\n) -> Any:\n    \"\"\"\n    Update own password.\n    \"\"\"\n    verified, _ = verify_password(body.current_password, current_user.hashed_password)\n    if not verified:\n        raise HTTPException(status_code=400, detail=\"Incorrect password\")\n    if body.current_password == body.new_password:\n        raise HTTPException(\n            status_code=400, detail=\"New password cannot be the same as the current one\"\n        )\n    hashed_password = get_password_hash(body.new_password)\n    current_user.hashed_password = hashed_password\n    session.add(current_user)\n    session.commit()\n    return Message(message=\"Password updated successfully\")\n\n\n@router.get(\"/me\", response_model=UserPublic)\ndef read_user_me(current_user: CurrentUser) -> Any:\n    \"\"\"\n    Get current user.\n    \"\"\"\n    return current_user\n\n\n@router.delete(\"/me\", response_model=Message)\ndef delete_user_me(session: SessionDep, current_user: CurrentUser) -> Any:\n    \"\"\"\n    Delete own user.\n    \"\"\"\n    if current_user.is_superuser:\n        raise HTTPException(\n            status_code=403, detail=\"Super users are not allowed to delete themselves\"\n        )\n    session.delete(current_user)\n    session.commit()\n    return Message(message=\"User deleted successfully\")\n\n\n@router.post(\"/signup\", response_model=UserPublic)\ndef register_user(session: SessionDep, user_in: UserRegister) -> Any:\n    \"\"\"\n    Create new user without the need to be logged in.\n    \"\"\"\n    user = crud.get_user_by_email(session=session, email=user_in.email)\n    if user:\n        raise HTTPException(\n            status_code=400,\n            detail=\"The user with this email already exists in the system\",\n        )\n    user_create = UserCreate.model_validate(user_in)\n    user = crud.create_user(session=session, user_create=user_create)\n    return user\n\n\n@router.get(\"/{user_id}\", response_model=UserPublic)\ndef read_user_by_id(\n    user_id: uuid.UUID, session: SessionDep, current_user: CurrentUser\n) -> Any:\n    \"\"\"\n    Get a specific user by id.\n    \"\"\"\n    user = session.get(User, user_id)\n    if user == current_user:\n        return user\n    if not current_user.is_superuser:\n        raise HTTPException(\n            status_code=403,\n            detail=\"The user doesn't have enough privileges\",\n        )\n    if user is None:\n        raise HTTPException(status_code=404, detail=\"User not found\")\n    return user\n\n\n@router.patch(\n    \"/{user_id}\",\n    dependencies=[Depends(get_current_active_superuser)],\n    response_model=UserPublic,\n)\ndef update_user(\n    *,\n    session: SessionDep,\n    user_id: uuid.UUID,\n    user_in: UserUpdate,\n) -> Any:\n    \"\"\"\n    Update a user.\n    \"\"\"\n\n    db_user = session.get(User, user_id)\n    if not db_user:\n        raise HTTPException(\n            status_code=404,\n            detail=\"The user with this id does not exist in the system\",\n        )\n    if user_in.email:\n        existing_user = crud.get_user_by_email(session=session, email=user_in.email)\n        if existing_user and existing_user.id != user_id:\n            raise HTTPException(\n                status_code=409, detail=\"User with this email already exists\"\n            )\n\n    db_user = crud.update_user(session=session, db_user=db_user, user_in=user_in)\n    return db_user\n\n\n@router.delete(\"/{user_id}\", dependencies=[Depends(get_current_active_superuser)])\ndef delete_user(\n    session: SessionDep, current_user: CurrentUser, user_id: uuid.UUID\n) -> Message:\n    \"\"\"\n    Delete a user.\n    \"\"\"\n    user = session.get(User, user_id)\n    if not user:\n        raise HTTPException(status_code=404, detail=\"User not found\")\n    if user == current_user:\n        raise HTTPException(\n            status_code=403, detail=\"Super users are not allowed to delete themselves\"\n        )\n    statement = delete(Item).where(col(Item.owner_id) == user_id)\n    session.exec(statement)\n    session.delete(user)\n    session.commit()\n    return Message(message=\"User deleted successfully\")\n"
  },
  {
    "path": "backend/app/api/routes/utils.py",
    "content": "from fastapi import APIRouter, Depends\nfrom pydantic.networks import EmailStr\n\nfrom app.api.deps import get_current_active_superuser\nfrom app.models import Message\nfrom app.utils import generate_test_email, send_email\n\nrouter = APIRouter(prefix=\"/utils\", tags=[\"utils\"])\n\n\n@router.post(\n    \"/test-email/\",\n    dependencies=[Depends(get_current_active_superuser)],\n    status_code=201,\n)\ndef test_email(email_to: EmailStr) -> Message:\n    \"\"\"\n    Test emails.\n    \"\"\"\n    email_data = generate_test_email(email_to=email_to)\n    send_email(\n        email_to=email_to,\n        subject=email_data.subject,\n        html_content=email_data.html_content,\n    )\n    return Message(message=\"Test email sent\")\n\n\n@router.get(\"/health-check/\")\nasync def health_check() -> bool:\n    return True\n"
  },
  {
    "path": "backend/app/backend_pre_start.py",
    "content": "import logging\n\nfrom sqlalchemy import Engine\nfrom sqlmodel import Session, select\nfrom tenacity import after_log, before_log, retry, stop_after_attempt, wait_fixed\n\nfrom app.core.db import engine\n\nlogging.basicConfig(level=logging.INFO)\nlogger = logging.getLogger(__name__)\n\nmax_tries = 60 * 5  # 5 minutes\nwait_seconds = 1\n\n\n@retry(\n    stop=stop_after_attempt(max_tries),\n    wait=wait_fixed(wait_seconds),\n    before=before_log(logger, logging.INFO),\n    after=after_log(logger, logging.WARN),\n)\ndef init(db_engine: Engine) -> None:\n    try:\n        with Session(db_engine) as session:\n            # Try to create session to check if DB is awake\n            session.exec(select(1))\n    except Exception as e:\n        logger.error(e)\n        raise e\n\n\ndef main() -> None:\n    logger.info(\"Initializing service\")\n    init(engine)\n    logger.info(\"Service finished initializing\")\n\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "backend/app/core/__init__.py",
    "content": ""
  },
  {
    "path": "backend/app/core/config.py",
    "content": "import secrets\nimport warnings\nfrom typing import Annotated, Any, Literal\n\nfrom pydantic import (\n    AnyUrl,\n    BeforeValidator,\n    EmailStr,\n    HttpUrl,\n    PostgresDsn,\n    computed_field,\n    model_validator,\n)\nfrom pydantic_settings import BaseSettings, SettingsConfigDict\nfrom typing_extensions import Self\n\n\ndef parse_cors(v: Any) -> list[str] | str:\n    if isinstance(v, str) and not v.startswith(\"[\"):\n        return [i.strip() for i in v.split(\",\") if i.strip()]\n    elif isinstance(v, list | str):\n        return v\n    raise ValueError(v)\n\n\nclass Settings(BaseSettings):\n    model_config = SettingsConfigDict(\n        # Use top level .env file (one level above ./backend/)\n        env_file=\"../.env\",\n        env_ignore_empty=True,\n        extra=\"ignore\",\n    )\n    API_V1_STR: str = \"/api/v1\"\n    SECRET_KEY: str = secrets.token_urlsafe(32)\n    # 60 minutes * 24 hours * 8 days = 8 days\n    ACCESS_TOKEN_EXPIRE_MINUTES: int = 60 * 24 * 8\n    FRONTEND_HOST: str = \"http://localhost:5173\"\n    ENVIRONMENT: Literal[\"local\", \"staging\", \"production\"] = \"local\"\n\n    BACKEND_CORS_ORIGINS: Annotated[\n        list[AnyUrl] | str, BeforeValidator(parse_cors)\n    ] = []\n\n    @computed_field  # type: ignore[prop-decorator]\n    @property\n    def all_cors_origins(self) -> list[str]:\n        return [str(origin).rstrip(\"/\") for origin in self.BACKEND_CORS_ORIGINS] + [\n            self.FRONTEND_HOST\n        ]\n\n    PROJECT_NAME: str\n    SENTRY_DSN: HttpUrl | None = None\n    POSTGRES_SERVER: str\n    POSTGRES_PORT: int = 5432\n    POSTGRES_USER: str\n    POSTGRES_PASSWORD: str = \"\"\n    POSTGRES_DB: str = \"\"\n\n    @computed_field  # type: ignore[prop-decorator]\n    @property\n    def SQLALCHEMY_DATABASE_URI(self) -> PostgresDsn:\n        return PostgresDsn.build(\n            scheme=\"postgresql+psycopg\",\n            username=self.POSTGRES_USER,\n            password=self.POSTGRES_PASSWORD,\n            host=self.POSTGRES_SERVER,\n            port=self.POSTGRES_PORT,\n            path=self.POSTGRES_DB,\n        )\n\n    SMTP_TLS: bool = True\n    SMTP_SSL: bool = False\n    SMTP_PORT: int = 587\n    SMTP_HOST: str | None = None\n    SMTP_USER: str | None = None\n    SMTP_PASSWORD: str | None = None\n    EMAILS_FROM_EMAIL: EmailStr | None = None\n    EMAILS_FROM_NAME: str | None = None\n\n    @model_validator(mode=\"after\")\n    def _set_default_emails_from(self) -> Self:\n        if not self.EMAILS_FROM_NAME:\n            self.EMAILS_FROM_NAME = self.PROJECT_NAME\n        return self\n\n    EMAIL_RESET_TOKEN_EXPIRE_HOURS: int = 48\n\n    @computed_field  # type: ignore[prop-decorator]\n    @property\n    def emails_enabled(self) -> bool:\n        return bool(self.SMTP_HOST and self.EMAILS_FROM_EMAIL)\n\n    EMAIL_TEST_USER: EmailStr = \"test@example.com\"\n    FIRST_SUPERUSER: EmailStr\n    FIRST_SUPERUSER_PASSWORD: str\n\n    def _check_default_secret(self, var_name: str, value: str | None) -> None:\n        if value == \"changethis\":\n            message = (\n                f'The value of {var_name} is \"changethis\", '\n                \"for security, please change it, at least for deployments.\"\n            )\n            if self.ENVIRONMENT == \"local\":\n                warnings.warn(message, stacklevel=1)\n            else:\n                raise ValueError(message)\n\n    @model_validator(mode=\"after\")\n    def _enforce_non_default_secrets(self) -> Self:\n        self._check_default_secret(\"SECRET_KEY\", self.SECRET_KEY)\n        self._check_default_secret(\"POSTGRES_PASSWORD\", self.POSTGRES_PASSWORD)\n        self._check_default_secret(\n            \"FIRST_SUPERUSER_PASSWORD\", self.FIRST_SUPERUSER_PASSWORD\n        )\n\n        return self\n\n\nsettings = Settings()  # type: ignore\n"
  },
  {
    "path": "backend/app/core/db.py",
    "content": "from sqlmodel import Session, create_engine, select\n\nfrom app import crud\nfrom app.core.config import settings\nfrom app.models import User, UserCreate\n\nengine = create_engine(str(settings.SQLALCHEMY_DATABASE_URI))\n\n\n# make sure all SQLModel models are imported (app.models) before initializing DB\n# otherwise, SQLModel might fail to initialize relationships properly\n# for more details: https://github.com/fastapi/full-stack-fastapi-template/issues/28\n\n\ndef init_db(session: Session) -> None:\n    # Tables should be created with Alembic migrations\n    # But if you don't want to use migrations, create\n    # the tables un-commenting the next lines\n    # from sqlmodel import SQLModel\n\n    # This works because the models are already imported and registered from app.models\n    # SQLModel.metadata.create_all(engine)\n\n    user = session.exec(\n        select(User).where(User.email == settings.FIRST_SUPERUSER)\n    ).first()\n    if not user:\n        user_in = UserCreate(\n            email=settings.FIRST_SUPERUSER,\n            password=settings.FIRST_SUPERUSER_PASSWORD,\n            is_superuser=True,\n        )\n        user = crud.create_user(session=session, user_create=user_in)\n"
  },
  {
    "path": "backend/app/core/security.py",
    "content": "from datetime import datetime, timedelta, timezone\nfrom typing import Any\n\nimport jwt\nfrom pwdlib import PasswordHash\nfrom pwdlib.hashers.argon2 import Argon2Hasher\nfrom pwdlib.hashers.bcrypt import BcryptHasher\n\nfrom app.core.config import settings\n\npassword_hash = PasswordHash(\n    (\n        Argon2Hasher(),\n        BcryptHasher(),\n    )\n)\n\n\nALGORITHM = \"HS256\"\n\n\ndef create_access_token(subject: str | Any, expires_delta: timedelta) -> str:\n    expire = datetime.now(timezone.utc) + expires_delta\n    to_encode = {\"exp\": expire, \"sub\": str(subject)}\n    encoded_jwt = jwt.encode(to_encode, settings.SECRET_KEY, algorithm=ALGORITHM)\n    return encoded_jwt\n\n\ndef verify_password(\n    plain_password: str, hashed_password: str\n) -> tuple[bool, str | None]:\n    return password_hash.verify_and_update(plain_password, hashed_password)\n\n\ndef get_password_hash(password: str) -> str:\n    return password_hash.hash(password)\n"
  },
  {
    "path": "backend/app/crud.py",
    "content": "import uuid\nfrom typing import Any\n\nfrom sqlmodel import Session, select\n\nfrom app.core.security import get_password_hash, verify_password\nfrom app.models import Item, ItemCreate, User, UserCreate, UserUpdate\n\n\ndef create_user(*, session: Session, user_create: UserCreate) -> User:\n    db_obj = User.model_validate(\n        user_create, update={\"hashed_password\": get_password_hash(user_create.password)}\n    )\n    session.add(db_obj)\n    session.commit()\n    session.refresh(db_obj)\n    return db_obj\n\n\ndef update_user(*, session: Session, db_user: User, user_in: UserUpdate) -> Any:\n    user_data = user_in.model_dump(exclude_unset=True)\n    extra_data = {}\n    if \"password\" in user_data:\n        password = user_data[\"password\"]\n        hashed_password = get_password_hash(password)\n        extra_data[\"hashed_password\"] = hashed_password\n    db_user.sqlmodel_update(user_data, update=extra_data)\n    session.add(db_user)\n    session.commit()\n    session.refresh(db_user)\n    return db_user\n\n\ndef get_user_by_email(*, session: Session, email: str) -> User | None:\n    statement = select(User).where(User.email == email)\n    session_user = session.exec(statement).first()\n    return session_user\n\n\n# Dummy hash to use for timing attack prevention when user is not found\n# This is an Argon2 hash of a random password, used to ensure constant-time comparison\nDUMMY_HASH = \"$argon2id$v=19$m=65536,t=3,p=4$MjQyZWE1MzBjYjJlZTI0Yw$YTU4NGM5ZTZmYjE2NzZlZjY0ZWY3ZGRkY2U2OWFjNjk\"\n\n\ndef authenticate(*, session: Session, email: str, password: str) -> User | None:\n    db_user = get_user_by_email(session=session, email=email)\n    if not db_user:\n        # Prevent timing attacks by running password verification even when user doesn't exist\n        # This ensures the response time is similar whether or not the email exists\n        verify_password(password, DUMMY_HASH)\n        return None\n    verified, updated_password_hash = verify_password(password, db_user.hashed_password)\n    if not verified:\n        return None\n    if updated_password_hash:\n        db_user.hashed_password = updated_password_hash\n        session.add(db_user)\n        session.commit()\n        session.refresh(db_user)\n    return db_user\n\n\ndef create_item(*, session: Session, item_in: ItemCreate, owner_id: uuid.UUID) -> Item:\n    db_item = Item.model_validate(item_in, update={\"owner_id\": owner_id})\n    session.add(db_item)\n    session.commit()\n    session.refresh(db_item)\n    return db_item\n"
  },
  {
    "path": "backend/app/email-templates/build/new_account.html",
    "content": "<!doctype html><html xmlns=\"http://www.w3.org/1999/xhtml\" xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:o=\"urn:schemas-microsoft-com:office:office\"><head><title></title><!--[if !mso]><!-- --><meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\"><!--<![endif]--><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"><meta name=\"viewport\" content=\"width=device-width,initial-scale=1\"><style type=\"text/css\">#outlook a { padding:0; }\n          .ReadMsgBody { width:100%; }\n          .ExternalClass { width:100%; }\n          .ExternalClass * { line-height:100%; }\n          body { margin:0;padding:0;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%; }\n          table, td { border-collapse:collapse;mso-table-lspace:0pt;mso-table-rspace:0pt; }\n          img { border:0;height:auto;line-height:100%; outline:none;text-decoration:none;-ms-interpolation-mode:bicubic; }\n          p { display:block;margin:13px 0; }</style><!--[if !mso]><!--><style type=\"text/css\">@media only screen and (max-width:480px) {\n            @-ms-viewport { width:320px; }\n            @viewport { width:320px; }\n          }</style><!--<![endif]--><!--[if mso]>\n        <xml>\n        <o:OfficeDocumentSettings>\n          <o:AllowPNG/>\n          <o:PixelsPerInch>96</o:PixelsPerInch>\n        </o:OfficeDocumentSettings>\n        </xml>\n        <![endif]--><!--[if lte mso 11]>\n        <style type=\"text/css\">\n          .outlook-group-fix { width:100% !important; }\n        </style>\n        <![endif]--><!--[if !mso]><!--><link href=\"https://fonts.googleapis.com/css?family=Ubuntu:300,400,500,700\" rel=\"stylesheet\" type=\"text/css\"><style type=\"text/css\">@import url(https://fonts.googleapis.com/css?family=Ubuntu:300,400,500,700);</style><!--<![endif]--><style type=\"text/css\">@media only screen and (min-width:480px) {\n        .mj-column-per-100 { width:100% !important; max-width: 100%; }\n      }</style><style type=\"text/css\"></style></head><body style=\"background-color:#fafbfc;\"><div style=\"background-color:#fafbfc;\"><!--[if mso | IE]><table align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"\" style=\"width:600px;\" width=\"600\" ><tr><td style=\"line-height:0px;font-size:0px;mso-line-height-rule:exactly;\"><![endif]--><div style=\"background:#ffffff;background-color:#ffffff;Margin:0px auto;max-width:600px;\"><table align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" style=\"background:#ffffff;background-color:#ffffff;width:100%;\"><tbody><tr><td style=\"direction:ltr;font-size:0px;padding:40px 20px;text-align:center;vertical-align:top;\"><!--[if mso | IE]><table role=\"presentation\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr><td class=\"\" style=\"vertical-align:middle;width:560px;\" ><![endif]--><div class=\"mj-column-per-100 outlook-group-fix\" style=\"font-size:13px;text-align:left;direction:ltr;display:inline-block;vertical-align:middle;width:100%;\"><table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" style=\"vertical-align:middle;\" width=\"100%\"><tr><td align=\"center\" style=\"font-size:0px;padding:35px;word-break:break-word;\"><div style=\"font-family:Ubuntu, Helvetica, Arial, sans-serif;font-size:20px;line-height:1;text-align:center;color:#333333;\">{{ project_name }} - New Account</div></td></tr><tr><td align=\"center\" style=\"font-size:0px;padding:10px 25px;padding-right:25px;padding-left:25px;word-break:break-word;\"><div style=\"font-family:Arial, Helvetica, sans-serif;font-size:16px;line-height:1;text-align:center;color:#555555;\"><span>Welcome to your new account!</span></div></td></tr><tr><td align=\"center\" style=\"font-size:0px;padding:10px 25px;padding-right:25px;padding-left:25px;word-break:break-word;\"><div style=\"font-family:Arial, Helvetica, sans-serif;font-size:16px;line-height:1;text-align:center;color:#555555;\">Here are your account details:</div></td></tr><tr><td align=\"center\" style=\"font-size:0px;padding:10px 25px;padding-right:25px;padding-left:25px;word-break:break-word;\"><div style=\"font-family:Arial, Helvetica, sans-serif;font-size:16px;line-height:1;text-align:center;color:#555555;\">Username: {{ username }}</div></td></tr><tr><td align=\"center\" style=\"font-size:0px;padding:10px 25px;padding-right:25px;padding-left:25px;word-break:break-word;\"><div style=\"font-family:Arial, Helvetica, sans-serif;font-size:16px;line-height:1;text-align:center;color:#555555;\">Password: {{ password }}</div></td></tr><tr><td align=\"center\" vertical-align=\"middle\" style=\"font-size:0px;padding:15px 30px;word-break:break-word;\"><table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" style=\"border-collapse:separate;line-height:100%;\"><tr><td align=\"center\" bgcolor=\"#009688\" role=\"presentation\" style=\"border:none;border-radius:8px;cursor:auto;padding:10px 25px;background:#009688;\" valign=\"middle\"><a href=\"{{ link }}\" style=\"background:#009688;color:#ffffff;font-family:Ubuntu, Helvetica, Arial, sans-serif;font-size:18px;font-weight:normal;line-height:120%;Margin:0;text-decoration:none;text-transform:none;\" target=\"_blank\">Go to Dashboard</a></td></tr></table></td></tr><tr><td style=\"font-size:0px;padding:10px 25px;word-break:break-word;\"><p style=\"border-top:solid 2px #cccccc;font-size:1;margin:0px auto;width:100%;\"></p><!--[if mso | IE]><table align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"border-top:solid 2px #cccccc;font-size:1;margin:0px auto;width:510px;\" role=\"presentation\" width=\"510px\" ><tr><td style=\"height:0;line-height:0;\"> &nbsp;\n</td></tr></table><![endif]--></td></tr></table></div><!--[if mso | IE]></td></tr></table><![endif]--></td></tr></tbody></table></div><!--[if mso | IE]></td></tr></table><![endif]--></div></body></html>"
  },
  {
    "path": "backend/app/email-templates/build/reset_password.html",
    "content": "<!doctype html><html xmlns=\"http://www.w3.org/1999/xhtml\" xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:o=\"urn:schemas-microsoft-com:office:office\"><head><title></title><!--[if !mso]><!-- --><meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\"><!--<![endif]--><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"><meta name=\"viewport\" content=\"width=device-width,initial-scale=1\"><style type=\"text/css\">#outlook a { padding:0; }\n          .ReadMsgBody { width:100%; }\n          .ExternalClass { width:100%; }\n          .ExternalClass * { line-height:100%; }\n          body { margin:0;padding:0;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%; }\n          table, td { border-collapse:collapse;mso-table-lspace:0pt;mso-table-rspace:0pt; }\n          img { border:0;height:auto;line-height:100%; outline:none;text-decoration:none;-ms-interpolation-mode:bicubic; }\n          p { display:block;margin:13px 0; }</style><!--[if !mso]><!--><style type=\"text/css\">@media only screen and (max-width:480px) {\n            @-ms-viewport { width:320px; }\n            @viewport { width:320px; }\n          }</style><!--<![endif]--><!--[if mso]>\n        <xml>\n        <o:OfficeDocumentSettings>\n          <o:AllowPNG/>\n          <o:PixelsPerInch>96</o:PixelsPerInch>\n        </o:OfficeDocumentSettings>\n        </xml>\n        <![endif]--><!--[if lte mso 11]>\n        <style type=\"text/css\">\n          .outlook-group-fix { width:100% !important; }\n        </style>\n        <![endif]--><!--[if !mso]><!--><link href=\"https://fonts.googleapis.com/css?family=Ubuntu:300,400,500,700\" rel=\"stylesheet\" type=\"text/css\"><style type=\"text/css\">@import url(https://fonts.googleapis.com/css?family=Ubuntu:300,400,500,700);</style><!--<![endif]--><style type=\"text/css\">@media only screen and (min-width:480px) {\n        .mj-column-per-100 { width:100% !important; max-width: 100%; }\n      }</style><style type=\"text/css\"></style></head><body style=\"background-color:#fafbfc;\"><div style=\"background-color:#fafbfc;\"><!--[if mso | IE]><table align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"\" style=\"width:600px;\" width=\"600\" ><tr><td style=\"line-height:0px;font-size:0px;mso-line-height-rule:exactly;\"><![endif]--><div style=\"background:#ffffff;background-color:#ffffff;Margin:0px auto;max-width:600px;\"><table align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" style=\"background:#ffffff;background-color:#ffffff;width:100%;\"><tbody><tr><td style=\"direction:ltr;font-size:0px;padding:40px 20px;text-align:center;vertical-align:top;\"><!--[if mso | IE]><table role=\"presentation\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr><td class=\"\" style=\"vertical-align:middle;width:560px;\" ><![endif]--><div class=\"mj-column-per-100 outlook-group-fix\" style=\"font-size:13px;text-align:left;direction:ltr;display:inline-block;vertical-align:middle;width:100%;\"><table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" style=\"vertical-align:middle;\" width=\"100%\"><tr><td align=\"center\" style=\"font-size:0px;padding:35px;word-break:break-word;\"><div style=\"font-family:Arial, Helvetica, sans-serif;font-size:20px;line-height:1;text-align:center;color:#333333;\">{{ project_name }} - Password Recovery</div></td></tr><tr><td align=\"center\" style=\"font-size:0px;padding:10px 25px;padding-right:25px;padding-left:25px;word-break:break-word;\"><div style=\"font-family:Arial, Helvetica, sans-serif;font-size:16px;line-height:1;text-align:center;color:#555555;\"><span>Hello {{ username }}</span></div></td></tr><tr><td align=\"center\" style=\"font-size:0px;padding:10px 25px;padding-right:25px;padding-left:25px;word-break:break-word;\"><div style=\"font-family:Arial, Helvetica, sans-serif;font-size:16px;line-height:1;text-align:center;color:#555555;\">We've received a request to reset your password. You can do it by clicking the button below:</div></td></tr><tr><td align=\"center\" vertical-align=\"middle\" style=\"font-size:0px;padding:15px 30px;word-break:break-word;\"><table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" style=\"border-collapse:separate;line-height:100%;\"><tr><td align=\"center\" bgcolor=\"#009688\" role=\"presentation\" style=\"border:none;border-radius:8px;cursor:auto;padding:10px 25px;background:#009688;\" valign=\"middle\"><a href=\"{{ link }}\" style=\"background:#009688;color:#ffffff;font-family:Ubuntu, Helvetica, Arial, sans-serif;font-size:18px;font-weight:normal;line-height:120%;Margin:0;text-decoration:none;text-transform:none;\" target=\"_blank\">Reset password</a></td></tr></table></td></tr><tr><td align=\"center\" style=\"font-size:0px;padding:10px 25px;padding-right:25px;padding-left:25px;word-break:break-word;\"><div style=\"font-family:Arial, Helvetica, sans-serif;font-size:16px;line-height:1;text-align:center;color:#555555;\">Or copy and paste the following link into your browser:</div></td></tr><tr><td align=\"center\" style=\"font-size:0px;padding:10px 25px;padding-right:25px;padding-left:25px;word-break:break-word;\"><div style=\"font-family:Arial, Helvetica, sans-serif;font-size:16px;line-height:1;text-align:center;color:#555555;\"><a href=\"{{ link }}\">{{ link }}</a></div></td></tr><tr><td align=\"center\" style=\"font-size:0px;padding:10px 25px;padding-right:25px;padding-left:25px;word-break:break-word;\"><div style=\"font-family:Arial, Helvetica, sans-serif;font-size:16px;line-height:1;text-align:center;color:#555555;\">This password will expire in {{ valid_hours }} hours.</div></td></tr><tr><td style=\"font-size:0px;padding:10px 25px;word-break:break-word;\"><p style=\"border-top:solid 2px #cccccc;font-size:1;margin:0px auto;width:100%;\"></p><!--[if mso | IE]><table align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"border-top:solid 2px #cccccc;font-size:1;margin:0px auto;width:510px;\" role=\"presentation\" width=\"510px\" ><tr><td style=\"height:0;line-height:0;\"> &nbsp;\n</td></tr></table><![endif]--></td></tr><tr><td align=\"center\" style=\"font-size:0px;padding:10px 25px;padding-right:25px;padding-left:25px;word-break:break-word;\"><div style=\"font-family:Arial, Helvetica, sans-serif;font-size:14px;line-height:1;text-align:center;color:#555555;\">If you didn't request a password recovery you can disregard this email.</div></td></tr></table></div><!--[if mso | IE]></td></tr></table><![endif]--></td></tr></tbody></table></div><!--[if mso | IE]></td></tr></table><![endif]--></div></body></html>"
  },
  {
    "path": "backend/app/email-templates/build/test_email.html",
    "content": "<!doctype html><html xmlns=\"http://www.w3.org/1999/xhtml\" xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:o=\"urn:schemas-microsoft-com:office:office\"><head><title></title><!--[if !mso]><!-- --><meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\"><!--<![endif]--><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"><meta name=\"viewport\" content=\"width=device-width,initial-scale=1\"><style type=\"text/css\">#outlook a { padding:0; }\n          .ReadMsgBody { width:100%; }\n          .ExternalClass { width:100%; }\n          .ExternalClass * { line-height:100%; }\n          body { margin:0;padding:0;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%; }\n          table, td { border-collapse:collapse;mso-table-lspace:0pt;mso-table-rspace:0pt; }\n          img { border:0;height:auto;line-height:100%; outline:none;text-decoration:none;-ms-interpolation-mode:bicubic; }\n          p { display:block;margin:13px 0; }</style><!--[if !mso]><!--><style type=\"text/css\">@media only screen and (max-width:480px) {\n            @-ms-viewport { width:320px; }\n            @viewport { width:320px; }\n          }</style><!--<![endif]--><!--[if mso]>\n        <xml>\n        <o:OfficeDocumentSettings>\n          <o:AllowPNG/>\n          <o:PixelsPerInch>96</o:PixelsPerInch>\n        </o:OfficeDocumentSettings>\n        </xml>\n        <![endif]--><!--[if lte mso 11]>\n        <style type=\"text/css\">\n          .outlook-group-fix { width:100% !important; }\n        </style>\n        <![endif]--><style type=\"text/css\">@media only screen and (min-width:480px) {\n        .mj-column-per-100 { width:100% !important; max-width: 100%; }\n      }</style><style type=\"text/css\"></style></head><body style=\"background-color:#fafbfc;\"><div style=\"background-color:#fafbfc;\"><!--[if mso | IE]><table align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"\" style=\"width:600px;\" width=\"600\" ><tr><td style=\"line-height:0px;font-size:0px;mso-line-height-rule:exactly;\"><![endif]--><div style=\"background:#ffffff;background-color:#ffffff;Margin:0px auto;max-width:600px;\"><table align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" style=\"background:#ffffff;background-color:#ffffff;width:100%;\"><tbody><tr><td style=\"direction:ltr;font-size:0px;padding:40px 20px;text-align:center;vertical-align:top;\"><!--[if mso | IE]><table role=\"presentation\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr><td class=\"\" style=\"vertical-align:middle;width:560px;\" ><![endif]--><div class=\"mj-column-per-100 outlook-group-fix\" style=\"font-size:13px;text-align:left;direction:ltr;display:inline-block;vertical-align:middle;width:100%;\"><table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" style=\"vertical-align:middle;\" width=\"100%\"><tr><td align=\"center\" style=\"font-size:0px;padding:35px;word-break:break-word;\"><div style=\"font-family:Arial, Helvetica, sans-serif;font-size:20px;line-height:1;text-align:center;color:#333333;\">{{ project_name }}</div></td></tr><tr><td align=\"center\" style=\"font-size:0px;padding:10px 25px;padding-right:25px;padding-left:25px;word-break:break-word;\"><div style=\"font-family:, sans-serif;font-size:16px;line-height:1;text-align:center;color:#555555;\"><span>Test email for: {{ email }}</span></div></td></tr><tr><td style=\"font-size:0px;padding:10px 25px;word-break:break-word;\"><p style=\"border-top:solid 2px #cccccc;font-size:1;margin:0px auto;width:100%;\"></p><!--[if mso | IE]><table align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"border-top:solid 2px #cccccc;font-size:1;margin:0px auto;width:510px;\" role=\"presentation\" width=\"510px\" ><tr><td style=\"height:0;line-height:0;\"> &nbsp;\n</td></tr></table><![endif]--></td></tr></table></div><!--[if mso | IE]></td></tr></table><![endif]--></td></tr></tbody></table></div><!--[if mso | IE]></td></tr></table><![endif]--></div></body></html>"
  },
  {
    "path": "backend/app/email-templates/src/new_account.mjml",
    "content": "<mjml>\n  <mj-body background-color=\"#fafbfc\">\n    <mj-section background-color=\"#fff\" padding=\"40px 20px\">\n      <mj-column vertical-align=\"middle\" width=\"100%\">\n        <mj-text align=\"center\" padding=\"35px\" font-size=\"20px\" color=\"#333\">{{ project_name }} - New Account</mj-text>\n        <mj-text align=\"center\" font-size=\"16px\" padding-left=\"25px\" padding-right=\"25px\" font-family=\"Arial, Helvetica, sans-serif\" color=\"#555\"><span>Welcome to your new account!</span></mj-text>\n        <mj-text align=\"center\" font-size=\"16px\" padding-left=\"25px\" padding-right=\"25px\" font-family=\"Arial, Helvetica, sans-serif\" color=\"#555\">Here are your account details:</mj-text>\n        <mj-text align=\"center\" font-size=\"16px\" padding-left=\"25px\" padding-right=\"25px\" font-family=\"Arial, Helvetica, sans-serif\" color=\"#555\">Username: {{ username }}</mj-text>\n        <mj-text align=\"center\" font-size=\"16px\" padding-left=\"25px\" padding-right=\"25px\" font-family=\"Arial, Helvetica, sans-serif\" color=\"#555\">Password: {{ password }}</mj-text>\n        <mj-button align=\"center\" font-size=\"18px\" background-color=\"#009688\" border-radius=\"8px\" color=\"#fff\" href=\"{{ link }}\" padding=\"15px 30px\">Go to Dashboard</mj-button>\n        <mj-divider border-color=\"#ccc\" border-width=\"2px\"></mj-divider>\n      </mj-column>\n    </mj-section>\n  </mj-body>\n</mjml>\n"
  },
  {
    "path": "backend/app/email-templates/src/reset_password.mjml",
    "content": "<mjml>\n  <mj-body background-color=\"#fafbfc\">\n    <mj-section background-color=\"#fff\" padding=\"40px 20px\">\n      <mj-column vertical-align=\"middle\" width=\"100%\">\n        <mj-text align=\"center\" padding=\"35px\" font-size=\"20px\" font-family=\"Arial, Helvetica, sans-serif\" color=\"#333\">{{ project_name }} - Password Recovery</mj-text>\n        <mj-text align=\"center\" font-size=\"16px\" padding-left=\"25px\" padding-right=\"25px\" font-family=\"Arial, Helvetica, sans-serif\" color=\"#555\"><span>Hello {{ username }}</span></mj-text>\n        <mj-text align=\"center\" font-size=\"16px\" padding-left=\"25px\" padding-right=\"25px\" font-family=\"Arial, Helvetica, sans-serif\" color=\"#555\">We've received a request to reset your password. You can do it by clicking the button below:</mj-text>\n        <mj-button align=\"center\" font-size=\"18px\" background-color=\"#009688\" border-radius=\"8px\" color=\"#fff\" href=\"{{ link }}\" padding=\"15px 30px\">Reset password</mj-button>\n        <mj-text align=\"center\" font-size=\"16px\" padding-left=\"25px\" padding-right=\"25px\" font-family=\"Arial, Helvetica, sans-serif\" color=\"#555\">Or copy and paste the following link into your browser:</mj-text>\n        <mj-text align=\"center\" font-size=\"16px\" padding-left=\"25px\" padding-right=\"25px\" font-family=\"Arial, Helvetica, sans-serif\" color=\"#555\"><a href=\"{{ link }}\">{{ link }}</a></mj-text>\n        <mj-text align=\"center\" font-size=\"16px\" padding-left=\"25px\" padding-right=\"25px\" font-family=\"Arial, Helvetica, sans-serif\" color=\"#555\">This password will expire in {{ valid_hours }} hours.</mj-text>\n        <mj-divider border-color=\"#ccc\" border-width=\"2px\"></mj-divider>\n        <mj-text align=\"center\" font-size=\"14px\" padding-left=\"25px\" padding-right=\"25px\" font-family=\"Arial, Helvetica, sans-serif\" color=\"#555\">If you didn't request a password recovery you can disregard this email.</mj-text>\n      </mj-column>\n    </mj-section>\n  </mj-body>\n</mjml>\n"
  },
  {
    "path": "backend/app/email-templates/src/test_email.mjml",
    "content": "<mjml>\n  <mj-body background-color=\"#fafbfc\">\n    <mj-section background-color=\"#fff\" padding=\"40px 20px\">\n      <mj-column vertical-align=\"middle\" width=\"100%\">\n        <mj-text align=\"center\" padding=\"35px\" font-size=\"20px\" font-family=\"Arial, Helvetica, sans-serif\" color=\"#333\">{{ project_name }}</mj-text>\n        <mj-text align=\"center\" font-size=\"16px\" padding-left=\"25px\" padding-right=\"25px\" font-family=\", sans-serif\" color=\"#555\"><span>Test email for: {{ email }}</span></mj-text>\n        <mj-divider border-color=\"#ccc\" border-width=\"2px\"></mj-divider>\n      </mj-column>\n    </mj-section>\n  </mj-body>\n</mjml>\n"
  },
  {
    "path": "backend/app/initial_data.py",
    "content": "import logging\n\nfrom sqlmodel import Session\n\nfrom app.core.db import engine, init_db\n\nlogging.basicConfig(level=logging.INFO)\nlogger = logging.getLogger(__name__)\n\n\ndef init() -> None:\n    with Session(engine) as session:\n        init_db(session)\n\n\ndef main() -> None:\n    logger.info(\"Creating initial data\")\n    init()\n    logger.info(\"Initial data created\")\n\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "backend/app/main.py",
    "content": "import sentry_sdk\nfrom fastapi import FastAPI\nfrom fastapi.routing import APIRoute\nfrom starlette.middleware.cors import CORSMiddleware\n\nfrom app.api.main import api_router\nfrom app.core.config import settings\n\n\ndef custom_generate_unique_id(route: APIRoute) -> str:\n    return f\"{route.tags[0]}-{route.name}\"\n\n\nif settings.SENTRY_DSN and settings.ENVIRONMENT != \"local\":\n    sentry_sdk.init(dsn=str(settings.SENTRY_DSN), enable_tracing=True)\n\napp = FastAPI(\n    title=settings.PROJECT_NAME,\n    openapi_url=f\"{settings.API_V1_STR}/openapi.json\",\n    generate_unique_id_function=custom_generate_unique_id,\n)\n\n# Set all CORS enabled origins\nif settings.all_cors_origins:\n    app.add_middleware(\n        CORSMiddleware,\n        allow_origins=settings.all_cors_origins,\n        allow_credentials=True,\n        allow_methods=[\"*\"],\n        allow_headers=[\"*\"],\n    )\n\napp.include_router(api_router, prefix=settings.API_V1_STR)\n"
  },
  {
    "path": "backend/app/models.py",
    "content": "import uuid\nfrom datetime import datetime, timezone\n\nfrom pydantic import EmailStr\nfrom sqlalchemy import DateTime\nfrom sqlmodel import Field, Relationship, SQLModel\n\n\ndef get_datetime_utc() -> datetime:\n    return datetime.now(timezone.utc)\n\n\n# Shared properties\nclass UserBase(SQLModel):\n    email: EmailStr = Field(unique=True, index=True, max_length=255)\n    is_active: bool = True\n    is_superuser: bool = False\n    full_name: str | None = Field(default=None, max_length=255)\n\n\n# Properties to receive via API on creation\nclass UserCreate(UserBase):\n    password: str = Field(min_length=8, max_length=128)\n\n\nclass UserRegister(SQLModel):\n    email: EmailStr = Field(max_length=255)\n    password: str = Field(min_length=8, max_length=128)\n    full_name: str | None = Field(default=None, max_length=255)\n\n\n# Properties to receive via API on update, all are optional\nclass UserUpdate(UserBase):\n    email: EmailStr | None = Field(default=None, max_length=255)  # type: ignore\n    password: str | None = Field(default=None, min_length=8, max_length=128)\n\n\nclass UserUpdateMe(SQLModel):\n    full_name: str | None = Field(default=None, max_length=255)\n    email: EmailStr | None = Field(default=None, max_length=255)\n\n\nclass UpdatePassword(SQLModel):\n    current_password: str = Field(min_length=8, max_length=128)\n    new_password: str = Field(min_length=8, max_length=128)\n\n\n# Database model, database table inferred from class name\nclass User(UserBase, table=True):\n    id: uuid.UUID = Field(default_factory=uuid.uuid4, primary_key=True)\n    hashed_password: str\n    created_at: datetime | None = Field(\n        default_factory=get_datetime_utc,\n        sa_type=DateTime(timezone=True),  # type: ignore\n    )\n    items: list[\"Item\"] = Relationship(back_populates=\"owner\", cascade_delete=True)\n\n\n# Properties to return via API, id is always required\nclass UserPublic(UserBase):\n    id: uuid.UUID\n    created_at: datetime | None = None\n\n\nclass UsersPublic(SQLModel):\n    data: list[UserPublic]\n    count: int\n\n\n# Shared properties\nclass ItemBase(SQLModel):\n    title: str = Field(min_length=1, max_length=255)\n    description: str | None = Field(default=None, max_length=255)\n\n\n# Properties to receive on item creation\nclass ItemCreate(ItemBase):\n    pass\n\n\n# Properties to receive on item update\nclass ItemUpdate(ItemBase):\n    title: str | None = Field(default=None, min_length=1, max_length=255)  # type: ignore\n\n\n# Database model, database table inferred from class name\nclass Item(ItemBase, table=True):\n    id: uuid.UUID = Field(default_factory=uuid.uuid4, primary_key=True)\n    created_at: datetime | None = Field(\n        default_factory=get_datetime_utc,\n        sa_type=DateTime(timezone=True),  # type: ignore\n    )\n    owner_id: uuid.UUID = Field(\n        foreign_key=\"user.id\", nullable=False, ondelete=\"CASCADE\"\n    )\n    owner: User | None = Relationship(back_populates=\"items\")\n\n\n# Properties to return via API, id is always required\nclass ItemPublic(ItemBase):\n    id: uuid.UUID\n    owner_id: uuid.UUID\n    created_at: datetime | None = None\n\n\nclass ItemsPublic(SQLModel):\n    data: list[ItemPublic]\n    count: int\n\n\n# Generic message\nclass Message(SQLModel):\n    message: str\n\n\n# JSON payload containing access token\nclass Token(SQLModel):\n    access_token: str\n    token_type: str = \"bearer\"\n\n\n# Contents of JWT token\nclass TokenPayload(SQLModel):\n    sub: str | None = None\n\n\nclass NewPassword(SQLModel):\n    token: str\n    new_password: str = Field(min_length=8, max_length=128)\n"
  },
  {
    "path": "backend/app/tests_pre_start.py",
    "content": "import logging\n\nfrom sqlalchemy import Engine\nfrom sqlmodel import Session, select\nfrom tenacity import after_log, before_log, retry, stop_after_attempt, wait_fixed\n\nfrom app.core.db import engine\n\nlogging.basicConfig(level=logging.INFO)\nlogger = logging.getLogger(__name__)\n\nmax_tries = 60 * 5  # 5 minutes\nwait_seconds = 1\n\n\n@retry(\n    stop=stop_after_attempt(max_tries),\n    wait=wait_fixed(wait_seconds),\n    before=before_log(logger, logging.INFO),\n    after=after_log(logger, logging.WARN),\n)\ndef init(db_engine: Engine) -> None:\n    try:\n        # Try to create session to check if DB is awake\n        with Session(db_engine) as session:\n            session.exec(select(1))\n    except Exception as e:\n        logger.error(e)\n        raise e\n\n\ndef main() -> None:\n    logger.info(\"Initializing service\")\n    init(engine)\n    logger.info(\"Service finished initializing\")\n\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "backend/app/utils.py",
    "content": "import logging\nfrom dataclasses import dataclass\nfrom datetime import datetime, timedelta, timezone\nfrom pathlib import Path\nfrom typing import Any\n\nimport emails  # type: ignore\nimport jwt\nfrom jinja2 import Template\nfrom jwt.exceptions import InvalidTokenError\n\nfrom app.core import security\nfrom app.core.config import settings\n\nlogging.basicConfig(level=logging.INFO)\nlogger = logging.getLogger(__name__)\n\n\n@dataclass\nclass EmailData:\n    html_content: str\n    subject: str\n\n\ndef render_email_template(*, template_name: str, context: dict[str, Any]) -> str:\n    template_str = (\n        Path(__file__).parent / \"email-templates\" / \"build\" / template_name\n    ).read_text()\n    html_content = Template(template_str).render(context)\n    return html_content\n\n\ndef send_email(\n    *,\n    email_to: str,\n    subject: str = \"\",\n    html_content: str = \"\",\n) -> None:\n    assert settings.emails_enabled, \"no provided configuration for email variables\"\n    message = emails.Message(\n        subject=subject,\n        html=html_content,\n        mail_from=(settings.EMAILS_FROM_NAME, settings.EMAILS_FROM_EMAIL),\n    )\n    smtp_options = {\"host\": settings.SMTP_HOST, \"port\": settings.SMTP_PORT}\n    if settings.SMTP_TLS:\n        smtp_options[\"tls\"] = True\n    elif settings.SMTP_SSL:\n        smtp_options[\"ssl\"] = True\n    if settings.SMTP_USER:\n        smtp_options[\"user\"] = settings.SMTP_USER\n    if settings.SMTP_PASSWORD:\n        smtp_options[\"password\"] = settings.SMTP_PASSWORD\n    response = message.send(to=email_to, smtp=smtp_options)\n    logger.info(f\"send email result: {response}\")\n\n\ndef generate_test_email(email_to: str) -> EmailData:\n    project_name = settings.PROJECT_NAME\n    subject = f\"{project_name} - Test email\"\n    html_content = render_email_template(\n        template_name=\"test_email.html\",\n        context={\"project_name\": settings.PROJECT_NAME, \"email\": email_to},\n    )\n    return EmailData(html_content=html_content, subject=subject)\n\n\ndef generate_reset_password_email(email_to: str, email: str, token: str) -> EmailData:\n    project_name = settings.PROJECT_NAME\n    subject = f\"{project_name} - Password recovery for user {email}\"\n    link = f\"{settings.FRONTEND_HOST}/reset-password?token={token}\"\n    html_content = render_email_template(\n        template_name=\"reset_password.html\",\n        context={\n            \"project_name\": settings.PROJECT_NAME,\n            \"username\": email,\n            \"email\": email_to,\n            \"valid_hours\": settings.EMAIL_RESET_TOKEN_EXPIRE_HOURS,\n            \"link\": link,\n        },\n    )\n    return EmailData(html_content=html_content, subject=subject)\n\n\ndef generate_new_account_email(\n    email_to: str, username: str, password: str\n) -> EmailData:\n    project_name = settings.PROJECT_NAME\n    subject = f\"{project_name} - New account for user {username}\"\n    html_content = render_email_template(\n        template_name=\"new_account.html\",\n        context={\n            \"project_name\": settings.PROJECT_NAME,\n            \"username\": username,\n            \"password\": password,\n            \"email\": email_to,\n            \"link\": settings.FRONTEND_HOST,\n        },\n    )\n    return EmailData(html_content=html_content, subject=subject)\n\n\ndef generate_password_reset_token(email: str) -> str:\n    delta = timedelta(hours=settings.EMAIL_RESET_TOKEN_EXPIRE_HOURS)\n    now = datetime.now(timezone.utc)\n    expires = now + delta\n    exp = expires.timestamp()\n    encoded_jwt = jwt.encode(\n        {\"exp\": exp, \"nbf\": now, \"sub\": email},\n        settings.SECRET_KEY,\n        algorithm=security.ALGORITHM,\n    )\n    return encoded_jwt\n\n\ndef verify_password_reset_token(token: str) -> str | None:\n    try:\n        decoded_token = jwt.decode(\n            token, settings.SECRET_KEY, algorithms=[security.ALGORITHM]\n        )\n        return str(decoded_token[\"sub\"])\n    except InvalidTokenError:\n        return None\n"
  },
  {
    "path": "backend/pyproject.toml",
    "content": "[project]\nname = \"app\"\nversion = \"0.1.0\"\ndescription = \"\"\nrequires-python = \">=3.10,<4.0\"\ndependencies = [\n    \"fastapi[standard]<1.0.0,>=0.114.2\",\n    \"python-multipart<1.0.0,>=0.0.7\",\n    \"email-validator<3.0.0.0,>=2.1.0.post1\",\n    \"tenacity<9.0.0,>=8.2.3\",\n    \"pydantic>2.0\",\n    \"emails<1.0,>=0.6\",\n    \"jinja2<4.0.0,>=3.1.4\",\n    \"alembic<2.0.0,>=1.12.1\",\n    \"httpx<1.0.0,>=0.25.1\",\n    \"psycopg[binary]<4.0.0,>=3.1.13\",\n    \"sqlmodel<1.0.0,>=0.0.21\",\n    \"pydantic-settings<3.0.0,>=2.2.1\",\n    \"sentry-sdk[fastapi]>=2.0.0,<3.0.0\",\n    \"pyjwt<3.0.0,>=2.8.0\",\n    \"pwdlib[argon2,bcrypt]>=0.3.0\",\n]\n\n[dependency-groups]\ndev = [\n    \"pytest<8.0.0,>=7.4.3\",\n    \"mypy<2.0.0,>=1.8.0\",\n    \"ruff<1.0.0,>=0.2.2\",\n    \"prek>=0.2.24,<1.0.0\",\n    \"coverage<8.0.0,>=7.4.3\",\n]\n\n[build-system]\nrequires = [\"hatchling\"]\nbuild-backend = \"hatchling.build\"\n\n[tool.mypy]\nstrict = true\nexclude = [\"venv\", \".venv\", \"alembic\"]\n\n[tool.ruff]\ntarget-version = \"py310\"\nexclude = [\"alembic\"]\n\n[tool.ruff.lint]\nselect = [\n    \"E\",  # pycodestyle errors\n    \"W\",  # pycodestyle warnings\n    \"F\",  # pyflakes\n    \"I\",  # isort\n    \"B\",  # flake8-bugbear\n    \"C4\",  # flake8-comprehensions\n    \"UP\",  # pyupgrade\n    \"ARG001\", # unused arguments in functions\n    \"T201\",   # print statements are not allowed\n]\nignore = [\n    \"E501\",  # line too long, handled by black\n    \"B008\",  # do not perform function calls in argument defaults\n    \"W191\",  # indentation contains tabs\n    \"B904\",  # Allow raising exceptions without from e, for HTTPException\n]\n\n[tool.ruff.lint.pyupgrade]\n# Preserve types, even if a file imports `from __future__ import annotations`.\nkeep-runtime-typing = true\n\n[tool.coverage.run]\nsource = [\"app\"]\ndynamic_context = \"test_function\"\n\n[tool.coverage.report]\nshow_missing = true\nsort = \"-Cover\"\n\n[tool.coverage.html]\nshow_contexts = true\n"
  },
  {
    "path": "backend/scripts/format.sh",
    "content": "#!/bin/sh -e\nset -x\n\nruff check app scripts --fix\nruff format app scripts\n"
  },
  {
    "path": "backend/scripts/lint.sh",
    "content": "#!/usr/bin/env bash\n\nset -e\nset -x\n\nmypy app\nruff check app\nruff format app --check\n"
  },
  {
    "path": "backend/scripts/prestart.sh",
    "content": "#! /usr/bin/env bash\n\nset -e\nset -x\n\n# Let the DB start\npython app/backend_pre_start.py\n\n# Run migrations\nalembic upgrade head\n\n# Create initial data in DB\npython app/initial_data.py\n"
  },
  {
    "path": "backend/scripts/test.sh",
    "content": "#!/usr/bin/env bash\n\nset -e\nset -x\n\ncoverage run -m pytest tests/\ncoverage report\ncoverage html --title \"${@-coverage}\"\n"
  },
  {
    "path": "backend/scripts/tests-start.sh",
    "content": "#! /usr/bin/env bash\nset -e\nset -x\n\npython app/tests_pre_start.py\n\nbash scripts/test.sh \"$@\"\n"
  },
  {
    "path": "backend/tests/__init__.py",
    "content": ""
  },
  {
    "path": "backend/tests/api/__init__.py",
    "content": ""
  },
  {
    "path": "backend/tests/api/routes/__init__.py",
    "content": ""
  },
  {
    "path": "backend/tests/api/routes/test_items.py",
    "content": "import uuid\n\nfrom fastapi.testclient import TestClient\nfrom sqlmodel import Session\n\nfrom app.core.config import settings\nfrom tests.utils.item import create_random_item\n\n\ndef test_create_item(\n    client: TestClient, superuser_token_headers: dict[str, str]\n) -> None:\n    data = {\"title\": \"Foo\", \"description\": \"Fighters\"}\n    response = client.post(\n        f\"{settings.API_V1_STR}/items/\",\n        headers=superuser_token_headers,\n        json=data,\n    )\n    assert response.status_code == 200\n    content = response.json()\n    assert content[\"title\"] == data[\"title\"]\n    assert content[\"description\"] == data[\"description\"]\n    assert \"id\" in content\n    assert \"owner_id\" in content\n\n\ndef test_read_item(\n    client: TestClient, superuser_token_headers: dict[str, str], db: Session\n) -> None:\n    item = create_random_item(db)\n    response = client.get(\n        f\"{settings.API_V1_STR}/items/{item.id}\",\n        headers=superuser_token_headers,\n    )\n    assert response.status_code == 200\n    content = response.json()\n    assert content[\"title\"] == item.title\n    assert content[\"description\"] == item.description\n    assert content[\"id\"] == str(item.id)\n    assert content[\"owner_id\"] == str(item.owner_id)\n\n\ndef test_read_item_not_found(\n    client: TestClient, superuser_token_headers: dict[str, str]\n) -> None:\n    response = client.get(\n        f\"{settings.API_V1_STR}/items/{uuid.uuid4()}\",\n        headers=superuser_token_headers,\n    )\n    assert response.status_code == 404\n    content = response.json()\n    assert content[\"detail\"] == \"Item not found\"\n\n\ndef test_read_item_not_enough_permissions(\n    client: TestClient, normal_user_token_headers: dict[str, str], db: Session\n) -> None:\n    item = create_random_item(db)\n    response = client.get(\n        f\"{settings.API_V1_STR}/items/{item.id}\",\n        headers=normal_user_token_headers,\n    )\n    assert response.status_code == 403\n    content = response.json()\n    assert content[\"detail\"] == \"Not enough permissions\"\n\n\ndef test_read_items(\n    client: TestClient, superuser_token_headers: dict[str, str], db: Session\n) -> None:\n    create_random_item(db)\n    create_random_item(db)\n    response = client.get(\n        f\"{settings.API_V1_STR}/items/\",\n        headers=superuser_token_headers,\n    )\n    assert response.status_code == 200\n    content = response.json()\n    assert len(content[\"data\"]) >= 2\n\n\ndef test_update_item(\n    client: TestClient, superuser_token_headers: dict[str, str], db: Session\n) -> None:\n    item = create_random_item(db)\n    data = {\"title\": \"Updated title\", \"description\": \"Updated description\"}\n    response = client.put(\n        f\"{settings.API_V1_STR}/items/{item.id}\",\n        headers=superuser_token_headers,\n        json=data,\n    )\n    assert response.status_code == 200\n    content = response.json()\n    assert content[\"title\"] == data[\"title\"]\n    assert content[\"description\"] == data[\"description\"]\n    assert content[\"id\"] == str(item.id)\n    assert content[\"owner_id\"] == str(item.owner_id)\n\n\ndef test_update_item_not_found(\n    client: TestClient, superuser_token_headers: dict[str, str]\n) -> None:\n    data = {\"title\": \"Updated title\", \"description\": \"Updated description\"}\n    response = client.put(\n        f\"{settings.API_V1_STR}/items/{uuid.uuid4()}\",\n        headers=superuser_token_headers,\n        json=data,\n    )\n    assert response.status_code == 404\n    content = response.json()\n    assert content[\"detail\"] == \"Item not found\"\n\n\ndef test_update_item_not_enough_permissions(\n    client: TestClient, normal_user_token_headers: dict[str, str], db: Session\n) -> None:\n    item = create_random_item(db)\n    data = {\"title\": \"Updated title\", \"description\": \"Updated description\"}\n    response = client.put(\n        f\"{settings.API_V1_STR}/items/{item.id}\",\n        headers=normal_user_token_headers,\n        json=data,\n    )\n    assert response.status_code == 403\n    content = response.json()\n    assert content[\"detail\"] == \"Not enough permissions\"\n\n\ndef test_delete_item(\n    client: TestClient, superuser_token_headers: dict[str, str], db: Session\n) -> None:\n    item = create_random_item(db)\n    response = client.delete(\n        f\"{settings.API_V1_STR}/items/{item.id}\",\n        headers=superuser_token_headers,\n    )\n    assert response.status_code == 200\n    content = response.json()\n    assert content[\"message\"] == \"Item deleted successfully\"\n\n\ndef test_delete_item_not_found(\n    client: TestClient, superuser_token_headers: dict[str, str]\n) -> None:\n    response = client.delete(\n        f\"{settings.API_V1_STR}/items/{uuid.uuid4()}\",\n        headers=superuser_token_headers,\n    )\n    assert response.status_code == 404\n    content = response.json()\n    assert content[\"detail\"] == \"Item not found\"\n\n\ndef test_delete_item_not_enough_permissions(\n    client: TestClient, normal_user_token_headers: dict[str, str], db: Session\n) -> None:\n    item = create_random_item(db)\n    response = client.delete(\n        f\"{settings.API_V1_STR}/items/{item.id}\",\n        headers=normal_user_token_headers,\n    )\n    assert response.status_code == 403\n    content = response.json()\n    assert content[\"detail\"] == \"Not enough permissions\"\n"
  },
  {
    "path": "backend/tests/api/routes/test_login.py",
    "content": "from unittest.mock import patch\n\nfrom fastapi.testclient import TestClient\nfrom pwdlib.hashers.bcrypt import BcryptHasher\nfrom sqlmodel import Session\n\nfrom app.core.config import settings\nfrom app.core.security import get_password_hash, verify_password\nfrom app.crud import create_user\nfrom app.models import User, UserCreate\nfrom app.utils import generate_password_reset_token\nfrom tests.utils.user import user_authentication_headers\nfrom tests.utils.utils import random_email, random_lower_string\n\n\ndef test_get_access_token(client: TestClient) -> None:\n    login_data = {\n        \"username\": settings.FIRST_SUPERUSER,\n        \"password\": settings.FIRST_SUPERUSER_PASSWORD,\n    }\n    r = client.post(f\"{settings.API_V1_STR}/login/access-token\", data=login_data)\n    tokens = r.json()\n    assert r.status_code == 200\n    assert \"access_token\" in tokens\n    assert tokens[\"access_token\"]\n\n\ndef test_get_access_token_incorrect_password(client: TestClient) -> None:\n    login_data = {\n        \"username\": settings.FIRST_SUPERUSER,\n        \"password\": \"incorrect\",\n    }\n    r = client.post(f\"{settings.API_V1_STR}/login/access-token\", data=login_data)\n    assert r.status_code == 400\n\n\ndef test_use_access_token(\n    client: TestClient, superuser_token_headers: dict[str, str]\n) -> None:\n    r = client.post(\n        f\"{settings.API_V1_STR}/login/test-token\",\n        headers=superuser_token_headers,\n    )\n    result = r.json()\n    assert r.status_code == 200\n    assert \"email\" in result\n\n\ndef test_recovery_password(\n    client: TestClient, normal_user_token_headers: dict[str, str]\n) -> None:\n    with (\n        patch(\"app.core.config.settings.SMTP_HOST\", \"smtp.example.com\"),\n        patch(\"app.core.config.settings.SMTP_USER\", \"admin@example.com\"),\n    ):\n        email = \"test@example.com\"\n        r = client.post(\n            f\"{settings.API_V1_STR}/password-recovery/{email}\",\n            headers=normal_user_token_headers,\n        )\n        assert r.status_code == 200\n        assert r.json() == {\n            \"message\": \"If that email is registered, we sent a password recovery link\"\n        }\n\n\ndef test_recovery_password_user_not_exits(\n    client: TestClient, normal_user_token_headers: dict[str, str]\n) -> None:\n    email = \"jVgQr@example.com\"\n    r = client.post(\n        f\"{settings.API_V1_STR}/password-recovery/{email}\",\n        headers=normal_user_token_headers,\n    )\n    # Should return 200 with generic message to prevent email enumeration attacks\n    assert r.status_code == 200\n    assert r.json() == {\n        \"message\": \"If that email is registered, we sent a password recovery link\"\n    }\n\n\ndef test_reset_password(client: TestClient, db: Session) -> None:\n    email = random_email()\n    password = random_lower_string()\n    new_password = random_lower_string()\n\n    user_create = UserCreate(\n        email=email,\n        full_name=\"Test User\",\n        password=password,\n        is_active=True,\n        is_superuser=False,\n    )\n    user = create_user(session=db, user_create=user_create)\n    token = generate_password_reset_token(email=email)\n    headers = user_authentication_headers(client=client, email=email, password=password)\n    data = {\"new_password\": new_password, \"token\": token}\n\n    r = client.post(\n        f\"{settings.API_V1_STR}/reset-password/\",\n        headers=headers,\n        json=data,\n    )\n\n    assert r.status_code == 200\n    assert r.json() == {\"message\": \"Password updated successfully\"}\n\n    db.refresh(user)\n    verified, _ = verify_password(new_password, user.hashed_password)\n    assert verified\n\n\ndef test_reset_password_invalid_token(\n    client: TestClient, superuser_token_headers: dict[str, str]\n) -> None:\n    data = {\"new_password\": \"changethis\", \"token\": \"invalid\"}\n    r = client.post(\n        f\"{settings.API_V1_STR}/reset-password/\",\n        headers=superuser_token_headers,\n        json=data,\n    )\n    response = r.json()\n\n    assert \"detail\" in response\n    assert r.status_code == 400\n    assert response[\"detail\"] == \"Invalid token\"\n\n\ndef test_login_with_bcrypt_password_upgrades_to_argon2(\n    client: TestClient, db: Session\n) -> None:\n    \"\"\"Test that logging in with a bcrypt password hash upgrades it to argon2.\"\"\"\n    email = random_email()\n    password = random_lower_string()\n\n    # Create a bcrypt hash directly (simulating legacy password)\n    bcrypt_hasher = BcryptHasher()\n    bcrypt_hash = bcrypt_hasher.hash(password)\n    assert bcrypt_hash.startswith(\"$2\")  # bcrypt hashes start with $2\n\n    user = User(email=email, hashed_password=bcrypt_hash, is_active=True)\n    db.add(user)\n    db.commit()\n    db.refresh(user)\n\n    assert user.hashed_password.startswith(\"$2\")\n\n    login_data = {\"username\": email, \"password\": password}\n    r = client.post(f\"{settings.API_V1_STR}/login/access-token\", data=login_data)\n    assert r.status_code == 200\n    tokens = r.json()\n    assert \"access_token\" in tokens\n\n    db.refresh(user)\n\n    # Verify the hash was upgraded to argon2\n    assert user.hashed_password.startswith(\"$argon2\")\n\n    verified, updated_hash = verify_password(password, user.hashed_password)\n    assert verified\n    # Should not need another update since it's already argon2\n    assert updated_hash is None\n\n\ndef test_login_with_argon2_password_keeps_hash(client: TestClient, db: Session) -> None:\n    \"\"\"Test that logging in with an argon2 password hash does not update it.\"\"\"\n    email = random_email()\n    password = random_lower_string()\n\n    # Create an argon2 hash (current default)\n    argon2_hash = get_password_hash(password)\n    assert argon2_hash.startswith(\"$argon2\")\n\n    # Create user with argon2 hash\n    user = User(email=email, hashed_password=argon2_hash, is_active=True)\n    db.add(user)\n    db.commit()\n    db.refresh(user)\n\n    original_hash = user.hashed_password\n\n    login_data = {\"username\": email, \"password\": password}\n    r = client.post(f\"{settings.API_V1_STR}/login/access-token\", data=login_data)\n    assert r.status_code == 200\n    tokens = r.json()\n    assert \"access_token\" in tokens\n\n    db.refresh(user)\n\n    assert user.hashed_password == original_hash\n    assert user.hashed_password.startswith(\"$argon2\")\n"
  },
  {
    "path": "backend/tests/api/routes/test_private.py",
    "content": "from fastapi.testclient import TestClient\nfrom sqlmodel import Session, select\n\nfrom app.core.config import settings\nfrom app.models import User\n\n\ndef test_create_user(client: TestClient, db: Session) -> None:\n    r = client.post(\n        f\"{settings.API_V1_STR}/private/users/\",\n        json={\n            \"email\": \"pollo@listo.com\",\n            \"password\": \"password123\",\n            \"full_name\": \"Pollo Listo\",\n        },\n    )\n\n    assert r.status_code == 200\n\n    data = r.json()\n\n    user = db.exec(select(User).where(User.id == data[\"id\"])).first()\n\n    assert user\n    assert user.email == \"pollo@listo.com\"\n    assert user.full_name == \"Pollo Listo\"\n"
  },
  {
    "path": "backend/tests/api/routes/test_users.py",
    "content": "import uuid\nfrom unittest.mock import patch\n\nfrom fastapi.testclient import TestClient\nfrom sqlmodel import Session, select\n\nfrom app import crud\nfrom app.core.config import settings\nfrom app.core.security import verify_password\nfrom app.models import User, UserCreate\nfrom tests.utils.user import create_random_user\nfrom tests.utils.utils import random_email, random_lower_string\n\n\ndef test_get_users_superuser_me(\n    client: TestClient, superuser_token_headers: dict[str, str]\n) -> None:\n    r = client.get(f\"{settings.API_V1_STR}/users/me\", headers=superuser_token_headers)\n    current_user = r.json()\n    assert current_user\n    assert current_user[\"is_active\"] is True\n    assert current_user[\"is_superuser\"]\n    assert current_user[\"email\"] == settings.FIRST_SUPERUSER\n\n\ndef test_get_users_normal_user_me(\n    client: TestClient, normal_user_token_headers: dict[str, str]\n) -> None:\n    r = client.get(f\"{settings.API_V1_STR}/users/me\", headers=normal_user_token_headers)\n    current_user = r.json()\n    assert current_user\n    assert current_user[\"is_active\"] is True\n    assert current_user[\"is_superuser\"] is False\n    assert current_user[\"email\"] == settings.EMAIL_TEST_USER\n\n\ndef test_create_user_new_email(\n    client: TestClient, superuser_token_headers: dict[str, str], db: Session\n) -> None:\n    with (\n        patch(\"app.utils.send_email\", return_value=None),\n        patch(\"app.core.config.settings.SMTP_HOST\", \"smtp.example.com\"),\n        patch(\"app.core.config.settings.SMTP_USER\", \"admin@example.com\"),\n    ):\n        username = random_email()\n        password = random_lower_string()\n        data = {\"email\": username, \"password\": password}\n        r = client.post(\n            f\"{settings.API_V1_STR}/users/\",\n            headers=superuser_token_headers,\n            json=data,\n        )\n        assert 200 <= r.status_code < 300\n        created_user = r.json()\n        user = crud.get_user_by_email(session=db, email=username)\n        assert user\n        assert user.email == created_user[\"email\"]\n\n\ndef test_get_existing_user_as_superuser(\n    client: TestClient, superuser_token_headers: dict[str, str], db: Session\n) -> None:\n    username = random_email()\n    password = random_lower_string()\n    user_in = UserCreate(email=username, password=password)\n    user = crud.create_user(session=db, user_create=user_in)\n    user_id = user.id\n    r = client.get(\n        f\"{settings.API_V1_STR}/users/{user_id}\",\n        headers=superuser_token_headers,\n    )\n    assert 200 <= r.status_code < 300\n    api_user = r.json()\n    existing_user = crud.get_user_by_email(session=db, email=username)\n    assert existing_user\n    assert existing_user.email == api_user[\"email\"]\n\n\ndef test_get_non_existing_user_as_superuser(\n    client: TestClient, superuser_token_headers: dict[str, str]\n) -> None:\n    r = client.get(\n        f\"{settings.API_V1_STR}/users/{uuid.uuid4()}\",\n        headers=superuser_token_headers,\n    )\n    assert r.status_code == 404\n    assert r.json() == {\"detail\": \"User not found\"}\n\n\ndef test_get_existing_user_current_user(client: TestClient, db: Session) -> None:\n    username = random_email()\n    password = random_lower_string()\n    user_in = UserCreate(email=username, password=password)\n    user = crud.create_user(session=db, user_create=user_in)\n    user_id = user.id\n\n    login_data = {\n        \"username\": username,\n        \"password\": password,\n    }\n    r = client.post(f\"{settings.API_V1_STR}/login/access-token\", data=login_data)\n    tokens = r.json()\n    a_token = tokens[\"access_token\"]\n    headers = {\"Authorization\": f\"Bearer {a_token}\"}\n\n    r = client.get(\n        f\"{settings.API_V1_STR}/users/{user_id}\",\n        headers=headers,\n    )\n    assert 200 <= r.status_code < 300\n    api_user = r.json()\n    existing_user = crud.get_user_by_email(session=db, email=username)\n    assert existing_user\n    assert existing_user.email == api_user[\"email\"]\n\n\ndef test_get_existing_user_permissions_error(\n    db: Session,\n    client: TestClient,\n    normal_user_token_headers: dict[str, str],\n) -> None:\n    user = create_random_user(db)\n\n    r = client.get(\n        f\"{settings.API_V1_STR}/users/{user.id}\",\n        headers=normal_user_token_headers,\n    )\n    assert r.status_code == 403\n    assert r.json() == {\"detail\": \"The user doesn't have enough privileges\"}\n\n\ndef test_get_non_existing_user_permissions_error(\n    client: TestClient,\n    normal_user_token_headers: dict[str, str],\n) -> None:\n    user_id = uuid.uuid4()\n\n    r = client.get(\n        f\"{settings.API_V1_STR}/users/{user_id}\",\n        headers=normal_user_token_headers,\n    )\n    assert r.status_code == 403\n    assert r.json() == {\"detail\": \"The user doesn't have enough privileges\"}\n\n\ndef test_create_user_existing_username(\n    client: TestClient, superuser_token_headers: dict[str, str], db: Session\n) -> None:\n    username = random_email()\n    # username = email\n    password = random_lower_string()\n    user_in = UserCreate(email=username, password=password)\n    crud.create_user(session=db, user_create=user_in)\n    data = {\"email\": username, \"password\": password}\n    r = client.post(\n        f\"{settings.API_V1_STR}/users/\",\n        headers=superuser_token_headers,\n        json=data,\n    )\n    created_user = r.json()\n    assert r.status_code == 400\n    assert \"_id\" not in created_user\n\n\ndef test_create_user_by_normal_user(\n    client: TestClient, normal_user_token_headers: dict[str, str]\n) -> None:\n    username = random_email()\n    password = random_lower_string()\n    data = {\"email\": username, \"password\": password}\n    r = client.post(\n        f\"{settings.API_V1_STR}/users/\",\n        headers=normal_user_token_headers,\n        json=data,\n    )\n    assert r.status_code == 403\n\n\ndef test_retrieve_users(\n    client: TestClient, superuser_token_headers: dict[str, str], db: Session\n) -> None:\n    username = random_email()\n    password = random_lower_string()\n    user_in = UserCreate(email=username, password=password)\n    crud.create_user(session=db, user_create=user_in)\n\n    username2 = random_email()\n    password2 = random_lower_string()\n    user_in2 = UserCreate(email=username2, password=password2)\n    crud.create_user(session=db, user_create=user_in2)\n\n    r = client.get(f\"{settings.API_V1_STR}/users/\", headers=superuser_token_headers)\n    all_users = r.json()\n\n    assert len(all_users[\"data\"]) > 1\n    assert \"count\" in all_users\n    for item in all_users[\"data\"]:\n        assert \"email\" in item\n\n\ndef test_update_user_me(\n    client: TestClient, normal_user_token_headers: dict[str, str], db: Session\n) -> None:\n    full_name = \"Updated Name\"\n    email = random_email()\n    data = {\"full_name\": full_name, \"email\": email}\n    r = client.patch(\n        f\"{settings.API_V1_STR}/users/me\",\n        headers=normal_user_token_headers,\n        json=data,\n    )\n    assert r.status_code == 200\n    updated_user = r.json()\n    assert updated_user[\"email\"] == email\n    assert updated_user[\"full_name\"] == full_name\n\n    user_query = select(User).where(User.email == email)\n    user_db = db.exec(user_query).first()\n    assert user_db\n    assert user_db.email == email\n    assert user_db.full_name == full_name\n\n\ndef test_update_password_me(\n    client: TestClient, superuser_token_headers: dict[str, str], db: Session\n) -> None:\n    new_password = random_lower_string()\n    data = {\n        \"current_password\": settings.FIRST_SUPERUSER_PASSWORD,\n        \"new_password\": new_password,\n    }\n    r = client.patch(\n        f\"{settings.API_V1_STR}/users/me/password\",\n        headers=superuser_token_headers,\n        json=data,\n    )\n    assert r.status_code == 200\n    updated_user = r.json()\n    assert updated_user[\"message\"] == \"Password updated successfully\"\n\n    user_query = select(User).where(User.email == settings.FIRST_SUPERUSER)\n    user_db = db.exec(user_query).first()\n    assert user_db\n    assert user_db.email == settings.FIRST_SUPERUSER\n    verified, _ = verify_password(new_password, user_db.hashed_password)\n    assert verified\n\n    # Revert to the old password to keep consistency in test\n    old_data = {\n        \"current_password\": new_password,\n        \"new_password\": settings.FIRST_SUPERUSER_PASSWORD,\n    }\n    r = client.patch(\n        f\"{settings.API_V1_STR}/users/me/password\",\n        headers=superuser_token_headers,\n        json=old_data,\n    )\n    db.refresh(user_db)\n\n    assert r.status_code == 200\n    verified, _ = verify_password(\n        settings.FIRST_SUPERUSER_PASSWORD, user_db.hashed_password\n    )\n    assert verified\n\n\ndef test_update_password_me_incorrect_password(\n    client: TestClient, superuser_token_headers: dict[str, str]\n) -> None:\n    new_password = random_lower_string()\n    data = {\"current_password\": new_password, \"new_password\": new_password}\n    r = client.patch(\n        f\"{settings.API_V1_STR}/users/me/password\",\n        headers=superuser_token_headers,\n        json=data,\n    )\n    assert r.status_code == 400\n    updated_user = r.json()\n    assert updated_user[\"detail\"] == \"Incorrect password\"\n\n\ndef test_update_user_me_email_exists(\n    client: TestClient, normal_user_token_headers: dict[str, str], db: Session\n) -> None:\n    username = random_email()\n    password = random_lower_string()\n    user_in = UserCreate(email=username, password=password)\n    user = crud.create_user(session=db, user_create=user_in)\n\n    data = {\"email\": user.email}\n    r = client.patch(\n        f\"{settings.API_V1_STR}/users/me\",\n        headers=normal_user_token_headers,\n        json=data,\n    )\n    assert r.status_code == 409\n    assert r.json()[\"detail\"] == \"User with this email already exists\"\n\n\ndef test_update_password_me_same_password_error(\n    client: TestClient, superuser_token_headers: dict[str, str]\n) -> None:\n    data = {\n        \"current_password\": settings.FIRST_SUPERUSER_PASSWORD,\n        \"new_password\": settings.FIRST_SUPERUSER_PASSWORD,\n    }\n    r = client.patch(\n        f\"{settings.API_V1_STR}/users/me/password\",\n        headers=superuser_token_headers,\n        json=data,\n    )\n    assert r.status_code == 400\n    updated_user = r.json()\n    assert (\n        updated_user[\"detail\"] == \"New password cannot be the same as the current one\"\n    )\n\n\ndef test_register_user(client: TestClient, db: Session) -> None:\n    username = random_email()\n    password = random_lower_string()\n    full_name = random_lower_string()\n    data = {\"email\": username, \"password\": password, \"full_name\": full_name}\n    r = client.post(\n        f\"{settings.API_V1_STR}/users/signup\",\n        json=data,\n    )\n    assert r.status_code == 200\n    created_user = r.json()\n    assert created_user[\"email\"] == username\n    assert created_user[\"full_name\"] == full_name\n\n    user_query = select(User).where(User.email == username)\n    user_db = db.exec(user_query).first()\n    assert user_db\n    assert user_db.email == username\n    assert user_db.full_name == full_name\n    verified, _ = verify_password(password, user_db.hashed_password)\n    assert verified\n\n\ndef test_register_user_already_exists_error(client: TestClient) -> None:\n    password = random_lower_string()\n    full_name = random_lower_string()\n    data = {\n        \"email\": settings.FIRST_SUPERUSER,\n        \"password\": password,\n        \"full_name\": full_name,\n    }\n    r = client.post(\n        f\"{settings.API_V1_STR}/users/signup\",\n        json=data,\n    )\n    assert r.status_code == 400\n    assert r.json()[\"detail\"] == \"The user with this email already exists in the system\"\n\n\ndef test_update_user(\n    client: TestClient, superuser_token_headers: dict[str, str], db: Session\n) -> None:\n    username = random_email()\n    password = random_lower_string()\n    user_in = UserCreate(email=username, password=password)\n    user = crud.create_user(session=db, user_create=user_in)\n\n    data = {\"full_name\": \"Updated_full_name\"}\n    r = client.patch(\n        f\"{settings.API_V1_STR}/users/{user.id}\",\n        headers=superuser_token_headers,\n        json=data,\n    )\n    assert r.status_code == 200\n    updated_user = r.json()\n\n    assert updated_user[\"full_name\"] == \"Updated_full_name\"\n\n    user_query = select(User).where(User.email == username)\n    user_db = db.exec(user_query).first()\n    db.refresh(user_db)\n    assert user_db\n    assert user_db.full_name == \"Updated_full_name\"\n\n\ndef test_update_user_not_exists(\n    client: TestClient, superuser_token_headers: dict[str, str]\n) -> None:\n    data = {\"full_name\": \"Updated_full_name\"}\n    r = client.patch(\n        f\"{settings.API_V1_STR}/users/{uuid.uuid4()}\",\n        headers=superuser_token_headers,\n        json=data,\n    )\n    assert r.status_code == 404\n    assert r.json()[\"detail\"] == \"The user with this id does not exist in the system\"\n\n\ndef test_update_user_email_exists(\n    client: TestClient, superuser_token_headers: dict[str, str], db: Session\n) -> None:\n    username = random_email()\n    password = random_lower_string()\n    user_in = UserCreate(email=username, password=password)\n    user = crud.create_user(session=db, user_create=user_in)\n\n    username2 = random_email()\n    password2 = random_lower_string()\n    user_in2 = UserCreate(email=username2, password=password2)\n    user2 = crud.create_user(session=db, user_create=user_in2)\n\n    data = {\"email\": user2.email}\n    r = client.patch(\n        f\"{settings.API_V1_STR}/users/{user.id}\",\n        headers=superuser_token_headers,\n        json=data,\n    )\n    assert r.status_code == 409\n    assert r.json()[\"detail\"] == \"User with this email already exists\"\n\n\ndef test_delete_user_me(client: TestClient, db: Session) -> None:\n    username = random_email()\n    password = random_lower_string()\n    user_in = UserCreate(email=username, password=password)\n    user = crud.create_user(session=db, user_create=user_in)\n    user_id = user.id\n\n    login_data = {\n        \"username\": username,\n        \"password\": password,\n    }\n    r = client.post(f\"{settings.API_V1_STR}/login/access-token\", data=login_data)\n    tokens = r.json()\n    a_token = tokens[\"access_token\"]\n    headers = {\"Authorization\": f\"Bearer {a_token}\"}\n\n    r = client.delete(\n        f\"{settings.API_V1_STR}/users/me\",\n        headers=headers,\n    )\n    assert r.status_code == 200\n    deleted_user = r.json()\n    assert deleted_user[\"message\"] == \"User deleted successfully\"\n    result = db.exec(select(User).where(User.id == user_id)).first()\n    assert result is None\n\n    user_query = select(User).where(User.id == user_id)\n    user_db = db.execute(user_query).first()\n    assert user_db is None\n\n\ndef test_delete_user_me_as_superuser(\n    client: TestClient, superuser_token_headers: dict[str, str]\n) -> None:\n    r = client.delete(\n        f\"{settings.API_V1_STR}/users/me\",\n        headers=superuser_token_headers,\n    )\n    assert r.status_code == 403\n    response = r.json()\n    assert response[\"detail\"] == \"Super users are not allowed to delete themselves\"\n\n\ndef test_delete_user_super_user(\n    client: TestClient, superuser_token_headers: dict[str, str], db: Session\n) -> None:\n    username = random_email()\n    password = random_lower_string()\n    user_in = UserCreate(email=username, password=password)\n    user = crud.create_user(session=db, user_create=user_in)\n    user_id = user.id\n    r = client.delete(\n        f\"{settings.API_V1_STR}/users/{user_id}\",\n        headers=superuser_token_headers,\n    )\n    assert r.status_code == 200\n    deleted_user = r.json()\n    assert deleted_user[\"message\"] == \"User deleted successfully\"\n    result = db.exec(select(User).where(User.id == user_id)).first()\n    assert result is None\n\n\ndef test_delete_user_not_found(\n    client: TestClient, superuser_token_headers: dict[str, str]\n) -> None:\n    r = client.delete(\n        f\"{settings.API_V1_STR}/users/{uuid.uuid4()}\",\n        headers=superuser_token_headers,\n    )\n    assert r.status_code == 404\n    assert r.json()[\"detail\"] == \"User not found\"\n\n\ndef test_delete_user_current_super_user_error(\n    client: TestClient, superuser_token_headers: dict[str, str], db: Session\n) -> None:\n    super_user = crud.get_user_by_email(session=db, email=settings.FIRST_SUPERUSER)\n    assert super_user\n    user_id = super_user.id\n\n    r = client.delete(\n        f\"{settings.API_V1_STR}/users/{user_id}\",\n        headers=superuser_token_headers,\n    )\n    assert r.status_code == 403\n    assert r.json()[\"detail\"] == \"Super users are not allowed to delete themselves\"\n\n\ndef test_delete_user_without_privileges(\n    client: TestClient, normal_user_token_headers: dict[str, str], db: Session\n) -> None:\n    username = random_email()\n    password = random_lower_string()\n    user_in = UserCreate(email=username, password=password)\n    user = crud.create_user(session=db, user_create=user_in)\n\n    r = client.delete(\n        f\"{settings.API_V1_STR}/users/{user.id}\",\n        headers=normal_user_token_headers,\n    )\n    assert r.status_code == 403\n    assert r.json()[\"detail\"] == \"The user doesn't have enough privileges\"\n"
  },
  {
    "path": "backend/tests/conftest.py",
    "content": "from collections.abc import Generator\n\nimport pytest\nfrom fastapi.testclient import TestClient\nfrom sqlmodel import Session, delete\n\nfrom app.core.config import settings\nfrom app.core.db import engine, init_db\nfrom app.main import app\nfrom app.models import Item, User\nfrom tests.utils.user import authentication_token_from_email\nfrom tests.utils.utils import get_superuser_token_headers\n\n\n@pytest.fixture(scope=\"session\", autouse=True)\ndef db() -> Generator[Session, None, None]:\n    with Session(engine) as session:\n        init_db(session)\n        yield session\n        statement = delete(Item)\n        session.execute(statement)\n        statement = delete(User)\n        session.execute(statement)\n        session.commit()\n\n\n@pytest.fixture(scope=\"module\")\ndef client() -> Generator[TestClient, None, None]:\n    with TestClient(app) as c:\n        yield c\n\n\n@pytest.fixture(scope=\"module\")\ndef superuser_token_headers(client: TestClient) -> dict[str, str]:\n    return get_superuser_token_headers(client)\n\n\n@pytest.fixture(scope=\"module\")\ndef normal_user_token_headers(client: TestClient, db: Session) -> dict[str, str]:\n    return authentication_token_from_email(\n        client=client, email=settings.EMAIL_TEST_USER, db=db\n    )\n"
  },
  {
    "path": "backend/tests/crud/__init__.py",
    "content": ""
  },
  {
    "path": "backend/tests/crud/test_user.py",
    "content": "from fastapi.encoders import jsonable_encoder\nfrom pwdlib.hashers.bcrypt import BcryptHasher\nfrom sqlmodel import Session\n\nfrom app import crud\nfrom app.core.security import verify_password\nfrom app.models import User, UserCreate, UserUpdate\nfrom tests.utils.utils import random_email, random_lower_string\n\n\ndef test_create_user(db: Session) -> None:\n    email = random_email()\n    password = random_lower_string()\n    user_in = UserCreate(email=email, password=password)\n    user = crud.create_user(session=db, user_create=user_in)\n    assert user.email == email\n    assert hasattr(user, \"hashed_password\")\n\n\ndef test_authenticate_user(db: Session) -> None:\n    email = random_email()\n    password = random_lower_string()\n    user_in = UserCreate(email=email, password=password)\n    user = crud.create_user(session=db, user_create=user_in)\n    authenticated_user = crud.authenticate(session=db, email=email, password=password)\n    assert authenticated_user\n    assert user.email == authenticated_user.email\n\n\ndef test_not_authenticate_user(db: Session) -> None:\n    email = random_email()\n    password = random_lower_string()\n    user = crud.authenticate(session=db, email=email, password=password)\n    assert user is None\n\n\ndef test_check_if_user_is_active(db: Session) -> None:\n    email = random_email()\n    password = random_lower_string()\n    user_in = UserCreate(email=email, password=password)\n    user = crud.create_user(session=db, user_create=user_in)\n    assert user.is_active is True\n\n\ndef test_check_if_user_is_active_inactive(db: Session) -> None:\n    email = random_email()\n    password = random_lower_string()\n    user_in = UserCreate(email=email, password=password, is_active=False)\n    user = crud.create_user(session=db, user_create=user_in)\n    assert user.is_active is False\n\n\ndef test_check_if_user_is_superuser(db: Session) -> None:\n    email = random_email()\n    password = random_lower_string()\n    user_in = UserCreate(email=email, password=password, is_superuser=True)\n    user = crud.create_user(session=db, user_create=user_in)\n    assert user.is_superuser is True\n\n\ndef test_check_if_user_is_superuser_normal_user(db: Session) -> None:\n    username = random_email()\n    password = random_lower_string()\n    user_in = UserCreate(email=username, password=password)\n    user = crud.create_user(session=db, user_create=user_in)\n    assert user.is_superuser is False\n\n\ndef test_get_user(db: Session) -> None:\n    password = random_lower_string()\n    username = random_email()\n    user_in = UserCreate(email=username, password=password, is_superuser=True)\n    user = crud.create_user(session=db, user_create=user_in)\n    user_2 = db.get(User, user.id)\n    assert user_2\n    assert user.email == user_2.email\n    assert jsonable_encoder(user) == jsonable_encoder(user_2)\n\n\ndef test_update_user(db: Session) -> None:\n    password = random_lower_string()\n    email = random_email()\n    user_in = UserCreate(email=email, password=password, is_superuser=True)\n    user = crud.create_user(session=db, user_create=user_in)\n    new_password = random_lower_string()\n    user_in_update = UserUpdate(password=new_password, is_superuser=True)\n    if user.id is not None:\n        crud.update_user(session=db, db_user=user, user_in=user_in_update)\n    user_2 = db.get(User, user.id)\n    assert user_2\n    assert user.email == user_2.email\n    verified, _ = verify_password(new_password, user_2.hashed_password)\n    assert verified\n\n\ndef test_authenticate_user_with_bcrypt_upgrades_to_argon2(db: Session) -> None:\n    \"\"\"Test that a user with bcrypt password hash gets upgraded to argon2 on login.\"\"\"\n    email = random_email()\n    password = random_lower_string()\n\n    # Create a bcrypt hash directly (simulating legacy password)\n    bcrypt_hasher = BcryptHasher()\n    bcrypt_hash = bcrypt_hasher.hash(password)\n    assert bcrypt_hash.startswith(\"$2\")  # bcrypt hashes start with $2\n\n    # Create user with bcrypt hash directly in the database\n    user = User(email=email, hashed_password=bcrypt_hash)\n    db.add(user)\n    db.commit()\n    db.refresh(user)\n\n    # Verify the hash is bcrypt before authentication\n    assert user.hashed_password.startswith(\"$2\")\n\n    # Authenticate - this should upgrade the hash to argon2\n    authenticated_user = crud.authenticate(session=db, email=email, password=password)\n    assert authenticated_user\n    assert authenticated_user.email == email\n\n    db.refresh(authenticated_user)\n\n    # Verify the hash was upgraded to argon2\n    assert authenticated_user.hashed_password.startswith(\"$argon2\")\n\n    verified, updated_hash = verify_password(\n        password, authenticated_user.hashed_password\n    )\n    assert verified\n    # Should not need another update since it's already argon2\n    assert updated_hash is None\n"
  },
  {
    "path": "backend/tests/scripts/__init__.py",
    "content": ""
  },
  {
    "path": "backend/tests/scripts/test_backend_pre_start.py",
    "content": "from unittest.mock import MagicMock, patch\n\nfrom sqlmodel import select\n\nfrom app.backend_pre_start import init, logger\n\n\ndef test_init_successful_connection() -> None:\n    engine_mock = MagicMock()\n\n    session_mock = MagicMock()\n    session_mock.__enter__.return_value = session_mock\n\n    select1 = select(1)\n\n    with (\n        patch(\"app.backend_pre_start.Session\", return_value=session_mock),\n        patch(\"app.backend_pre_start.select\", return_value=select1),\n        patch.object(logger, \"info\"),\n        patch.object(logger, \"error\"),\n        patch.object(logger, \"warn\"),\n    ):\n        try:\n            init(engine_mock)\n            connection_successful = True\n        except Exception:\n            connection_successful = False\n\n        assert connection_successful, (\n            \"The database connection should be successful and not raise an exception.\"\n        )\n\n        session_mock.exec.assert_called_once_with(select1)\n"
  },
  {
    "path": "backend/tests/scripts/test_test_pre_start.py",
    "content": "from unittest.mock import MagicMock, patch\n\nfrom sqlmodel import select\n\nfrom app.tests_pre_start import init, logger\n\n\ndef test_init_successful_connection() -> None:\n    engine_mock = MagicMock()\n\n    session_mock = MagicMock()\n    session_mock.__enter__.return_value = session_mock\n\n    select1 = select(1)\n\n    with (\n        patch(\"app.tests_pre_start.Session\", return_value=session_mock),\n        patch(\"app.tests_pre_start.select\", return_value=select1),\n        patch.object(logger, \"info\"),\n        patch.object(logger, \"error\"),\n        patch.object(logger, \"warn\"),\n    ):\n        try:\n            init(engine_mock)\n            connection_successful = True\n        except Exception:\n            connection_successful = False\n\n        assert connection_successful, (\n            \"The database connection should be successful and not raise an exception.\"\n        )\n\n        session_mock.exec.assert_called_once_with(select1)\n"
  },
  {
    "path": "backend/tests/utils/__init__.py",
    "content": ""
  },
  {
    "path": "backend/tests/utils/item.py",
    "content": "from sqlmodel import Session\n\nfrom app import crud\nfrom app.models import Item, ItemCreate\nfrom tests.utils.user import create_random_user\nfrom tests.utils.utils import random_lower_string\n\n\ndef create_random_item(db: Session) -> Item:\n    user = create_random_user(db)\n    owner_id = user.id\n    assert owner_id is not None\n    title = random_lower_string()\n    description = random_lower_string()\n    item_in = ItemCreate(title=title, description=description)\n    return crud.create_item(session=db, item_in=item_in, owner_id=owner_id)\n"
  },
  {
    "path": "backend/tests/utils/user.py",
    "content": "from fastapi.testclient import TestClient\nfrom sqlmodel import Session\n\nfrom app import crud\nfrom app.core.config import settings\nfrom app.models import User, UserCreate, UserUpdate\nfrom tests.utils.utils import random_email, random_lower_string\n\n\ndef user_authentication_headers(\n    *, client: TestClient, email: str, password: str\n) -> dict[str, str]:\n    data = {\"username\": email, \"password\": password}\n\n    r = client.post(f\"{settings.API_V1_STR}/login/access-token\", data=data)\n    response = r.json()\n    auth_token = response[\"access_token\"]\n    headers = {\"Authorization\": f\"Bearer {auth_token}\"}\n    return headers\n\n\ndef create_random_user(db: Session) -> User:\n    email = random_email()\n    password = random_lower_string()\n    user_in = UserCreate(email=email, password=password)\n    user = crud.create_user(session=db, user_create=user_in)\n    return user\n\n\ndef authentication_token_from_email(\n    *, client: TestClient, email: str, db: Session\n) -> dict[str, str]:\n    \"\"\"\n    Return a valid token for the user with given email.\n\n    If the user doesn't exist it is created first.\n    \"\"\"\n    password = random_lower_string()\n    user = crud.get_user_by_email(session=db, email=email)\n    if not user:\n        user_in_create = UserCreate(email=email, password=password)\n        user = crud.create_user(session=db, user_create=user_in_create)\n    else:\n        user_in_update = UserUpdate(password=password)\n        if not user.id:\n            raise Exception(\"User id not set\")\n        user = crud.update_user(session=db, db_user=user, user_in=user_in_update)\n\n    return user_authentication_headers(client=client, email=email, password=password)\n"
  },
  {
    "path": "backend/tests/utils/utils.py",
    "content": "import random\nimport string\n\nfrom fastapi.testclient import TestClient\n\nfrom app.core.config import settings\n\n\ndef random_lower_string() -> str:\n    return \"\".join(random.choices(string.ascii_lowercase, k=32))\n\n\ndef random_email() -> str:\n    return f\"{random_lower_string()}@{random_lower_string()}.com\"\n\n\ndef get_superuser_token_headers(client: TestClient) -> dict[str, str]:\n    login_data = {\n        \"username\": settings.FIRST_SUPERUSER,\n        \"password\": settings.FIRST_SUPERUSER_PASSWORD,\n    }\n    r = client.post(f\"{settings.API_V1_STR}/login/access-token\", data=login_data)\n    tokens = r.json()\n    a_token = tokens[\"access_token\"]\n    headers = {\"Authorization\": f\"Bearer {a_token}\"}\n    return headers\n"
  },
  {
    "path": "compose.override.yml",
    "content": "services:\n\n  # Local services are available on their ports, but also available on:\n  # http://api.localhost.tiangolo.com: backend\n  # http://dashboard.localhost.tiangolo.com: frontend\n  # etc. To enable it, update .env, set:\n  # DOMAIN=localhost.tiangolo.com\n  proxy:\n    image: traefik:3.6\n    volumes:\n      - /var/run/docker.sock:/var/run/docker.sock\n    ports:\n      - \"80:80\"\n      - \"8090:8080\"\n    # Duplicate the command from compose.yml to add --api.insecure=true\n    command:\n      # Enable Docker in Traefik, so that it reads labels from Docker services\n      - --providers.docker\n      # Add a constraint to only use services with the label for this stack\n      - --providers.docker.constraints=Label(`traefik.constraint-label`, `traefik-public`)\n      # Do not expose all Docker services, only the ones explicitly exposed\n      - --providers.docker.exposedbydefault=false\n      # Create an entrypoint \"http\" listening on port 80\n      - --entrypoints.http.address=:80\n      # Create an entrypoint \"https\" listening on port 443\n      - --entrypoints.https.address=:443\n      # Enable the access log, with HTTP requests\n      - --accesslog\n      # Enable the Traefik log, for configurations and errors\n      - --log\n      # Enable debug logging for local development\n      - --log.level=DEBUG\n      # Enable the Dashboard and API\n      - --api\n      # Enable the Dashboard and API in insecure mode for local development\n      - --api.insecure=true\n    labels:\n      # Enable Traefik for this service, to make it available in the public network\n      - traefik.enable=true\n      - traefik.constraint-label=traefik-public\n      # Dummy https-redirect middleware that doesn't really redirect, only to\n      # allow running it locally\n      - traefik.http.middlewares.https-redirect.contenttype.autodetect=false\n    networks:\n      - traefik-public\n      - default\n\n  db:\n    restart: \"no\"\n    ports:\n      - \"5432:5432\"\n\n  adminer:\n    restart: \"no\"\n    ports:\n      - \"8080:8080\"\n\n  backend:\n    restart: \"no\"\n    ports:\n      - \"8000:8000\"\n    build:\n      context: .\n      dockerfile: backend/Dockerfile\n    # command: sleep infinity  # Infinite loop to keep container alive doing nothing\n    command:\n      - fastapi\n      - run\n      - --reload\n      - \"app/main.py\"\n    develop:\n      watch:\n        - path: ./backend\n          action: sync\n          target: /app/backend\n          ignore:\n            - ./backend/.venv\n            - .venv\n        - path: ./backend/pyproject.toml\n          action: rebuild\n    # TODO: remove once coverage is done locally\n    volumes:\n      - ./backend/htmlcov:/app/backend/htmlcov\n    environment:\n      SMTP_HOST: \"mailcatcher\"\n      SMTP_PORT: \"1025\"\n      SMTP_TLS: \"false\"\n      EMAILS_FROM_EMAIL: \"noreply@example.com\"\n\n  mailcatcher:\n    image: schickling/mailcatcher\n    ports:\n      - \"1080:1080\"\n      - \"1025:1025\"\n\n  frontend:\n    restart: \"no\"\n    ports:\n      - \"5173:80\"\n    build:\n      context: .\n      dockerfile: frontend/Dockerfile\n      args:\n        - VITE_API_URL=http://localhost:8000\n        - NODE_ENV=development\n\n  playwright:\n    build:\n      context: .\n      dockerfile: frontend/Dockerfile.playwright\n      args:\n        - VITE_API_URL=http://backend:8000\n        - NODE_ENV=production\n    ipc: host\n    depends_on:\n      - backend\n      - mailcatcher\n    env_file:\n      - .env\n    environment:\n      - VITE_API_URL=http://backend:8000\n      - MAILCATCHER_HOST=http://mailcatcher:1080\n      # For the reports when run locally\n      - PLAYWRIGHT_HTML_HOST=0.0.0.0\n      - CI=${CI}\n    volumes:\n      - ./frontend/blob-report:/app/frontend/blob-report\n      - ./frontend/test-results:/app/frontend/test-results\n    ports:\n      - 9323:9323\n\nnetworks:\n  traefik-public:\n    # For local dev, don't expect an external Traefik network\n    external: false\n"
  },
  {
    "path": "compose.traefik.yml",
    "content": "services:\n  traefik:\n    image: traefik:3.6\n    ports:\n      # Listen on port 80, default for HTTP, necessary to redirect to HTTPS\n      - 80:80\n      # Listen on port 443, default for HTTPS\n      - 443:443\n    restart: always\n    labels:\n      # Enable Traefik for this service, to make it available in the public network\n      - traefik.enable=true\n      # Use the traefik-public network (declared below)\n      - traefik.docker.network=traefik-public\n      # Define the port inside of the Docker service to use\n      - traefik.http.services.traefik-dashboard.loadbalancer.server.port=8080\n      # Make Traefik use this domain (from an environment variable) in HTTP\n      - traefik.http.routers.traefik-dashboard-http.entrypoints=http\n      - traefik.http.routers.traefik-dashboard-http.rule=Host(`traefik.${DOMAIN?Variable not set}`)\n      # traefik-https the actual router using HTTPS\n      - traefik.http.routers.traefik-dashboard-https.entrypoints=https\n      - traefik.http.routers.traefik-dashboard-https.rule=Host(`traefik.${DOMAIN?Variable not set}`)\n      - traefik.http.routers.traefik-dashboard-https.tls=true\n      # Use the \"le\" (Let's Encrypt) resolver created below\n      - traefik.http.routers.traefik-dashboard-https.tls.certresolver=le\n      # Use the special Traefik service api@internal with the web UI/Dashboard\n      - traefik.http.routers.traefik-dashboard-https.service=api@internal\n      # https-redirect middleware to redirect HTTP to HTTPS\n      - traefik.http.middlewares.https-redirect.redirectscheme.scheme=https\n      - traefik.http.middlewares.https-redirect.redirectscheme.permanent=true\n      # traefik-http set up only to use the middleware to redirect to https\n      - traefik.http.routers.traefik-dashboard-http.middlewares=https-redirect\n      # admin-auth middleware with HTTP Basic auth\n      # Using the environment variables USERNAME and HASHED_PASSWORD\n      - traefik.http.middlewares.admin-auth.basicauth.users=${USERNAME?Variable not set}:${HASHED_PASSWORD?Variable not set}\n      # Enable HTTP Basic auth, using the middleware created above\n      - traefik.http.routers.traefik-dashboard-https.middlewares=admin-auth\n    volumes:\n      # Add Docker as a mounted volume, so that Traefik can read the labels of other services\n      - /var/run/docker.sock:/var/run/docker.sock:ro\n      # Mount the volume to store the certificates\n      - traefik-public-certificates:/certificates\n    command:\n      # Enable Docker in Traefik, so that it reads labels from Docker services\n      - --providers.docker\n      # Do not expose all Docker services, only the ones explicitly exposed\n      - --providers.docker.exposedbydefault=false\n      # Create an entrypoint \"http\" listening on port 80\n      - --entrypoints.http.address=:80\n      # Create an entrypoint \"https\" listening on port 443\n      - --entrypoints.https.address=:443\n      # Create the certificate resolver \"le\" for Let's Encrypt, uses the environment variable EMAIL\n      - --certificatesresolvers.le.acme.email=${EMAIL?Variable not set}\n      # Store the Let's Encrypt certificates in the mounted volume\n      - --certificatesresolvers.le.acme.storage=/certificates/acme.json\n      # Use the TLS Challenge for Let's Encrypt\n      - --certificatesresolvers.le.acme.tlschallenge=true\n      # Enable the access log, with HTTP requests\n      - --accesslog\n      # Enable the Traefik log, for configurations and errors\n      - --log\n      # Enable the Dashboard and API\n      - --api\n    networks:\n      # Use the public network created to be shared between Traefik and\n      # any other service that needs to be publicly available with HTTPS\n      - traefik-public\n\nvolumes:\n  # Create a volume to store the certificates, even if the container is recreated\n  traefik-public-certificates:\n\nnetworks:\n  # Use the previously created public network \"traefik-public\", shared with other\n  # services that need to be publicly available via this Traefik\n  traefik-public:\n    external: true\n"
  },
  {
    "path": "compose.yml",
    "content": "services:\n\n  db:\n    image: postgres:18\n    restart: always\n    healthcheck:\n      test: [\"CMD-SHELL\", \"pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}\"]\n      interval: 10s\n      retries: 5\n      start_period: 30s\n      timeout: 10s\n    volumes:\n      - app-db-data:/var/lib/postgresql/data/pgdata\n    env_file:\n      - .env\n    environment:\n      - PGDATA=/var/lib/postgresql/data/pgdata\n      - POSTGRES_PASSWORD=${POSTGRES_PASSWORD?Variable not set}\n      - POSTGRES_USER=${POSTGRES_USER?Variable not set}\n      - POSTGRES_DB=${POSTGRES_DB?Variable not set}\n\n  adminer:\n    image: adminer\n    restart: always\n    networks:\n      - traefik-public\n      - default\n    depends_on:\n      - db\n    environment:\n      - ADMINER_DESIGN=pepa-linha-dark\n    labels:\n      - traefik.enable=true\n      - traefik.docker.network=traefik-public\n      - traefik.constraint-label=traefik-public\n      - traefik.http.routers.${STACK_NAME?Variable not set}-adminer-http.rule=Host(`adminer.${DOMAIN?Variable not set}`)\n      - traefik.http.routers.${STACK_NAME?Variable not set}-adminer-http.entrypoints=http\n      - traefik.http.routers.${STACK_NAME?Variable not set}-adminer-http.middlewares=https-redirect\n      - traefik.http.routers.${STACK_NAME?Variable not set}-adminer-https.rule=Host(`adminer.${DOMAIN?Variable not set}`)\n      - traefik.http.routers.${STACK_NAME?Variable not set}-adminer-https.entrypoints=https\n      - traefik.http.routers.${STACK_NAME?Variable not set}-adminer-https.tls=true\n      - traefik.http.routers.${STACK_NAME?Variable not set}-adminer-https.tls.certresolver=le\n      - traefik.http.services.${STACK_NAME?Variable not set}-adminer.loadbalancer.server.port=8080\n\n  prestart:\n    image: '${DOCKER_IMAGE_BACKEND?Variable not set}:${TAG-latest}'\n    build:\n      context: .\n      dockerfile: backend/Dockerfile\n    networks:\n      - traefik-public\n      - default\n    depends_on:\n      db:\n        condition: service_healthy\n        restart: true\n    command: bash scripts/prestart.sh\n    env_file:\n      - .env\n    environment:\n      - DOMAIN=${DOMAIN}\n      - FRONTEND_HOST=${FRONTEND_HOST?Variable not set}\n      - ENVIRONMENT=${ENVIRONMENT}\n      - BACKEND_CORS_ORIGINS=${BACKEND_CORS_ORIGINS}\n      - SECRET_KEY=${SECRET_KEY?Variable not set}\n      - FIRST_SUPERUSER=${FIRST_SUPERUSER?Variable not set}\n      - FIRST_SUPERUSER_PASSWORD=${FIRST_SUPERUSER_PASSWORD?Variable not set}\n      - SMTP_HOST=${SMTP_HOST}\n      - SMTP_USER=${SMTP_USER}\n      - SMTP_PASSWORD=${SMTP_PASSWORD}\n      - EMAILS_FROM_EMAIL=${EMAILS_FROM_EMAIL}\n      - POSTGRES_SERVER=db\n      - POSTGRES_PORT=${POSTGRES_PORT}\n      - POSTGRES_DB=${POSTGRES_DB}\n      - POSTGRES_USER=${POSTGRES_USER?Variable not set}\n      - POSTGRES_PASSWORD=${POSTGRES_PASSWORD?Variable not set}\n      - SENTRY_DSN=${SENTRY_DSN}\n\n  backend:\n    image: '${DOCKER_IMAGE_BACKEND?Variable not set}:${TAG-latest}'\n    restart: always\n    networks:\n      - traefik-public\n      - default\n    depends_on:\n      db:\n        condition: service_healthy\n        restart: true\n      prestart:\n        condition: service_completed_successfully\n    env_file:\n      - .env\n    environment:\n      - DOMAIN=${DOMAIN}\n      - FRONTEND_HOST=${FRONTEND_HOST?Variable not set}\n      - ENVIRONMENT=${ENVIRONMENT}\n      - BACKEND_CORS_ORIGINS=${BACKEND_CORS_ORIGINS}\n      - SECRET_KEY=${SECRET_KEY?Variable not set}\n      - FIRST_SUPERUSER=${FIRST_SUPERUSER?Variable not set}\n      - FIRST_SUPERUSER_PASSWORD=${FIRST_SUPERUSER_PASSWORD?Variable not set}\n      - SMTP_HOST=${SMTP_HOST}\n      - SMTP_USER=${SMTP_USER}\n      - SMTP_PASSWORD=${SMTP_PASSWORD}\n      - EMAILS_FROM_EMAIL=${EMAILS_FROM_EMAIL}\n      - POSTGRES_SERVER=db\n      - POSTGRES_PORT=${POSTGRES_PORT}\n      - POSTGRES_DB=${POSTGRES_DB}\n      - POSTGRES_USER=${POSTGRES_USER?Variable not set}\n      - POSTGRES_PASSWORD=${POSTGRES_PASSWORD?Variable not set}\n      - SENTRY_DSN=${SENTRY_DSN}\n\n    healthcheck:\n      test: [\"CMD\", \"curl\", \"-f\", \"http://localhost:8000/api/v1/utils/health-check/\"]\n      interval: 10s\n      timeout: 5s\n      retries: 5\n\n    build:\n      context: .\n      dockerfile: backend/Dockerfile\n    labels:\n      - traefik.enable=true\n      - traefik.docker.network=traefik-public\n      - traefik.constraint-label=traefik-public\n\n      - traefik.http.services.${STACK_NAME?Variable not set}-backend.loadbalancer.server.port=8000\n\n      - traefik.http.routers.${STACK_NAME?Variable not set}-backend-http.rule=Host(`api.${DOMAIN?Variable not set}`)\n      - traefik.http.routers.${STACK_NAME?Variable not set}-backend-http.entrypoints=http\n\n      - traefik.http.routers.${STACK_NAME?Variable not set}-backend-https.rule=Host(`api.${DOMAIN?Variable not set}`)\n      - traefik.http.routers.${STACK_NAME?Variable not set}-backend-https.entrypoints=https\n      - traefik.http.routers.${STACK_NAME?Variable not set}-backend-https.tls=true\n      - traefik.http.routers.${STACK_NAME?Variable not set}-backend-https.tls.certresolver=le\n\n      # Enable redirection for HTTP and HTTPS\n      - traefik.http.routers.${STACK_NAME?Variable not set}-backend-http.middlewares=https-redirect\n\n  frontend:\n    image: '${DOCKER_IMAGE_FRONTEND?Variable not set}:${TAG-latest}'\n    restart: always\n    networks:\n      - traefik-public\n      - default\n    build:\n      context: .\n      dockerfile: frontend/Dockerfile\n      args:\n        - VITE_API_URL=https://api.${DOMAIN?Variable not set}\n        - NODE_ENV=production\n    labels:\n      - traefik.enable=true\n      - traefik.docker.network=traefik-public\n      - traefik.constraint-label=traefik-public\n\n      - traefik.http.services.${STACK_NAME?Variable not set}-frontend.loadbalancer.server.port=80\n\n      - traefik.http.routers.${STACK_NAME?Variable not set}-frontend-http.rule=Host(`dashboard.${DOMAIN?Variable not set}`)\n      - traefik.http.routers.${STACK_NAME?Variable not set}-frontend-http.entrypoints=http\n\n      - traefik.http.routers.${STACK_NAME?Variable not set}-frontend-https.rule=Host(`dashboard.${DOMAIN?Variable not set}`)\n      - traefik.http.routers.${STACK_NAME?Variable not set}-frontend-https.entrypoints=https\n      - traefik.http.routers.${STACK_NAME?Variable not set}-frontend-https.tls=true\n      - traefik.http.routers.${STACK_NAME?Variable not set}-frontend-https.tls.certresolver=le\n\n      # Enable redirection for HTTP and HTTPS\n      - traefik.http.routers.${STACK_NAME?Variable not set}-frontend-http.middlewares=https-redirect\nvolumes:\n  app-db-data:\n\nnetworks:\n  traefik-public:\n    # Allow setting it to false for testing\n    external: true\n"
  },
  {
    "path": "copier.yml",
    "content": "project_name:\n  type: str\n  help: The name of the project, shown to API users (in .env)\n  default: FastAPI Project\n\nstack_name:\n  type: str\n  help: The name of the stack used for Docker Compose labels (no spaces) (in .env)\n  default: fastapi-project\n\nsecret_key:\n  type: str\n  help: |\n    'The secret key for the project, used for security,\n    stored in .env, you can generate one with:\n    python -c \"import secrets; print(secrets.token_urlsafe(32))\"'\n  default: changethis\n\nfirst_superuser:\n  type: str\n  help: The email of the first superuser (in .env)\n  default: admin@example.com\n\nfirst_superuser_password:\n  type: str\n  help: The password of the first superuser (in .env)\n  default: changethis\n\nsmtp_host:\n  type: str\n  help: The SMTP server host to send emails, you can set it later in .env\n  default: \"\"\n\nsmtp_user:\n  type: str\n  help: The SMTP server user to send emails, you can set it later in .env\n  default: \"\"\n\nsmtp_password:\n  type: str\n  help: The SMTP server password to send emails, you can set it later in .env\n  default: \"\"\n\nemails_from_email:\n  type: str\n  help: The email account to send emails from, you can set it later in .env\n  default: info@example.com\n\npostgres_password:\n  type: str\n  help: |\n    'The password for the PostgreSQL database, stored in .env,\n    you can generate one with:\n    python -c \"import secrets; print(secrets.token_urlsafe(32))\"'\n  default: changethis\n\nsentry_dsn:\n  type: str\n  help: The DSN for Sentry, if you are using it, you can set it later in .env\n  default: \"\"\n\n_exclude:\n  # Global\n  - .vscode\n  - .mypy_cache\n  # Python\n  - __pycache__\n  - app.egg-info\n  - \"*.pyc\"\n  - .mypy_cache\n  - .coverage\n  - htmlcov\n  - .cache\n  - .venv\n  # Frontend\n  # Logs\n  - logs\n  - \"*.log\"\n  - npm-debug.log*\n  - yarn-debug.log*\n  - yarn-error.log*\n  - pnpm-debug.log*\n  - lerna-debug.log*\n  - node_modules\n  - dist\n  - dist-ssr\n  - \"*.local\"\n  # Editor directories and files\n  - .idea\n  - .DS_Store\n  - \"*.suo\"\n  - \"*.ntvs*\"\n  - \"*.njsproj\"\n  - \"*.sln\"\n  - \"*.sw?\"\n\n_answers_file: .copier/.copier-answers.yml\n\n_tasks:\n  - [\"{{ _copier_python }}\", .copier/update_dotenv.py]\n"
  },
  {
    "path": "deployment.md",
    "content": "# FastAPI Project - Deployment\n\nYou can deploy the project using Docker Compose to a remote server.\n\nThis project expects you to have a Traefik proxy handling communication to the outside world and HTTPS certificates.\n\nYou can use CI/CD (continuous integration and continuous deployment) systems to deploy automatically, there are already configurations to do it with GitHub Actions.\n\nBut you have to configure a couple things first. 🤓\n\n## Preparation\n\n* Have a remote server ready and available.\n* Configure the DNS records of your domain to point to the IP of the server you just created.\n* Configure a wildcard subdomain for your domain, so that you can have multiple subdomains for different services, e.g. `*.fastapi-project.example.com`. This will be useful for accessing different components, like `dashboard.fastapi-project.example.com`, `api.fastapi-project.example.com`, `traefik.fastapi-project.example.com`, `adminer.fastapi-project.example.com`, etc. And also for `staging`, like `dashboard.staging.fastapi-project.example.com`, `adminer.staging.fastapi-project.example.com`, etc.\n* Install and configure [Docker](https://docs.docker.com/engine/install/) on the remote server (Docker Engine, not Docker Desktop).\n\n## Public Traefik\n\nWe need a Traefik proxy to handle incoming connections and HTTPS certificates.\n\nYou need to do these next steps only once.\n\n### Traefik Docker Compose\n\n* Create a remote directory to store your Traefik Docker Compose file:\n\n```bash\nmkdir -p /root/code/traefik-public/\n```\n\nCopy the Traefik Docker Compose file to your server. You could do it by running the command `rsync` in your local terminal:\n\n```bash\nrsync -a compose.traefik.yml root@your-server.example.com:/root/code/traefik-public/\n```\n\n### Traefik Public Network\n\nThis Traefik will expect a Docker \"public network\" named `traefik-public` to communicate with your stack(s).\n\nThis way, there will be a single public Traefik proxy that handles the communication (HTTP and HTTPS) with the outside world, and then behind that, you could have one or more stacks with different domains, even if they are on the same single server.\n\nTo create a Docker \"public network\" named `traefik-public` run the following command in your remote server:\n\n```bash\ndocker network create traefik-public\n```\n\n### Traefik Environment Variables\n\nThe Traefik Docker Compose file expects some environment variables to be set in your terminal before starting it. You can do it by running the following commands in your remote server.\n\n* Create the username for HTTP Basic Auth, e.g.:\n\n```bash\nexport USERNAME=admin\n```\n\n* Create an environment variable with the password for HTTP Basic Auth, e.g.:\n\n```bash\nexport PASSWORD=changethis\n```\n\n* Use openssl to generate the \"hashed\" version of the password for HTTP Basic Auth and store it in an environment variable:\n\n```bash\nexport HASHED_PASSWORD=$(openssl passwd -apr1 $PASSWORD)\n```\n\nTo verify that the hashed password is correct, you can print it:\n\n```bash\necho $HASHED_PASSWORD\n```\n\n* Create an environment variable with the domain name for your server, e.g.:\n\n```bash\nexport DOMAIN=fastapi-project.example.com\n```\n\n* Create an environment variable with the email for Let's Encrypt, e.g.:\n\n```bash\nexport EMAIL=admin@example.com\n```\n\n**Note**: you need to set a different email, an email `@example.com` won't work.\n\n### Start the Traefik Docker Compose\n\nGo to the directory where you copied the Traefik Docker Compose file in your remote server:\n\n```bash\ncd /root/code/traefik-public/\n```\n\nNow with the environment variables set and the `compose.traefik.yml` in place, you can start the Traefik Docker Compose running the following command:\n\n```bash\ndocker compose -f compose.traefik.yml up -d\n```\n\n## Deploy the FastAPI Project\n\nNow that you have Traefik in place you can deploy your FastAPI project with Docker Compose.\n\n**Note**: You might want to jump ahead to the section about Continuous Deployment with GitHub Actions.\n\n## Copy the Code\n\n```bash\nrsync -av --filter=\":- .gitignore\" ./ root@your-server.example.com:/root/code/app/\n```\n\nNote: `--filter=\":- .gitignore\"` tells `rsync` to use the same rules as git, ignore files ignored by git, like the Python virtual environment.\n\n## Environment Variables\n\nYou need to set some environment variables first.\n\n### Generate secret keys\n\nSome environment variables in the `.env` file have a default value of `changethis`.\n\nYou have to change them with a secret key, to generate secret keys you can run the following command:\n\n```bash\npython -c \"import secrets; print(secrets.token_urlsafe(32))\"\n```\n\nCopy the content and use that as password / secret key. And run that again to generate another secure key.\n\n### Required Environment Variables\n\nSet the `ENVIRONMENT`, by default `local` (for development), but when deploying to a server you would put something like `staging` or `production`:\n\n```bash\nexport ENVIRONMENT=production\n```\n\nSet the `DOMAIN`, by default `localhost` (for development), but when deploying you would use your own domain, for example:\n\n```bash\nexport DOMAIN=fastapi-project.example.com\n```\n\nSet the `POSTGRES_PASSWORD` to something different than `changethis`:\n\n```bash\nexport POSTGRES_PASSWORD=\"changethis\"\n```\n\nSet the `SECRET_KEY`, used to sign tokens:\n\n```bash\nexport SECRET_KEY=\"changethis\"\n```\n\nNote: you can use the Python command above to generate a secure secret key.\n\nSet the `FIRST_SUPER_USER_PASSWORD` to something different than `changethis`:\n\n```bash\nexport FIRST_SUPERUSER_PASSWORD=\"changethis\"\n```\n\nSet the `BACKEND_CORS_ORIGINS` to include your domain:\n\n```bash\nexport BACKEND_CORS_ORIGINS=\"https://dashboard.${DOMAIN?Variable not set},https://api.${DOMAIN?Variable not set}\"\n```\n\nYou can set several other environment variables:\n\n* `PROJECT_NAME`: The name of the project, used in the API for the docs and emails.\n* `STACK_NAME`: The name of the stack used for Docker Compose labels and project name, this should be different for `staging`, `production`, etc. You could use the same domain replacing dots with dashes, e.g. `fastapi-project-example-com` and `staging-fastapi-project-example-com`.\n* `BACKEND_CORS_ORIGINS`: A list of allowed CORS origins separated by commas.\n* `FIRST_SUPERUSER`: The email of the first superuser, this superuser will be the one that can create new users.\n* `SMTP_HOST`: The SMTP server host to send emails, this would come from your email provider (E.g. Mailgun, Sparkpost, Sendgrid, etc).\n* `SMTP_USER`: The SMTP server user to send emails.\n* `SMTP_PASSWORD`: The SMTP server password to send emails.\n* `EMAILS_FROM_EMAIL`: The email account to send emails from.\n* `POSTGRES_SERVER`: The hostname of the PostgreSQL server. You can leave the default of `db`, provided by the same Docker Compose. You normally wouldn't need to change this unless you are using a third-party provider.\n* `POSTGRES_PORT`: The port of the PostgreSQL server. You can leave the default. You normally wouldn't need to change this unless you are using a third-party provider.\n* `POSTGRES_USER`: The Postgres user, you can leave the default.\n* `POSTGRES_DB`: The database name to use for this application. You can leave the default of `app`.\n* `SENTRY_DSN`: The DSN for Sentry, if you are using it.\n\n## GitHub Actions Environment Variables\n\nThere are some environment variables only used by GitHub Actions that you can configure:\n\n* `LATEST_CHANGES`: Used by the GitHub Action [latest-changes](https://github.com/tiangolo/latest-changes) to automatically add release notes based on the PRs merged. It's a personal access token, read the docs for details.\n* `SMOKESHOW_AUTH_KEY`: Used to handle and publish the code coverage using [Smokeshow](https://github.com/samuelcolvin/smokeshow), follow their instructions to create a (free) Smokeshow key.\n\n### Deploy with Docker Compose\n\nWith the environment variables in place, you can deploy with Docker Compose:\n\n```bash\ncd /root/code/app/\ndocker compose -f compose.yml build\ndocker compose -f compose.yml up -d\n```\n\nFor production you wouldn't want to have the overrides in `compose.override.yml`, that's why we explicitly specify `compose.yml` as the file to use.\n\n## Continuous Deployment (CD)\n\nYou can use GitHub Actions to deploy your project automatically. 😎\n\nYou can have multiple environment deployments.\n\nThere are already two environments configured, `staging` and `production`. 🚀\n\n### Install GitHub Actions Runner\n\n* On your remote server, create a user for your GitHub Actions:\n\n```bash\nsudo adduser github\n```\n\n* Add Docker permissions to the `github` user:\n\n```bash\nsudo usermod -aG docker github\n```\n\n* Temporarily switch to the `github` user:\n\n```bash\nsudo su - github\n```\n\n* Go to the `github` user's home directory:\n\n```bash\ncd\n```\n\n* [Install a GitHub Action self-hosted runner following the official guide](https://docs.github.com/en/actions/hosting-your-own-runners/managing-self-hosted-runners/adding-self-hosted-runners#adding-a-self-hosted-runner-to-a-repository).\n\n* When asked about labels, add a label for the environment, e.g. `production`. You can also add labels later.\n\nAfter installing, the guide would tell you to run a command to start the runner. Nevertheless, it would stop once you terminate that process or if your local connection to your server is lost.\n\nTo make sure it runs on startup and continues running, you can install it as a service. To do that, exit the `github` user and go back to the `root` user:\n\n```bash\nexit\n```\n\nAfter you do it, you will be on the previous user again. And you will be on the previous directory, belonging to that user.\n\nBefore being able to go the `github` user directory, you need to become the `root` user (you might already be):\n\n```bash\nsudo su\n```\n\n* As the `root` user, go to the `actions-runner` directory inside of the `github` user's home directory:\n\n```bash\ncd /home/github/actions-runner\n```\n\n* Install the self-hosted runner as a service with the user `github`:\n\n```bash\n./svc.sh install github\n```\n\n* Start the service:\n\n```bash\n./svc.sh start\n```\n\n* Check the status of the service:\n\n```bash\n./svc.sh status\n```\n\nYou can read more about it in the official guide: [Configuring the self-hosted runner application as a service](https://docs.github.com/en/actions/hosting-your-own-runners/managing-self-hosted-runners/configuring-the-self-hosted-runner-application-as-a-service).\n\n### Set Secrets\n\nOn your repository, configure secrets for the environment variables you need, the same ones described above, including `SECRET_KEY`, etc. Follow the [official GitHub guide for setting repository secrets](https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions#creating-secrets-for-a-repository).\n\nThe current Github Actions workflows expect these secrets:\n\n* `DOMAIN_PRODUCTION`\n* `DOMAIN_STAGING`\n* `STACK_NAME_PRODUCTION`\n* `STACK_NAME_STAGING`\n* `EMAILS_FROM_EMAIL`\n* `FIRST_SUPERUSER`\n* `FIRST_SUPERUSER_PASSWORD`\n* `POSTGRES_PASSWORD`\n* `SECRET_KEY`\n* `LATEST_CHANGES`\n* `SMOKESHOW_AUTH_KEY`\n\n## GitHub Action Deployment Workflows\n\nThere are GitHub Action workflows in the `.github/workflows` directory already configured for deploying to the environments (GitHub Actions runners with the labels):\n\n* `staging`: after pushing (or merging) to the branch `master`.\n* `production`: after publishing a release.\n\nIf you need to add extra environments you could use those as a starting point.\n\n## URLs\n\nReplace `fastapi-project.example.com` with your domain.\n\n### Main Traefik Dashboard\n\nTraefik UI: `https://traefik.fastapi-project.example.com`\n\n### Production\n\nFrontend: `https://dashboard.fastapi-project.example.com`\n\nBackend API docs: `https://api.fastapi-project.example.com/docs`\n\nBackend API base URL: `https://api.fastapi-project.example.com`\n\nAdminer: `https://adminer.fastapi-project.example.com`\n\n### Staging\n\nFrontend: `https://dashboard.staging.fastapi-project.example.com`\n\nBackend API docs: `https://api.staging.fastapi-project.example.com/docs`\n\nBackend API base URL: `https://api.staging.fastapi-project.example.com`\n\nAdminer: `https://adminer.staging.fastapi-project.example.com`\n"
  },
  {
    "path": "development.md",
    "content": "# FastAPI Project - Development\n\n## Docker Compose\n\n* Start the local stack with Docker Compose:\n\n```bash\ndocker compose watch\n```\n\n* Now you can open your browser and interact with these URLs:\n\nFrontend, built with Docker, with routes handled based on the path: <http://localhost:5173>\n\nBackend, JSON based web API based on OpenAPI: <http://localhost:8000>\n\nAutomatic interactive documentation with Swagger UI (from the OpenAPI backend): <http://localhost:8000/docs>\n\nAdminer, database web administration: <http://localhost:8080>\n\nTraefik UI, to see how the routes are being handled by the proxy: <http://localhost:8090>\n\n**Note**: The first time you start your stack, it might take a minute for it to be ready. While the backend waits for the database to be ready and configures everything. You can check the logs to monitor it.\n\nTo check the logs, run (in another terminal):\n\n```bash\ndocker compose logs\n```\n\nTo check the logs of a specific service, add the name of the service, e.g.:\n\n```bash\ndocker compose logs backend\n```\n\n## Mailcatcher\n\nMailcatcher is a simple SMTP server that catches all emails sent by the backend during local development. Instead of sending real emails, they are captured and displayed in a web interface.\n\nThis is useful for:\n\n* Testing email functionality during development\n* Verifying email content and formatting\n* Debugging email-related functionality without sending real emails\n\nThe backend is automatically configured to use Mailcatcher when running with Docker Compose locally (SMTP on port 1025). All captured emails can be viewed at <http://localhost:1080>.\n\n## Local Development\n\nThe Docker Compose files are configured so that each of the services is available in a different port in `localhost`.\n\nFor the backend and frontend, they use the same port that would be used by their local development server, so, the backend is at `http://localhost:8000` and the frontend at `http://localhost:5173`.\n\nThis way, you could turn off a Docker Compose service and start its local development service, and everything would keep working, because it all uses the same ports.\n\nFor example, you can stop that `frontend` service in the Docker Compose, in another terminal, run:\n\n```bash\ndocker compose stop frontend\n```\n\nAnd then start the local frontend development server:\n\n```bash\nbun run dev\n```\n\nOr you could stop the `backend` Docker Compose service:\n\n```bash\ndocker compose stop backend\n```\n\nAnd then you can run the local development server for the backend:\n\n```bash\ncd backend\nfastapi dev app/main.py\n```\n\n## Docker Compose in `localhost.tiangolo.com`\n\nWhen you start the Docker Compose stack, it uses `localhost` by default, with different ports for each service (backend, frontend, adminer, etc).\n\nWhen you deploy it to production (or staging), it will deploy each service in a different subdomain, like `api.example.com` for the backend and `dashboard.example.com` for the frontend.\n\nIn the guide about [deployment](deployment.md) you can read about Traefik, the configured proxy. That's the component in charge of transmitting traffic to each service based on the subdomain.\n\nIf you want to test that it's all working locally, you can edit the local `.env` file, and change:\n\n```dotenv\nDOMAIN=localhost.tiangolo.com\n```\n\nThat will be used by the Docker Compose files to configure the base domain for the services.\n\nTraefik will use this to transmit traffic at `api.localhost.tiangolo.com` to the backend, and traffic at `dashboard.localhost.tiangolo.com` to the frontend.\n\nThe domain `localhost.tiangolo.com` is a special domain that is configured (with all its subdomains) to point to `127.0.0.1`. This way you can use that for your local development.\n\nAfter you update it, run again:\n\n```bash\ndocker compose watch\n```\n\nWhen deploying, for example in production, the main Traefik is configured outside of the Docker Compose files. For local development, there's an included Traefik in `compose.override.yml`, just to let you test that the domains work as expected, for example with `api.localhost.tiangolo.com` and `dashboard.localhost.tiangolo.com`.\n\n## Docker Compose files and env vars\n\nThere is a main `compose.yml` file with all the configurations that apply to the whole stack, it is used automatically by `docker compose`.\n\nAnd there's also a `compose.override.yml` with overrides for development, for example to mount the source code as a volume. It is used automatically by `docker compose` to apply overrides on top of `compose.yml`.\n\nThese Docker Compose files use the `.env` file containing configurations to be injected as environment variables in the containers.\n\nThey also use some additional configurations taken from environment variables set in the scripts before calling the `docker compose` command.\n\nAfter changing variables, make sure you restart the stack:\n\n```bash\ndocker compose watch\n```\n\n## The .env file\n\nThe `.env` file is the one that contains all your configurations, generated keys and passwords, etc.\n\nDepending on your workflow, you could want to exclude it from Git, for example if your project is public. In that case, you would have to make sure to set up a way for your CI tools to obtain it while building or deploying your project.\n\nOne way to do it could be to add each environment variable to your CI/CD system, and updating the `compose.yml` file to read that specific env var instead of reading the `.env` file.\n\n## Pre-commits and code linting\n\nwe are using a tool called [prek](https://prek.j178.dev/) (modern alternative to [Pre-commit](https://pre-commit.com/)) for code linting and formatting.\n\nWhen you install it, it runs right before making a commit in git. This way it ensures that the code is consistent and formatted even before it is committed.\n\nYou can find a file `.pre-commit-config.yaml` with configurations at the root of the project.\n\n#### Install prek to run automatically\n\n`prek` is already part of the dependencies of the project.\n\nAfter having the `prek` tool installed and available, you need to \"install\" it in the local repository, so that it runs automatically before each commit.\n\nUsing `uv`, you could do it with (make sure you are inside `backend` folder):\n\n```bash\n❯ uv run prek install -f\nprek installed at `../.git/hooks/pre-commit`\n```\n\nThe `-f` flag forces the installation, in case there was already a `pre-commit` hook previously installed.\n\nNow whenever you try to commit, e.g. with:\n\n```bash\ngit commit\n```\n\n...prek will run and check and format the code you are about to commit, and will ask you to add that code (stage it) with git again before committing.\n\nThen you can `git add` the modified/fixed files again and now you can commit.\n\n#### Running prek hooks manually\n\nyou can also run `prek` manually on all the files, you can do it using `uv` with:\n\n```bash\n❯ uv run prek run --all-files\ncheck for added large files..............................................Passed\ncheck toml...............................................................Passed\ncheck yaml...............................................................Passed\nfix end of files.........................................................Passed\ntrim trailing whitespace.................................................Passed\nruff.....................................................................Passed\nruff-format..............................................................Passed\nbiome check..............................................................Passed\n```\n\n## URLs\n\nThe production or staging URLs would use these same paths, but with your own domain.\n\n### Development URLs\n\nDevelopment URLs, for local development.\n\nFrontend: <http://localhost:5173>\n\nBackend: <http://localhost:8000>\n\nAutomatic Interactive Docs (Swagger UI): <http://localhost:8000/docs>\n\nAutomatic Alternative Docs (ReDoc): <http://localhost:8000/redoc>\n\nAdminer: <http://localhost:8080>\n\nTraefik UI: <http://localhost:8090>\n\nMailCatcher: <http://localhost:1080>\n\n### Development URLs with `localhost.tiangolo.com` Configured\n\nDevelopment URLs, for local development.\n\nFrontend: <http://dashboard.localhost.tiangolo.com>\n\nBackend: <http://api.localhost.tiangolo.com>\n\nAutomatic Interactive Docs (Swagger UI): <http://api.localhost.tiangolo.com/docs>\n\nAutomatic Alternative Docs (ReDoc): <http://api.localhost.tiangolo.com/redoc>\n\nAdminer: <http://localhost.tiangolo.com:8080>\n\nTraefik UI: <http://localhost.tiangolo.com:8090>\n\nMailCatcher: <http://localhost.tiangolo.com:1080>\n"
  },
  {
    "path": "frontend/.dockerignore",
    "content": "node_modules\ndist\n"
  },
  {
    "path": "frontend/.gitignore",
    "content": "# Logs\nlogs\n*.log\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\npnpm-debug.log*\nlerna-debug.log*\n\nnode_modules\ndist\ndist-ssr\n*.local\nopenapi.json\n\n# Editor directories and files\n.vscode/*\n!.vscode/extensions.json\n.idea\n.DS_Store\n*.suo\n*.ntvs*\n*.njsproj\n*.sln\n*.sw?\n/test-results/\n/playwright-report/\n/blob-report/\n/playwright/.cache/\n/playwright/.auth/\n"
  },
  {
    "path": "frontend/Dockerfile",
    "content": "# Stage 0, \"build-stage\", based on Bun, to build and compile the frontend\nFROM oven/bun:1 AS build-stage\n\nWORKDIR /app\n\nCOPY package.json bun.lock /app/\n\nCOPY frontend/package.json /app/frontend/\n\nWORKDIR /app/frontend\n\nRUN bun install\n\nCOPY ./frontend /app/frontend\nARG VITE_API_URL\n\nRUN bun run build\n\n\n# Stage 1, based on Nginx, to have only the compiled app, ready for production with Nginx\nFROM nginx:1\n\nCOPY --from=build-stage /app/frontend/dist/ /usr/share/nginx/html\n\nCOPY ./frontend/nginx.conf /etc/nginx/conf.d/default.conf\nCOPY ./frontend/nginx-backend-not-found.conf /etc/nginx/extra-conf.d/backend-not-found.conf\n"
  },
  {
    "path": "frontend/Dockerfile.playwright",
    "content": "FROM mcr.microsoft.com/playwright:v1.58.2-noble\n\nWORKDIR /app\n\nRUN apt-get update && apt-get install -y unzip \\\n    && rm -rf /var/lib/apt/lists/*\n\nRUN curl -fsSL https://bun.sh/install | bash\nENV PATH=\"/root/.bun/bin:$PATH\"\n\nCOPY package.json bun.lock /app/\n\nCOPY frontend/package.json /app/frontend/\n\nWORKDIR /app/frontend\n\nRUN bun install\n\nCOPY ./frontend /app/frontend\n\nARG VITE_API_URL\n"
  },
  {
    "path": "frontend/README.md",
    "content": "# FastAPI Project - Frontend\n\nThe frontend is built with [Vite](https://vitejs.dev/), [React](https://reactjs.org/), [TypeScript](https://www.typescriptlang.org/), [TanStack Query](https://tanstack.com/query), [TanStack Router](https://tanstack.com/router) and [Tailwind CSS](https://tailwindcss.com/).\n\n## Requirements\n\n- [Bun](https://bun.sh/) (recommended) or [Node.js](https://nodejs.org/)\n\n## Quick Start\n\n```bash\nbun install\nbun run dev\n```\n\n* Then open your browser at http://localhost:5173/.\n\nNotice that this live server is not running inside Docker, it's for local development, and that is the recommended workflow. Once you are happy with your frontend, you can build the frontend Docker image and start it, to test it in a production-like environment. But building the image at every change will not be as productive as running the local development server with live reload.\n\nCheck the file `package.json` to see other available options.\n\n### Removing the frontend\n\nIf you are developing an API-only app and want to remove the frontend, you can do it easily:\n\n* Remove the `./frontend` directory.\n\n* In the `compose.yml` file, remove the whole service / section `frontend`.\n\n* In the `compose.override.yml` file, remove the whole service / section `frontend` and `playwright`.\n\nDone, you have a frontend-less (api-only) app. 🤓\n\n---\n\nIf you want, you can also remove the `FRONTEND` environment variables from:\n\n* `.env`\n* `./scripts/*.sh`\n\nBut it would be only to clean them up, leaving them won't really have any effect either way.\n\n## Generate Client\n\n### Automatically\n\n* Activate the backend virtual environment.\n* From the top level project directory, run the script:\n\n```bash\nbash ./scripts/generate-client.sh\n```\n\n* Commit the changes.\n\n### Manually\n\n* Start the Docker Compose stack.\n\n* Download the OpenAPI JSON file from `http://localhost/api/v1/openapi.json` and copy it to a new file `openapi.json` at the root of the `frontend` directory.\n\n* To generate the frontend client, run:\n\n```bash\nbun run generate-client\n```\n\n* Commit the changes.\n\nNotice that everytime the backend changes (changing the OpenAPI schema), you should follow these steps again to update the frontend client.\n\n## Using a Remote API\n\nIf you want to use a remote API, you can set the environment variable `VITE_API_URL` to the URL of the remote API. For example, you can set it in the `frontend/.env` file:\n\n```env\nVITE_API_URL=https://api.my-domain.example.com\n```\n\nThen, when you run the frontend, it will use that URL as the base URL for the API.\n\n## Code Structure\n\nThe frontend code is structured as follows:\n\n* `frontend/src` - The main frontend code.\n* `frontend/src/assets` - Static assets.\n* `frontend/src/client` - The generated OpenAPI client.\n* `frontend/src/components` -  The different components of the frontend.\n* `frontend/src/hooks` - Custom hooks.\n* `frontend/src/routes` - The different routes of the frontend which include the pages.\n\n## End-to-End Testing with Playwright\n\nThe frontend includes initial end-to-end tests using Playwright. To run the tests, you need to have the Docker Compose stack running. Start the stack with the following command:\n\n```bash\ndocker compose up -d --wait backend\n```\n\nThen, you can run the tests with the following command:\n\n```bash\nbunx playwright test\n```\n\nYou can also run your tests in UI mode to see the browser and interact with it running:\n\n```bash\nbunx playwright test --ui\n```\n\nTo stop and remove the Docker Compose stack and clean the data created in tests, use the following command:\n\n```bash\ndocker compose down -v\n```\n\nTo update the tests, navigate to the tests directory and modify the existing test files or add new ones as needed.\n\nFor more information on writing and running Playwright tests, refer to the official [Playwright documentation](https://playwright.dev/docs/intro).\n"
  },
  {
    "path": "frontend/biome.json",
    "content": "{\n  \"$schema\": \"https://biomejs.dev/schemas/2.3.14/schema.json\",\n  \"assist\": { \"actions\": { \"source\": { \"organizeImports\": \"on\" } } },\n  \"files\": {\n    \"includes\": [\n      \"**\",\n      \"!**/dist/**/*\",\n      \"!**/node_modules/**/*\",\n      \"!**/src/routeTree.gen.ts\",\n      \"!**/src/client/**/*\",\n      \"!**/src/components/ui/**/*\",\n      \"!**/playwright-report\",\n      \"!**/playwright.config.ts\"\n    ]\n  },\n  \"linter\": {\n    \"enabled\": true,\n    \"rules\": {\n      \"recommended\": true,\n      \"suspicious\": {\n        \"noExplicitAny\": \"off\",\n        \"noArrayIndexKey\": \"off\"\n      },\n      \"style\": {\n        \"noNonNullAssertion\": \"off\",\n        \"noParameterAssign\": \"error\",\n        \"useSelfClosingElements\": \"error\",\n        \"noUselessElse\": \"error\"\n      }\n    }\n  },\n  \"formatter\": {\n    \"indentStyle\": \"space\"\n  },\n  \"javascript\": {\n    \"formatter\": {\n      \"quoteStyle\": \"double\",\n      \"semicolons\": \"asNeeded\"\n    }\n  },\n  \"css\": {\n    \"parser\": {\n      \"tailwindDirectives\": true\n    }\n  }\n}\n"
  },
  {
    "path": "frontend/components.json",
    "content": "{\n  \"$schema\": \"https://ui.shadcn.com/schema.json\",\n  \"style\": \"new-york\",\n  \"rsc\": false,\n  \"tsx\": true,\n  \"tailwind\": {\n    \"config\": \"\",\n    \"css\": \"src/index.css\",\n    \"baseColor\": \"neutral\",\n    \"cssVariables\": true,\n    \"prefix\": \"\"\n  },\n  \"iconLibrary\": \"lucide\",\n  \"aliases\": {\n    \"components\": \"@/components\",\n    \"utils\": \"@/lib/utils\",\n    \"ui\": \"@/components/ui\",\n    \"lib\": \"@/lib\",\n    \"hooks\": \"@/hooks\"\n  },\n  \"registries\": {}\n}\n"
  },
  {
    "path": "frontend/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"UTF-8\" />\n    <link rel=\"icon\" type=\"image/svg+xml\" href=\"/vite.svg\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n    <title>Full Stack FastAPI Project</title>\n    <link rel=\"icon\" type=\"image/x-icon\" href=\"/assets/images/favicon.png\" />\n  </head>\n  <body>\n    <div id=\"root\"></div>\n    <script type=\"module\" src=\"./src/main.tsx\"></script>\n  </body>\n</html>\n"
  },
  {
    "path": "frontend/nginx-backend-not-found.conf",
    "content": "location /api {\n    return 404;\n}\nlocation /docs {\n    return 404;\n}\nlocation /redoc {\n    return 404;\n}\n"
  },
  {
    "path": "frontend/nginx.conf",
    "content": "server {\n  listen 80;\n\n  location / {\n    root /usr/share/nginx/html;\n    index index.html index.htm;\n    try_files $uri /index.html =404;\n  }\n\n  include /etc/nginx/extra-conf.d/*.conf;\n}\n"
  },
  {
    "path": "frontend/openapi-ts.config.ts",
    "content": "import { defineConfig } from \"@hey-api/openapi-ts\"\n\nexport default defineConfig({\n  input: \"./openapi.json\",\n  output: \"./src/client\",\n\n  plugins: [\n    \"legacy/axios\",\n    {\n      name: \"@hey-api/sdk\",\n      // NOTE: this doesn't allow tree-shaking\n      asClass: true,\n      operationId: true,\n      classNameBuilder: \"{{name}}Service\",\n      methodNameBuilder: (operation) => {\n        // @ts-expect-error\n        let name: string = operation.name\n        // @ts-expect-error\n        const service: string = operation.service\n\n        if (service && name.toLowerCase().startsWith(service.toLowerCase())) {\n          name = name.slice(service.length)\n        }\n\n        return name.charAt(0).toLowerCase() + name.slice(1)\n      },\n    },\n    {\n      name: \"@hey-api/schemas\",\n      type: \"json\",\n    },\n  ],\n})\n"
  },
  {
    "path": "frontend/package.json",
    "content": "{\n  \"name\": \"frontend\",\n  \"private\": true,\n  \"version\": \"0.0.0\",\n  \"type\": \"module\",\n  \"scripts\": {\n    \"dev\": \"vite\",\n    \"build\": \"tsc -p tsconfig.build.json && vite build\",\n    \"lint\": \"biome check --write --unsafe --no-errors-on-unmatched --files-ignore-unknown=true ./\",\n    \"preview\": \"vite preview\",\n    \"generate-client\": \"openapi-ts\",\n    \"test\": \"bunx playwright test\",\n    \"test:ui\": \"bunx playwright test --ui\"\n  },\n  \"dependencies\": {\n    \"@hookform/resolvers\": \"^5.2.2\",\n    \"@radix-ui/react-avatar\": \"^1.1.11\",\n    \"@radix-ui/react-checkbox\": \"^1.3.3\",\n    \"@radix-ui/react-dialog\": \"^1.1.15\",\n    \"@radix-ui/react-dropdown-menu\": \"^2.1.16\",\n    \"@radix-ui/react-label\": \"^2.1.8\",\n    \"@radix-ui/react-radio-group\": \"^1.3.8\",\n    \"@radix-ui/react-scroll-area\": \"^1.2.10\",\n    \"@radix-ui/react-select\": \"^2.2.6\",\n    \"@radix-ui/react-separator\": \"^1.1.8\",\n    \"@radix-ui/react-slot\": \"^1.2.4\",\n    \"@radix-ui/react-tabs\": \"^1.1.13\",\n    \"@radix-ui/react-tooltip\": \"^1.2.8\",\n    \"@tailwindcss/vite\": \"^4.1.18\",\n    \"@tanstack/react-query\": \"^5.90.21\",\n    \"@tanstack/react-query-devtools\": \"^5.91.1\",\n    \"@tanstack/react-router\": \"^1.163.3\",\n    \"@tanstack/react-router-devtools\": \"^1.163.3\",\n    \"@tanstack/react-table\": \"^8.21.3\",\n    \"axios\": \"1.13.5\",\n    \"class-variance-authority\": \"^0.7.1\",\n    \"clsx\": \"^2.1.1\",\n    \"form-data\": \"4.0.5\",\n    \"lucide-react\": \"^0.563.0\",\n    \"next-themes\": \"^0.4.6\",\n    \"react\": \"^19.1.1\",\n    \"react-dom\": \"^19.2.3\",\n    \"react-error-boundary\": \"^6.0.0\",\n    \"react-hook-form\": \"^7.68.0\",\n    \"react-icons\": \"^5.5.0\",\n    \"sonner\": \"^2.0.7\",\n    \"tailwind-merge\": \"^3.4.0\",\n    \"tailwindcss\": \"^4.2.1\",\n    \"zod\": \"^4.3.6\"\n  },\n  \"devDependencies\": {\n    \"@biomejs/biome\": \"^2.3.14\",\n    \"@hey-api/openapi-ts\": \"0.73.0\",\n    \"@playwright/test\": \"1.58.2\",\n    \"@tanstack/router-devtools\": \"^1.166.7\",\n    \"@tanstack/router-plugin\": \"^1.140.0\",\n    \"@types/node\": \"^25.5.0\",\n    \"@types/react\": \"^19.2.7\",\n    \"@types/react-dom\": \"^19.2.3\",\n    \"@vitejs/plugin-react-swc\": \"^4.2.3\",\n    \"dotenv\": \"^17.3.1\",\n    \"tw-animate-css\": \"^1.4.0\",\n    \"typescript\": \"^5.9.3\",\n    \"vite\": \"^7.3.0\"\n  }\n}\n"
  },
  {
    "path": "frontend/playwright.config.ts",
    "content": "import { defineConfig, devices } from '@playwright/test';\nimport 'dotenv/config'\n\n/**\n * Read environment variables from file.\n * https://github.com/motdotla/dotenv\n */\n\n/**\n * See https://playwright.dev/docs/test-configuration.\n */\nexport default defineConfig({\n  testDir: './tests',\n  /* Run tests in files in parallel */\n  fullyParallel: true,\n  /* Fail the build on CI if you accidentally left test.only in the source code. */\n  forbidOnly: !!process.env.CI,\n  /* Retry on CI only */\n  retries: process.env.CI ? 2 : 0,\n  /* Opt out of parallel tests on CI. */\n  workers: process.env.CI ? 1 : undefined,\n  /* Reporter to use. See https://playwright.dev/docs/test-reporters */\n  reporter: process.env.CI ? 'blob' : 'html',\n  /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */\n  use: {\n    /* Base URL to use in actions like `await page.goto('/')`. */\n    baseURL: 'http://localhost:5173',\n\n    /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */\n    trace: 'on-first-retry',\n  },\n\n  /* Configure projects for major browsers */\n  projects: [\n    { name: 'setup', testMatch: /.*\\.setup\\.ts/ },\n\n    {\n      name: 'chromium',\n      use: {\n        ...devices['Desktop Chrome'],\n        storageState: 'playwright/.auth/user.json',\n      },\n      dependencies: ['setup'],\n    },\n\n    // {\n    //   name: 'firefox',\n    //   use: {\n    //     ...devices['Desktop Firefox'],\n    //     storageState: 'playwright/.auth/user.json',\n    //   },\n    //   dependencies: ['setup'],\n    // },\n\n    // {\n    //   name: 'webkit',\n    //   use: {\n    //     ...devices['Desktop Safari'],\n    //     storageState: 'playwright/.auth/user.json',\n    //   },\n    //   dependencies: ['setup'],\n    // },\n\n    /* Test against mobile viewports. */\n    // {\n    //   name: 'Mobile Chrome',\n    //   use: { ...devices['Pixel 5'] },\n    // },\n    // {\n    //   name: 'Mobile Safari',\n    //   use: { ...devices['iPhone 12'] },\n    // },\n\n    /* Test against branded browsers. */\n    // {\n    //   name: 'Microsoft Edge',\n    //   use: { ...devices['Desktop Edge'], channel: 'msedge' },\n    // },\n    // {\n    //   name: 'Google Chrome',\n    //   use: { ...devices['Desktop Chrome'], channel: 'chrome' },\n    // },\n  ],\n\n  /* Run your local dev server before starting the tests */\n  webServer: {\n    command: 'bun run dev',\n    url: 'http://localhost:5173',\n    reuseExistingServer: !process.env.CI,\n  },\n});\n"
  },
  {
    "path": "frontend/src/client/core/ApiError.ts",
    "content": "import type { ApiRequestOptions } from './ApiRequestOptions';\nimport type { ApiResult } from './ApiResult';\n\nexport class ApiError extends Error {\n\tpublic readonly url: string;\n\tpublic readonly status: number;\n\tpublic readonly statusText: string;\n\tpublic readonly body: unknown;\n\tpublic readonly request: ApiRequestOptions;\n\n\tconstructor(request: ApiRequestOptions, response: ApiResult, message: string) {\n\t\tsuper(message);\n\n\t\tthis.name = 'ApiError';\n\t\tthis.url = response.url;\n\t\tthis.status = response.status;\n\t\tthis.statusText = response.statusText;\n\t\tthis.body = response.body;\n\t\tthis.request = request;\n\t}\n}"
  },
  {
    "path": "frontend/src/client/core/ApiRequestOptions.ts",
    "content": "export type ApiRequestOptions<T = unknown> = {\n\treadonly body?: any;\n\treadonly cookies?: Record<string, unknown>;\n\treadonly errors?: Record<number | string, string>;\n\treadonly formData?: Record<string, unknown> | any[] | Blob | File;\n\treadonly headers?: Record<string, unknown>;\n\treadonly mediaType?: string;\n\treadonly method:\n\t\t| 'DELETE'\n\t\t| 'GET'\n\t\t| 'HEAD'\n\t\t| 'OPTIONS'\n\t\t| 'PATCH'\n\t\t| 'POST'\n\t\t| 'PUT';\n\treadonly path?: Record<string, unknown>;\n\treadonly query?: Record<string, unknown>;\n\treadonly responseHeader?: string;\n\treadonly responseTransformer?: (data: unknown) => Promise<T>;\n\treadonly url: string;\n};"
  },
  {
    "path": "frontend/src/client/core/ApiResult.ts",
    "content": "export type ApiResult<TData = any> = {\n\treadonly body: TData;\n\treadonly ok: boolean;\n\treadonly status: number;\n\treadonly statusText: string;\n\treadonly url: string;\n};"
  },
  {
    "path": "frontend/src/client/core/CancelablePromise.ts",
    "content": "export class CancelError extends Error {\n\tconstructor(message: string) {\n\t\tsuper(message);\n\t\tthis.name = 'CancelError';\n\t}\n\n\tpublic get isCancelled(): boolean {\n\t\treturn true;\n\t}\n}\n\nexport interface OnCancel {\n\treadonly isResolved: boolean;\n\treadonly isRejected: boolean;\n\treadonly isCancelled: boolean;\n\n\t(cancelHandler: () => void): void;\n}\n\nexport class CancelablePromise<T> implements Promise<T> {\n\tprivate _isResolved: boolean;\n\tprivate _isRejected: boolean;\n\tprivate _isCancelled: boolean;\n\treadonly cancelHandlers: (() => void)[];\n\treadonly promise: Promise<T>;\n\tprivate _resolve?: (value: T | PromiseLike<T>) => void;\n\tprivate _reject?: (reason?: unknown) => void;\n\n\tconstructor(\n\t\texecutor: (\n\t\t\tresolve: (value: T | PromiseLike<T>) => void,\n\t\t\treject: (reason?: unknown) => void,\n\t\t\tonCancel: OnCancel\n\t\t) => void\n\t) {\n\t\tthis._isResolved = false;\n\t\tthis._isRejected = false;\n\t\tthis._isCancelled = false;\n\t\tthis.cancelHandlers = [];\n\t\tthis.promise = new Promise<T>((resolve, reject) => {\n\t\t\tthis._resolve = resolve;\n\t\t\tthis._reject = reject;\n\n\t\t\tconst onResolve = (value: T | PromiseLike<T>): void => {\n\t\t\t\tif (this._isResolved || this._isRejected || this._isCancelled) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis._isResolved = true;\n\t\t\t\tif (this._resolve) this._resolve(value);\n\t\t\t};\n\n\t\t\tconst onReject = (reason?: unknown): void => {\n\t\t\t\tif (this._isResolved || this._isRejected || this._isCancelled) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis._isRejected = true;\n\t\t\t\tif (this._reject) this._reject(reason);\n\t\t\t};\n\n\t\t\tconst onCancel = (cancelHandler: () => void): void => {\n\t\t\t\tif (this._isResolved || this._isRejected || this._isCancelled) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis.cancelHandlers.push(cancelHandler);\n\t\t\t};\n\n\t\t\tObject.defineProperty(onCancel, 'isResolved', {\n\t\t\t\tget: (): boolean => this._isResolved,\n\t\t\t});\n\n\t\t\tObject.defineProperty(onCancel, 'isRejected', {\n\t\t\t\tget: (): boolean => this._isRejected,\n\t\t\t});\n\n\t\t\tObject.defineProperty(onCancel, 'isCancelled', {\n\t\t\t\tget: (): boolean => this._isCancelled,\n\t\t\t});\n\n\t\t\treturn executor(onResolve, onReject, onCancel as OnCancel);\n\t\t});\n\t}\n\n\tget [Symbol.toStringTag]() {\n\t\treturn \"Cancellable Promise\";\n\t}\n\n\tpublic then<TResult1 = T, TResult2 = never>(\n\t\tonFulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | null,\n\t\tonRejected?: ((reason: unknown) => TResult2 | PromiseLike<TResult2>) | null\n\t): Promise<TResult1 | TResult2> {\n\t\treturn this.promise.then(onFulfilled, onRejected);\n\t}\n\n\tpublic catch<TResult = never>(\n\t\tonRejected?: ((reason: unknown) => TResult | PromiseLike<TResult>) | null\n\t): Promise<T | TResult> {\n\t\treturn this.promise.catch(onRejected);\n\t}\n\n\tpublic finally(onFinally?: (() => void) | null): Promise<T> {\n\t\treturn this.promise.finally(onFinally);\n\t}\n\n\tpublic cancel(): void {\n\t\tif (this._isResolved || this._isRejected || this._isCancelled) {\n\t\t\treturn;\n\t\t}\n\t\tthis._isCancelled = true;\n\t\tif (this.cancelHandlers.length) {\n\t\t\ttry {\n\t\t\t\tfor (const cancelHandler of this.cancelHandlers) {\n\t\t\t\t\tcancelHandler();\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\tconsole.warn('Cancellation threw an error', error);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tthis.cancelHandlers.length = 0;\n\t\tif (this._reject) this._reject(new CancelError('Request aborted'));\n\t}\n\n\tpublic get isCancelled(): boolean {\n\t\treturn this._isCancelled;\n\t}\n}"
  },
  {
    "path": "frontend/src/client/core/OpenAPI.ts",
    "content": "import type { AxiosRequestConfig, AxiosResponse } from 'axios';\nimport type { ApiRequestOptions } from './ApiRequestOptions';\n\ntype Headers = Record<string, string>;\ntype Middleware<T> = (value: T) => T | Promise<T>;\ntype Resolver<T> = (options: ApiRequestOptions<T>) => Promise<T>;\n\nexport class Interceptors<T> {\n  _fns: Middleware<T>[];\n\n  constructor() {\n    this._fns = [];\n  }\n\n  eject(fn: Middleware<T>): void {\n    const index = this._fns.indexOf(fn);\n    if (index !== -1) {\n      this._fns = [...this._fns.slice(0, index), ...this._fns.slice(index + 1)];\n    }\n  }\n\n  use(fn: Middleware<T>): void {\n    this._fns = [...this._fns, fn];\n  }\n}\n\nexport type OpenAPIConfig = {\n\tBASE: string;\n\tCREDENTIALS: 'include' | 'omit' | 'same-origin';\n\tENCODE_PATH?: ((path: string) => string) | undefined;\n\tHEADERS?: Headers | Resolver<Headers> | undefined;\n\tPASSWORD?: string | Resolver<string> | undefined;\n\tTOKEN?: string | Resolver<string> | undefined;\n\tUSERNAME?: string | Resolver<string> | undefined;\n\tVERSION: string;\n\tWITH_CREDENTIALS: boolean;\n\tinterceptors: {\n\t\trequest: Interceptors<AxiosRequestConfig>;\n\t\tresponse: Interceptors<AxiosResponse>;\n\t};\n};\n\nexport const OpenAPI: OpenAPIConfig = {\n\tBASE: '',\n\tCREDENTIALS: 'include',\n\tENCODE_PATH: undefined,\n\tHEADERS: undefined,\n\tPASSWORD: undefined,\n\tTOKEN: undefined,\n\tUSERNAME: undefined,\n\tVERSION: '0.1.0',\n\tWITH_CREDENTIALS: false,\n\tinterceptors: {\n\t\trequest: new Interceptors(),\n\t\tresponse: new Interceptors(),\n\t},\n};"
  },
  {
    "path": "frontend/src/client/core/request.ts",
    "content": "import axios from 'axios';\nimport type { AxiosError, AxiosRequestConfig, AxiosResponse, AxiosInstance } from 'axios';\n\nimport { ApiError } from './ApiError';\nimport type { ApiRequestOptions } from './ApiRequestOptions';\nimport type { ApiResult } from './ApiResult';\nimport { CancelablePromise } from './CancelablePromise';\nimport type { OnCancel } from './CancelablePromise';\nimport type { OpenAPIConfig } from './OpenAPI';\n\nexport const isString = (value: unknown): value is string => {\n\treturn typeof value === 'string';\n};\n\nexport const isStringWithValue = (value: unknown): value is string => {\n\treturn isString(value) && value !== '';\n};\n\nexport const isBlob = (value: any): value is Blob => {\n\treturn value instanceof Blob;\n};\n\nexport const isFormData = (value: unknown): value is FormData => {\n\treturn value instanceof FormData;\n};\n\nexport const isSuccess = (status: number): boolean => {\n\treturn status >= 200 && status < 300;\n};\n\nexport const base64 = (str: string): string => {\n\ttry {\n\t\treturn btoa(str);\n\t} catch (err) {\n\t\t// @ts-ignore\n\t\treturn Buffer.from(str).toString('base64');\n\t}\n};\n\nexport const getQueryString = (params: Record<string, unknown>): string => {\n\tconst qs: string[] = [];\n\n\tconst append = (key: string, value: unknown) => {\n\t\tqs.push(`${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`);\n\t};\n\n\tconst encodePair = (key: string, value: unknown) => {\n\t\tif (value === undefined || value === null) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (value instanceof Date) {\n\t\t\tappend(key, value.toISOString());\n\t\t} else if (Array.isArray(value)) {\n\t\t\tvalue.forEach(v => encodePair(key, v));\n\t\t} else if (typeof value === 'object') {\n\t\t\tObject.entries(value).forEach(([k, v]) => encodePair(`${key}[${k}]`, v));\n\t\t} else {\n\t\t\tappend(key, value);\n\t\t}\n\t};\n\n\tObject.entries(params).forEach(([key, value]) => encodePair(key, value));\n\n\treturn qs.length ? `?${qs.join('&')}` : '';\n};\n\nconst getUrl = (config: OpenAPIConfig, options: ApiRequestOptions): string => {\n\tconst encoder = config.ENCODE_PATH || encodeURI;\n\n\tconst path = options.url\n\t\t.replace('{api-version}', config.VERSION)\n\t\t.replace(/{(.*?)}/g, (substring: string, group: string) => {\n\t\t\tif (options.path?.hasOwnProperty(group)) {\n\t\t\t\treturn encoder(String(options.path[group]));\n\t\t\t}\n\t\t\treturn substring;\n\t\t});\n\n\tconst url = config.BASE + path;\n\treturn options.query ? url + getQueryString(options.query) : url;\n};\n\nexport const getFormData = (options: ApiRequestOptions): FormData | undefined => {\n\tif (options.formData) {\n\t\tconst formData = new FormData();\n\n\t\tconst process = (key: string, value: unknown) => {\n\t\t\tif (isString(value) || isBlob(value)) {\n\t\t\t\tformData.append(key, value);\n\t\t\t} else {\n\t\t\t\tformData.append(key, JSON.stringify(value));\n\t\t\t}\n\t\t};\n\n\t\tObject.entries(options.formData)\n\t\t\t.filter(([, value]) => value !== undefined && value !== null)\n\t\t\t.forEach(([key, value]) => {\n\t\t\t\tif (Array.isArray(value)) {\n\t\t\t\t\tvalue.forEach(v => process(key, v));\n\t\t\t\t} else {\n\t\t\t\t\tprocess(key, value);\n\t\t\t\t}\n\t\t\t});\n\n\t\treturn formData;\n\t}\n\treturn undefined;\n};\n\ntype Resolver<T> = (options: ApiRequestOptions<T>) => Promise<T>;\n\nexport const resolve = async <T>(options: ApiRequestOptions<T>, resolver?: T | Resolver<T>): Promise<T | undefined> => {\n\tif (typeof resolver === 'function') {\n\t\treturn (resolver as Resolver<T>)(options);\n\t}\n\treturn resolver;\n};\n\nexport const getHeaders = async <T>(config: OpenAPIConfig, options: ApiRequestOptions<T>): Promise<Record<string, string>> => {\n\tconst [token, username, password, additionalHeaders] = await Promise.all([\n\t\t// @ts-ignore\n\t\tresolve(options, config.TOKEN),\n\t\t// @ts-ignore\n\t\tresolve(options, config.USERNAME),\n\t\t// @ts-ignore\n\t\tresolve(options, config.PASSWORD),\n\t\t// @ts-ignore\n\t\tresolve(options, config.HEADERS),\n\t]);\n\n\tconst headers = Object.entries({\n\t\tAccept: 'application/json',\n\t\t...additionalHeaders,\n\t\t...options.headers,\n\t})\n\t.filter(([, value]) => value !== undefined && value !== null)\n\t.reduce((headers, [key, value]) => ({\n\t\t...headers,\n\t\t[key]: String(value),\n\t}), {} as Record<string, string>);\n\n\tif (isStringWithValue(token)) {\n\t\theaders['Authorization'] = `Bearer ${token}`;\n\t}\n\n\tif (isStringWithValue(username) && isStringWithValue(password)) {\n\t\tconst credentials = base64(`${username}:${password}`);\n\t\theaders['Authorization'] = `Basic ${credentials}`;\n\t}\n\n\tif (options.body !== undefined) {\n\t\tif (options.mediaType) {\n\t\t\theaders['Content-Type'] = options.mediaType;\n\t\t} else if (isBlob(options.body)) {\n\t\t\theaders['Content-Type'] = options.body.type || 'application/octet-stream';\n\t\t} else if (isString(options.body)) {\n\t\t\theaders['Content-Type'] = 'text/plain';\n\t\t} else if (!isFormData(options.body)) {\n\t\t\theaders['Content-Type'] = 'application/json';\n\t\t}\n\t} else if (options.formData !== undefined) {\n\t\tif (options.mediaType) {\n\t\t\theaders['Content-Type'] = options.mediaType;\n\t\t}\n\t}\n\n\treturn headers;\n};\n\nexport const getRequestBody = (options: ApiRequestOptions): unknown => {\n\tif (options.body) {\n\t\treturn options.body;\n\t}\n\treturn undefined;\n};\n\nexport const sendRequest = async <T>(\n\tconfig: OpenAPIConfig,\n\toptions: ApiRequestOptions<T>,\n\turl: string,\n\tbody: unknown,\n\tformData: FormData | undefined,\n\theaders: Record<string, string>,\n\tonCancel: OnCancel,\n\taxiosClient: AxiosInstance\n): Promise<AxiosResponse<T>> => {\n\tconst controller = new AbortController();\n\n\tlet requestConfig: AxiosRequestConfig = {\n\t\tdata: body ?? formData,\n\t\theaders,\n\t\tmethod: options.method,\n\t\tsignal: controller.signal,\n\t\turl,\n\t\twithCredentials: config.WITH_CREDENTIALS,\n\t};\n\n\tonCancel(() => controller.abort());\n\n\tfor (const fn of config.interceptors.request._fns) {\n\t\trequestConfig = await fn(requestConfig);\n\t}\n\n\ttry {\n\t\treturn await axiosClient.request(requestConfig);\n\t} catch (error) {\n\t\tconst axiosError = error as AxiosError<T>;\n\t\tif (axiosError.response) {\n\t\t\treturn axiosError.response;\n\t\t}\n\t\tthrow error;\n\t}\n};\n\nexport const getResponseHeader = (response: AxiosResponse<unknown>, responseHeader?: string): string | undefined => {\n\tif (responseHeader) {\n\t\tconst content = response.headers[responseHeader];\n\t\tif (isString(content)) {\n\t\t\treturn content;\n\t\t}\n\t}\n\treturn undefined;\n};\n\nexport const getResponseBody = (response: AxiosResponse<unknown>): unknown => {\n\tif (response.status !== 204) {\n\t\treturn response.data;\n\t}\n\treturn undefined;\n};\n\nexport const catchErrorCodes = (options: ApiRequestOptions, result: ApiResult): void => {\n\tconst errors: Record<number, string> = {\n\t\t400: 'Bad Request',\n\t\t401: 'Unauthorized',\n\t\t402: 'Payment Required',\n\t\t403: 'Forbidden',\n\t\t404: 'Not Found',\n\t\t405: 'Method Not Allowed',\n\t\t406: 'Not Acceptable',\n\t\t407: 'Proxy Authentication Required',\n\t\t408: 'Request Timeout',\n\t\t409: 'Conflict',\n\t\t410: 'Gone',\n\t\t411: 'Length Required',\n\t\t412: 'Precondition Failed',\n\t\t413: 'Payload Too Large',\n\t\t414: 'URI Too Long',\n\t\t415: 'Unsupported Media Type',\n\t\t416: 'Range Not Satisfiable',\n\t\t417: 'Expectation Failed',\n\t\t418: 'Im a teapot',\n\t\t421: 'Misdirected Request',\n\t\t422: 'Unprocessable Content',\n\t\t423: 'Locked',\n\t\t424: 'Failed Dependency',\n\t\t425: 'Too Early',\n\t\t426: 'Upgrade Required',\n\t\t428: 'Precondition Required',\n\t\t429: 'Too Many Requests',\n\t\t431: 'Request Header Fields Too Large',\n\t\t451: 'Unavailable For Legal Reasons',\n\t\t500: 'Internal Server Error',\n\t\t501: 'Not Implemented',\n\t\t502: 'Bad Gateway',\n\t\t503: 'Service Unavailable',\n\t\t504: 'Gateway Timeout',\n\t\t505: 'HTTP Version Not Supported',\n\t\t506: 'Variant Also Negotiates',\n\t\t507: 'Insufficient Storage',\n\t\t508: 'Loop Detected',\n\t\t510: 'Not Extended',\n\t\t511: 'Network Authentication Required',\n\t\t...options.errors,\n\t}\n\n\tconst error = errors[result.status];\n\tif (error) {\n\t\tthrow new ApiError(options, result, error);\n\t}\n\n\tif (!result.ok) {\n\t\tconst errorStatus = result.status ?? 'unknown';\n\t\tconst errorStatusText = result.statusText ?? 'unknown';\n\t\tconst errorBody = (() => {\n\t\t\ttry {\n\t\t\t\treturn JSON.stringify(result.body, null, 2);\n\t\t\t} catch (e) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t})();\n\n\t\tthrow new ApiError(options, result,\n\t\t\t`Generic Error: status: ${errorStatus}; status text: ${errorStatusText}; body: ${errorBody}`\n\t\t);\n\t}\n};\n\n/**\n * Request method\n * @param config The OpenAPI configuration object\n * @param options The request options from the service\n * @param axiosClient The axios client instance to use\n * @returns CancelablePromise<T>\n * @throws ApiError\n */\nexport const request = <T>(config: OpenAPIConfig, options: ApiRequestOptions<T>, axiosClient: AxiosInstance = axios): CancelablePromise<T> => {\n\treturn new CancelablePromise(async (resolve, reject, onCancel) => {\n\t\ttry {\n\t\t\tconst url = getUrl(config, options);\n\t\t\tconst formData = getFormData(options);\n\t\t\tconst body = getRequestBody(options);\n\t\t\tconst headers = await getHeaders(config, options);\n\n\t\t\tif (!onCancel.isCancelled) {\n\t\t\t\tlet response = await sendRequest<T>(config, options, url, body, formData, headers, onCancel, axiosClient);\n\n\t\t\t\tfor (const fn of config.interceptors.response._fns) {\n\t\t\t\t\tresponse = await fn(response);\n\t\t\t\t}\n\n\t\t\t\tconst responseBody = getResponseBody(response);\n\t\t\t\tconst responseHeader = getResponseHeader(response, options.responseHeader);\n\n\t\t\t\tlet transformedBody = responseBody;\n\t\t\t\tif (options.responseTransformer && isSuccess(response.status)) {\n\t\t\t\t\ttransformedBody = await options.responseTransformer(responseBody)\n\t\t\t\t}\n\n\t\t\t\tconst result: ApiResult = {\n\t\t\t\t\turl,\n\t\t\t\t\tok: isSuccess(response.status),\n\t\t\t\t\tstatus: response.status,\n\t\t\t\t\tstatusText: response.statusText,\n\t\t\t\t\tbody: responseHeader ?? transformedBody,\n\t\t\t\t};\n\n\t\t\t\tcatchErrorCodes(options, result);\n\n\t\t\t\tresolve(result.body);\n\t\t\t}\n\t\t} catch (error) {\n\t\t\treject(error);\n\t\t}\n\t});\n};"
  },
  {
    "path": "frontend/src/client/index.ts",
    "content": "// This file is auto-generated by @hey-api/openapi-ts\nexport { ApiError } from './core/ApiError';\nexport { CancelablePromise, CancelError } from './core/CancelablePromise';\nexport { OpenAPI, type OpenAPIConfig } from './core/OpenAPI';\nexport * from './sdk.gen';\nexport * from './types.gen';"
  },
  {
    "path": "frontend/src/client/schemas.gen.ts",
    "content": "// This file is auto-generated by @hey-api/openapi-ts\n\nexport const Body_login_login_access_tokenSchema = {\n    properties: {\n        grant_type: {\n            anyOf: [\n                {\n                    type: 'string',\n                    pattern: '^password$'\n                },\n                {\n                    type: 'null'\n                }\n            ],\n            title: 'Grant Type'\n        },\n        username: {\n            type: 'string',\n            title: 'Username'\n        },\n        password: {\n            type: 'string',\n            format: 'password',\n            title: 'Password'\n        },\n        scope: {\n            type: 'string',\n            title: 'Scope',\n            default: ''\n        },\n        client_id: {\n            anyOf: [\n                {\n                    type: 'string'\n                },\n                {\n                    type: 'null'\n                }\n            ],\n            title: 'Client Id'\n        },\n        client_secret: {\n            anyOf: [\n                {\n                    type: 'string'\n                },\n                {\n                    type: 'null'\n                }\n            ],\n            format: 'password',\n            title: 'Client Secret'\n        }\n    },\n    type: 'object',\n    required: ['username', 'password'],\n    title: 'Body_login-login_access_token'\n} as const;\n\nexport const HTTPValidationErrorSchema = {\n    properties: {\n        detail: {\n            items: {\n                '$ref': '#/components/schemas/ValidationError'\n            },\n            type: 'array',\n            title: 'Detail'\n        }\n    },\n    type: 'object',\n    title: 'HTTPValidationError'\n} as const;\n\nexport const ItemCreateSchema = {\n    properties: {\n        title: {\n            type: 'string',\n            maxLength: 255,\n            minLength: 1,\n            title: 'Title'\n        },\n        description: {\n            anyOf: [\n                {\n                    type: 'string',\n                    maxLength: 255\n                },\n                {\n                    type: 'null'\n                }\n            ],\n            title: 'Description'\n        }\n    },\n    type: 'object',\n    required: ['title'],\n    title: 'ItemCreate'\n} as const;\n\nexport const ItemPublicSchema = {\n    properties: {\n        title: {\n            type: 'string',\n            maxLength: 255,\n            minLength: 1,\n            title: 'Title'\n        },\n        description: {\n            anyOf: [\n                {\n                    type: 'string',\n                    maxLength: 255\n                },\n                {\n                    type: 'null'\n                }\n            ],\n            title: 'Description'\n        },\n        id: {\n            type: 'string',\n            format: 'uuid',\n            title: 'Id'\n        },\n        owner_id: {\n            type: 'string',\n            format: 'uuid',\n            title: 'Owner Id'\n        },\n        created_at: {\n            anyOf: [\n                {\n                    type: 'string',\n                    format: 'date-time'\n                },\n                {\n                    type: 'null'\n                }\n            ],\n            title: 'Created At'\n        }\n    },\n    type: 'object',\n    required: ['title', 'id', 'owner_id'],\n    title: 'ItemPublic'\n} as const;\n\nexport const ItemUpdateSchema = {\n    properties: {\n        title: {\n            anyOf: [\n                {\n                    type: 'string',\n                    maxLength: 255,\n                    minLength: 1\n                },\n                {\n                    type: 'null'\n                }\n            ],\n            title: 'Title'\n        },\n        description: {\n            anyOf: [\n                {\n                    type: 'string',\n                    maxLength: 255\n                },\n                {\n                    type: 'null'\n                }\n            ],\n            title: 'Description'\n        }\n    },\n    type: 'object',\n    title: 'ItemUpdate'\n} as const;\n\nexport const ItemsPublicSchema = {\n    properties: {\n        data: {\n            items: {\n                '$ref': '#/components/schemas/ItemPublic'\n            },\n            type: 'array',\n            title: 'Data'\n        },\n        count: {\n            type: 'integer',\n            title: 'Count'\n        }\n    },\n    type: 'object',\n    required: ['data', 'count'],\n    title: 'ItemsPublic'\n} as const;\n\nexport const MessageSchema = {\n    properties: {\n        message: {\n            type: 'string',\n            title: 'Message'\n        }\n    },\n    type: 'object',\n    required: ['message'],\n    title: 'Message'\n} as const;\n\nexport const NewPasswordSchema = {\n    properties: {\n        token: {\n            type: 'string',\n            title: 'Token'\n        },\n        new_password: {\n            type: 'string',\n            maxLength: 128,\n            minLength: 8,\n            title: 'New Password'\n        }\n    },\n    type: 'object',\n    required: ['token', 'new_password'],\n    title: 'NewPassword'\n} as const;\n\nexport const PrivateUserCreateSchema = {\n    properties: {\n        email: {\n            type: 'string',\n            title: 'Email'\n        },\n        password: {\n            type: 'string',\n            title: 'Password'\n        },\n        full_name: {\n            type: 'string',\n            title: 'Full Name'\n        },\n        is_verified: {\n            type: 'boolean',\n            title: 'Is Verified',\n            default: false\n        }\n    },\n    type: 'object',\n    required: ['email', 'password', 'full_name'],\n    title: 'PrivateUserCreate'\n} as const;\n\nexport const TokenSchema = {\n    properties: {\n        access_token: {\n            type: 'string',\n            title: 'Access Token'\n        },\n        token_type: {\n            type: 'string',\n            title: 'Token Type',\n            default: 'bearer'\n        }\n    },\n    type: 'object',\n    required: ['access_token'],\n    title: 'Token'\n} as const;\n\nexport const UpdatePasswordSchema = {\n    properties: {\n        current_password: {\n            type: 'string',\n            maxLength: 128,\n            minLength: 8,\n            title: 'Current Password'\n        },\n        new_password: {\n            type: 'string',\n            maxLength: 128,\n            minLength: 8,\n            title: 'New Password'\n        }\n    },\n    type: 'object',\n    required: ['current_password', 'new_password'],\n    title: 'UpdatePassword'\n} as const;\n\nexport const UserCreateSchema = {\n    properties: {\n        email: {\n            type: 'string',\n            maxLength: 255,\n            format: 'email',\n            title: 'Email'\n        },\n        is_active: {\n            type: 'boolean',\n            title: 'Is Active',\n            default: true\n        },\n        is_superuser: {\n            type: 'boolean',\n            title: 'Is Superuser',\n            default: false\n        },\n        full_name: {\n            anyOf: [\n                {\n                    type: 'string',\n                    maxLength: 255\n                },\n                {\n                    type: 'null'\n                }\n            ],\n            title: 'Full Name'\n        },\n        password: {\n            type: 'string',\n            maxLength: 128,\n            minLength: 8,\n            title: 'Password'\n        }\n    },\n    type: 'object',\n    required: ['email', 'password'],\n    title: 'UserCreate'\n} as const;\n\nexport const UserPublicSchema = {\n    properties: {\n        email: {\n            type: 'string',\n            maxLength: 255,\n            format: 'email',\n            title: 'Email'\n        },\n        is_active: {\n            type: 'boolean',\n            title: 'Is Active',\n            default: true\n        },\n        is_superuser: {\n            type: 'boolean',\n            title: 'Is Superuser',\n            default: false\n        },\n        full_name: {\n            anyOf: [\n                {\n                    type: 'string',\n                    maxLength: 255\n                },\n                {\n                    type: 'null'\n                }\n            ],\n            title: 'Full Name'\n        },\n        id: {\n            type: 'string',\n            format: 'uuid',\n            title: 'Id'\n        },\n        created_at: {\n            anyOf: [\n                {\n                    type: 'string',\n                    format: 'date-time'\n                },\n                {\n                    type: 'null'\n                }\n            ],\n            title: 'Created At'\n        }\n    },\n    type: 'object',\n    required: ['email', 'id'],\n    title: 'UserPublic'\n} as const;\n\nexport const UserRegisterSchema = {\n    properties: {\n        email: {\n            type: 'string',\n            maxLength: 255,\n            format: 'email',\n            title: 'Email'\n        },\n        password: {\n            type: 'string',\n            maxLength: 128,\n            minLength: 8,\n            title: 'Password'\n        },\n        full_name: {\n            anyOf: [\n                {\n                    type: 'string',\n                    maxLength: 255\n                },\n                {\n                    type: 'null'\n                }\n            ],\n            title: 'Full Name'\n        }\n    },\n    type: 'object',\n    required: ['email', 'password'],\n    title: 'UserRegister'\n} as const;\n\nexport const UserUpdateSchema = {\n    properties: {\n        email: {\n            anyOf: [\n                {\n                    type: 'string',\n                    maxLength: 255,\n                    format: 'email'\n                },\n                {\n                    type: 'null'\n                }\n            ],\n            title: 'Email'\n        },\n        is_active: {\n            type: 'boolean',\n            title: 'Is Active',\n            default: true\n        },\n        is_superuser: {\n            type: 'boolean',\n            title: 'Is Superuser',\n            default: false\n        },\n        full_name: {\n            anyOf: [\n                {\n                    type: 'string',\n                    maxLength: 255\n                },\n                {\n                    type: 'null'\n                }\n            ],\n            title: 'Full Name'\n        },\n        password: {\n            anyOf: [\n                {\n                    type: 'string',\n                    maxLength: 128,\n                    minLength: 8\n                },\n                {\n                    type: 'null'\n                }\n            ],\n            title: 'Password'\n        }\n    },\n    type: 'object',\n    title: 'UserUpdate'\n} as const;\n\nexport const UserUpdateMeSchema = {\n    properties: {\n        full_name: {\n            anyOf: [\n                {\n                    type: 'string',\n                    maxLength: 255\n                },\n                {\n                    type: 'null'\n                }\n            ],\n            title: 'Full Name'\n        },\n        email: {\n            anyOf: [\n                {\n                    type: 'string',\n                    maxLength: 255,\n                    format: 'email'\n                },\n                {\n                    type: 'null'\n                }\n            ],\n            title: 'Email'\n        }\n    },\n    type: 'object',\n    title: 'UserUpdateMe'\n} as const;\n\nexport const UsersPublicSchema = {\n    properties: {\n        data: {\n            items: {\n                '$ref': '#/components/schemas/UserPublic'\n            },\n            type: 'array',\n            title: 'Data'\n        },\n        count: {\n            type: 'integer',\n            title: 'Count'\n        }\n    },\n    type: 'object',\n    required: ['data', 'count'],\n    title: 'UsersPublic'\n} as const;\n\nexport const ValidationErrorSchema = {\n    properties: {\n        loc: {\n            items: {\n                anyOf: [\n                    {\n                        type: 'string'\n                    },\n                    {\n                        type: 'integer'\n                    }\n                ]\n            },\n            type: 'array',\n            title: 'Location'\n        },\n        msg: {\n            type: 'string',\n            title: 'Message'\n        },\n        type: {\n            type: 'string',\n            title: 'Error Type'\n        },\n        input: {\n            title: 'Input'\n        },\n        ctx: {\n            type: 'object',\n            title: 'Context'\n        }\n    },\n    type: 'object',\n    required: ['loc', 'msg', 'type'],\n    title: 'ValidationError'\n} as const;"
  },
  {
    "path": "frontend/src/client/sdk.gen.ts",
    "content": "// This file is auto-generated by @hey-api/openapi-ts\n\nimport type { CancelablePromise } from './core/CancelablePromise';\nimport { OpenAPI } from './core/OpenAPI';\nimport { request as __request } from './core/request';\nimport type { ItemsReadItemsData, ItemsReadItemsResponse, ItemsCreateItemData, ItemsCreateItemResponse, ItemsReadItemData, ItemsReadItemResponse, ItemsUpdateItemData, ItemsUpdateItemResponse, ItemsDeleteItemData, ItemsDeleteItemResponse, LoginLoginAccessTokenData, LoginLoginAccessTokenResponse, LoginTestTokenResponse, LoginRecoverPasswordData, LoginRecoverPasswordResponse, LoginResetPasswordData, LoginResetPasswordResponse, LoginRecoverPasswordHtmlContentData, LoginRecoverPasswordHtmlContentResponse, PrivateCreateUserData, PrivateCreateUserResponse, UsersReadUsersData, UsersReadUsersResponse, UsersCreateUserData, UsersCreateUserResponse, UsersReadUserMeResponse, UsersDeleteUserMeResponse, UsersUpdateUserMeData, UsersUpdateUserMeResponse, UsersUpdatePasswordMeData, UsersUpdatePasswordMeResponse, UsersRegisterUserData, UsersRegisterUserResponse, UsersReadUserByIdData, UsersReadUserByIdResponse, UsersUpdateUserData, UsersUpdateUserResponse, UsersDeleteUserData, UsersDeleteUserResponse, UtilsTestEmailData, UtilsTestEmailResponse, UtilsHealthCheckResponse } from './types.gen';\n\nexport class ItemsService {\n    /**\n     * Read Items\n     * Retrieve items.\n     * @param data The data for the request.\n     * @param data.skip\n     * @param data.limit\n     * @returns ItemsPublic Successful Response\n     * @throws ApiError\n     */\n    public static readItems(data: ItemsReadItemsData = {}): CancelablePromise<ItemsReadItemsResponse> {\n        return __request(OpenAPI, {\n            method: 'GET',\n            url: '/api/v1/items/',\n            query: {\n                skip: data.skip,\n                limit: data.limit\n            },\n            errors: {\n                422: 'Validation Error'\n            }\n        });\n    }\n    \n    /**\n     * Create Item\n     * Create new item.\n     * @param data The data for the request.\n     * @param data.requestBody\n     * @returns ItemPublic Successful Response\n     * @throws ApiError\n     */\n    public static createItem(data: ItemsCreateItemData): CancelablePromise<ItemsCreateItemResponse> {\n        return __request(OpenAPI, {\n            method: 'POST',\n            url: '/api/v1/items/',\n            body: data.requestBody,\n            mediaType: 'application/json',\n            errors: {\n                422: 'Validation Error'\n            }\n        });\n    }\n    \n    /**\n     * Read Item\n     * Get item by ID.\n     * @param data The data for the request.\n     * @param data.id\n     * @returns ItemPublic Successful Response\n     * @throws ApiError\n     */\n    public static readItem(data: ItemsReadItemData): CancelablePromise<ItemsReadItemResponse> {\n        return __request(OpenAPI, {\n            method: 'GET',\n            url: '/api/v1/items/{id}',\n            path: {\n                id: data.id\n            },\n            errors: {\n                422: 'Validation Error'\n            }\n        });\n    }\n    \n    /**\n     * Update Item\n     * Update an item.\n     * @param data The data for the request.\n     * @param data.id\n     * @param data.requestBody\n     * @returns ItemPublic Successful Response\n     * @throws ApiError\n     */\n    public static updateItem(data: ItemsUpdateItemData): CancelablePromise<ItemsUpdateItemResponse> {\n        return __request(OpenAPI, {\n            method: 'PUT',\n            url: '/api/v1/items/{id}',\n            path: {\n                id: data.id\n            },\n            body: data.requestBody,\n            mediaType: 'application/json',\n            errors: {\n                422: 'Validation Error'\n            }\n        });\n    }\n    \n    /**\n     * Delete Item\n     * Delete an item.\n     * @param data The data for the request.\n     * @param data.id\n     * @returns Message Successful Response\n     * @throws ApiError\n     */\n    public static deleteItem(data: ItemsDeleteItemData): CancelablePromise<ItemsDeleteItemResponse> {\n        return __request(OpenAPI, {\n            method: 'DELETE',\n            url: '/api/v1/items/{id}',\n            path: {\n                id: data.id\n            },\n            errors: {\n                422: 'Validation Error'\n            }\n        });\n    }\n}\n\nexport class LoginService {\n    /**\n     * Login Access Token\n     * OAuth2 compatible token login, get an access token for future requests\n     * @param data The data for the request.\n     * @param data.formData\n     * @returns Token Successful Response\n     * @throws ApiError\n     */\n    public static loginAccessToken(data: LoginLoginAccessTokenData): CancelablePromise<LoginLoginAccessTokenResponse> {\n        return __request(OpenAPI, {\n            method: 'POST',\n            url: '/api/v1/login/access-token',\n            formData: data.formData,\n            mediaType: 'application/x-www-form-urlencoded',\n            errors: {\n                422: 'Validation Error'\n            }\n        });\n    }\n    \n    /**\n     * Test Token\n     * Test access token\n     * @returns UserPublic Successful Response\n     * @throws ApiError\n     */\n    public static testToken(): CancelablePromise<LoginTestTokenResponse> {\n        return __request(OpenAPI, {\n            method: 'POST',\n            url: '/api/v1/login/test-token'\n        });\n    }\n    \n    /**\n     * Recover Password\n     * Password Recovery\n     * @param data The data for the request.\n     * @param data.email\n     * @returns Message Successful Response\n     * @throws ApiError\n     */\n    public static recoverPassword(data: LoginRecoverPasswordData): CancelablePromise<LoginRecoverPasswordResponse> {\n        return __request(OpenAPI, {\n            method: 'POST',\n            url: '/api/v1/password-recovery/{email}',\n            path: {\n                email: data.email\n            },\n            errors: {\n                422: 'Validation Error'\n            }\n        });\n    }\n    \n    /**\n     * Reset Password\n     * Reset password\n     * @param data The data for the request.\n     * @param data.requestBody\n     * @returns Message Successful Response\n     * @throws ApiError\n     */\n    public static resetPassword(data: LoginResetPasswordData): CancelablePromise<LoginResetPasswordResponse> {\n        return __request(OpenAPI, {\n            method: 'POST',\n            url: '/api/v1/reset-password/',\n            body: data.requestBody,\n            mediaType: 'application/json',\n            errors: {\n                422: 'Validation Error'\n            }\n        });\n    }\n    \n    /**\n     * Recover Password Html Content\n     * HTML Content for Password Recovery\n     * @param data The data for the request.\n     * @param data.email\n     * @returns string Successful Response\n     * @throws ApiError\n     */\n    public static recoverPasswordHtmlContent(data: LoginRecoverPasswordHtmlContentData): CancelablePromise<LoginRecoverPasswordHtmlContentResponse> {\n        return __request(OpenAPI, {\n            method: 'POST',\n            url: '/api/v1/password-recovery-html-content/{email}',\n            path: {\n                email: data.email\n            },\n            errors: {\n                422: 'Validation Error'\n            }\n        });\n    }\n}\n\nexport class PrivateService {\n    /**\n     * Create User\n     * Create a new user.\n     * @param data The data for the request.\n     * @param data.requestBody\n     * @returns UserPublic Successful Response\n     * @throws ApiError\n     */\n    public static createUser(data: PrivateCreateUserData): CancelablePromise<PrivateCreateUserResponse> {\n        return __request(OpenAPI, {\n            method: 'POST',\n            url: '/api/v1/private/users/',\n            body: data.requestBody,\n            mediaType: 'application/json',\n            errors: {\n                422: 'Validation Error'\n            }\n        });\n    }\n}\n\nexport class UsersService {\n    /**\n     * Read Users\n     * Retrieve users.\n     * @param data The data for the request.\n     * @param data.skip\n     * @param data.limit\n     * @returns UsersPublic Successful Response\n     * @throws ApiError\n     */\n    public static readUsers(data: UsersReadUsersData = {}): CancelablePromise<UsersReadUsersResponse> {\n        return __request(OpenAPI, {\n            method: 'GET',\n            url: '/api/v1/users/',\n            query: {\n                skip: data.skip,\n                limit: data.limit\n            },\n            errors: {\n                422: 'Validation Error'\n            }\n        });\n    }\n    \n    /**\n     * Create User\n     * Create new user.\n     * @param data The data for the request.\n     * @param data.requestBody\n     * @returns UserPublic Successful Response\n     * @throws ApiError\n     */\n    public static createUser(data: UsersCreateUserData): CancelablePromise<UsersCreateUserResponse> {\n        return __request(OpenAPI, {\n            method: 'POST',\n            url: '/api/v1/users/',\n            body: data.requestBody,\n            mediaType: 'application/json',\n            errors: {\n                422: 'Validation Error'\n            }\n        });\n    }\n    \n    /**\n     * Read User Me\n     * Get current user.\n     * @returns UserPublic Successful Response\n     * @throws ApiError\n     */\n    public static readUserMe(): CancelablePromise<UsersReadUserMeResponse> {\n        return __request(OpenAPI, {\n            method: 'GET',\n            url: '/api/v1/users/me'\n        });\n    }\n    \n    /**\n     * Delete User Me\n     * Delete own user.\n     * @returns Message Successful Response\n     * @throws ApiError\n     */\n    public static deleteUserMe(): CancelablePromise<UsersDeleteUserMeResponse> {\n        return __request(OpenAPI, {\n            method: 'DELETE',\n            url: '/api/v1/users/me'\n        });\n    }\n    \n    /**\n     * Update User Me\n     * Update own user.\n     * @param data The data for the request.\n     * @param data.requestBody\n     * @returns UserPublic Successful Response\n     * @throws ApiError\n     */\n    public static updateUserMe(data: UsersUpdateUserMeData): CancelablePromise<UsersUpdateUserMeResponse> {\n        return __request(OpenAPI, {\n            method: 'PATCH',\n            url: '/api/v1/users/me',\n            body: data.requestBody,\n            mediaType: 'application/json',\n            errors: {\n                422: 'Validation Error'\n            }\n        });\n    }\n    \n    /**\n     * Update Password Me\n     * Update own password.\n     * @param data The data for the request.\n     * @param data.requestBody\n     * @returns Message Successful Response\n     * @throws ApiError\n     */\n    public static updatePasswordMe(data: UsersUpdatePasswordMeData): CancelablePromise<UsersUpdatePasswordMeResponse> {\n        return __request(OpenAPI, {\n            method: 'PATCH',\n            url: '/api/v1/users/me/password',\n            body: data.requestBody,\n            mediaType: 'application/json',\n            errors: {\n                422: 'Validation Error'\n            }\n        });\n    }\n    \n    /**\n     * Register User\n     * Create new user without the need to be logged in.\n     * @param data The data for the request.\n     * @param data.requestBody\n     * @returns UserPublic Successful Response\n     * @throws ApiError\n     */\n    public static registerUser(data: UsersRegisterUserData): CancelablePromise<UsersRegisterUserResponse> {\n        return __request(OpenAPI, {\n            method: 'POST',\n            url: '/api/v1/users/signup',\n            body: data.requestBody,\n            mediaType: 'application/json',\n            errors: {\n                422: 'Validation Error'\n            }\n        });\n    }\n    \n    /**\n     * Read User By Id\n     * Get a specific user by id.\n     * @param data The data for the request.\n     * @param data.userId\n     * @returns UserPublic Successful Response\n     * @throws ApiError\n     */\n    public static readUserById(data: UsersReadUserByIdData): CancelablePromise<UsersReadUserByIdResponse> {\n        return __request(OpenAPI, {\n            method: 'GET',\n            url: '/api/v1/users/{user_id}',\n            path: {\n                user_id: data.userId\n            },\n            errors: {\n                422: 'Validation Error'\n            }\n        });\n    }\n    \n    /**\n     * Update User\n     * Update a user.\n     * @param data The data for the request.\n     * @param data.userId\n     * @param data.requestBody\n     * @returns UserPublic Successful Response\n     * @throws ApiError\n     */\n    public static updateUser(data: UsersUpdateUserData): CancelablePromise<UsersUpdateUserResponse> {\n        return __request(OpenAPI, {\n            method: 'PATCH',\n            url: '/api/v1/users/{user_id}',\n            path: {\n                user_id: data.userId\n            },\n            body: data.requestBody,\n            mediaType: 'application/json',\n            errors: {\n                422: 'Validation Error'\n            }\n        });\n    }\n    \n    /**\n     * Delete User\n     * Delete a user.\n     * @param data The data for the request.\n     * @param data.userId\n     * @returns Message Successful Response\n     * @throws ApiError\n     */\n    public static deleteUser(data: UsersDeleteUserData): CancelablePromise<UsersDeleteUserResponse> {\n        return __request(OpenAPI, {\n            method: 'DELETE',\n            url: '/api/v1/users/{user_id}',\n            path: {\n                user_id: data.userId\n            },\n            errors: {\n                422: 'Validation Error'\n            }\n        });\n    }\n}\n\nexport class UtilsService {\n    /**\n     * Test Email\n     * Test emails.\n     * @param data The data for the request.\n     * @param data.emailTo\n     * @returns Message Successful Response\n     * @throws ApiError\n     */\n    public static testEmail(data: UtilsTestEmailData): CancelablePromise<UtilsTestEmailResponse> {\n        return __request(OpenAPI, {\n            method: 'POST',\n            url: '/api/v1/utils/test-email/',\n            query: {\n                email_to: data.emailTo\n            },\n            errors: {\n                422: 'Validation Error'\n            }\n        });\n    }\n    \n    /**\n     * Health Check\n     * @returns boolean Successful Response\n     * @throws ApiError\n     */\n    public static healthCheck(): CancelablePromise<UtilsHealthCheckResponse> {\n        return __request(OpenAPI, {\n            method: 'GET',\n            url: '/api/v1/utils/health-check/'\n        });\n    }\n}"
  },
  {
    "path": "frontend/src/client/types.gen.ts",
    "content": "// This file is auto-generated by @hey-api/openapi-ts\n\nexport type Body_login_login_access_token = {\n    grant_type?: (string | null);\n    username: string;\n    password: string;\n    scope?: string;\n    client_id?: (string | null);\n    client_secret?: (string | null);\n};\n\nexport type HTTPValidationError = {\n    detail?: Array<ValidationError>;\n};\n\nexport type ItemCreate = {\n    title: string;\n    description?: (string | null);\n};\n\nexport type ItemPublic = {\n    title: string;\n    description?: (string | null);\n    id: string;\n    owner_id: string;\n    created_at?: (string | null);\n};\n\nexport type ItemsPublic = {\n    data: Array<ItemPublic>;\n    count: number;\n};\n\nexport type ItemUpdate = {\n    title?: (string | null);\n    description?: (string | null);\n};\n\nexport type Message = {\n    message: string;\n};\n\nexport type NewPassword = {\n    token: string;\n    new_password: string;\n};\n\nexport type PrivateUserCreate = {\n    email: string;\n    password: string;\n    full_name: string;\n    is_verified?: boolean;\n};\n\nexport type Token = {\n    access_token: string;\n    token_type?: string;\n};\n\nexport type UpdatePassword = {\n    current_password: string;\n    new_password: string;\n};\n\nexport type UserCreate = {\n    email: string;\n    is_active?: boolean;\n    is_superuser?: boolean;\n    full_name?: (string | null);\n    password: string;\n};\n\nexport type UserPublic = {\n    email: string;\n    is_active?: boolean;\n    is_superuser?: boolean;\n    full_name?: (string | null);\n    id: string;\n    created_at?: (string | null);\n};\n\nexport type UserRegister = {\n    email: string;\n    password: string;\n    full_name?: (string | null);\n};\n\nexport type UsersPublic = {\n    data: Array<UserPublic>;\n    count: number;\n};\n\nexport type UserUpdate = {\n    email?: (string | null);\n    is_active?: boolean;\n    is_superuser?: boolean;\n    full_name?: (string | null);\n    password?: (string | null);\n};\n\nexport type UserUpdateMe = {\n    full_name?: (string | null);\n    email?: (string | null);\n};\n\nexport type ValidationError = {\n    loc: Array<(string | number)>;\n    msg: string;\n    type: string;\n    input?: unknown;\n    ctx?: {\n        [key: string]: unknown;\n    };\n};\n\nexport type ItemsReadItemsData = {\n    limit?: number;\n    skip?: number;\n};\n\nexport type ItemsReadItemsResponse = (ItemsPublic);\n\nexport type ItemsCreateItemData = {\n    requestBody: ItemCreate;\n};\n\nexport type ItemsCreateItemResponse = (ItemPublic);\n\nexport type ItemsReadItemData = {\n    id: string;\n};\n\nexport type ItemsReadItemResponse = (ItemPublic);\n\nexport type ItemsUpdateItemData = {\n    id: string;\n    requestBody: ItemUpdate;\n};\n\nexport type ItemsUpdateItemResponse = (ItemPublic);\n\nexport type ItemsDeleteItemData = {\n    id: string;\n};\n\nexport type ItemsDeleteItemResponse = (Message);\n\nexport type LoginLoginAccessTokenData = {\n    formData: Body_login_login_access_token;\n};\n\nexport type LoginLoginAccessTokenResponse = (Token);\n\nexport type LoginTestTokenResponse = (UserPublic);\n\nexport type LoginRecoverPasswordData = {\n    email: string;\n};\n\nexport type LoginRecoverPasswordResponse = (Message);\n\nexport type LoginResetPasswordData = {\n    requestBody: NewPassword;\n};\n\nexport type LoginResetPasswordResponse = (Message);\n\nexport type LoginRecoverPasswordHtmlContentData = {\n    email: string;\n};\n\nexport type LoginRecoverPasswordHtmlContentResponse = (string);\n\nexport type PrivateCreateUserData = {\n    requestBody: PrivateUserCreate;\n};\n\nexport type PrivateCreateUserResponse = (UserPublic);\n\nexport type UsersReadUsersData = {\n    limit?: number;\n    skip?: number;\n};\n\nexport type UsersReadUsersResponse = (UsersPublic);\n\nexport type UsersCreateUserData = {\n    requestBody: UserCreate;\n};\n\nexport type UsersCreateUserResponse = (UserPublic);\n\nexport type UsersReadUserMeResponse = (UserPublic);\n\nexport type UsersDeleteUserMeResponse = (Message);\n\nexport type UsersUpdateUserMeData = {\n    requestBody: UserUpdateMe;\n};\n\nexport type UsersUpdateUserMeResponse = (UserPublic);\n\nexport type UsersUpdatePasswordMeData = {\n    requestBody: UpdatePassword;\n};\n\nexport type UsersUpdatePasswordMeResponse = (Message);\n\nexport type UsersRegisterUserData = {\n    requestBody: UserRegister;\n};\n\nexport type UsersRegisterUserResponse = (UserPublic);\n\nexport type UsersReadUserByIdData = {\n    userId: string;\n};\n\nexport type UsersReadUserByIdResponse = (UserPublic);\n\nexport type UsersUpdateUserData = {\n    requestBody: UserUpdate;\n    userId: string;\n};\n\nexport type UsersUpdateUserResponse = (UserPublic);\n\nexport type UsersDeleteUserData = {\n    userId: string;\n};\n\nexport type UsersDeleteUserResponse = (Message);\n\nexport type UtilsTestEmailData = {\n    emailTo: string;\n};\n\nexport type UtilsTestEmailResponse = (Message);\n\nexport type UtilsHealthCheckResponse = (boolean);"
  },
  {
    "path": "frontend/src/components/Admin/AddUser.tsx",
    "content": "import { zodResolver } from \"@hookform/resolvers/zod\"\nimport { useMutation, useQueryClient } from \"@tanstack/react-query\"\nimport { Plus } from \"lucide-react\"\nimport { useState } from \"react\"\nimport { useForm } from \"react-hook-form\"\nimport { z } from \"zod\"\n\nimport { type UserCreate, UsersService } from \"@/client\"\nimport { Button } from \"@/components/ui/button\"\nimport { Checkbox } from \"@/components/ui/checkbox\"\nimport {\n  Dialog,\n  DialogClose,\n  DialogContent,\n  DialogDescription,\n  DialogFooter,\n  DialogHeader,\n  DialogTitle,\n  DialogTrigger,\n} from \"@/components/ui/dialog\"\nimport {\n  Form,\n  FormControl,\n  FormField,\n  FormItem,\n  FormLabel,\n  FormMessage,\n} from \"@/components/ui/form\"\nimport { Input } from \"@/components/ui/input\"\nimport { LoadingButton } from \"@/components/ui/loading-button\"\nimport useCustomToast from \"@/hooks/useCustomToast\"\nimport { handleError } from \"@/utils\"\n\nconst formSchema = z\n  .object({\n    email: z.email({ message: \"Invalid email address\" }),\n    full_name: z.string().optional(),\n    password: z\n      .string()\n      .min(1, { message: \"Password is required\" })\n      .min(8, { message: \"Password must be at least 8 characters\" }),\n    confirm_password: z\n      .string()\n      .min(1, { message: \"Please confirm your password\" }),\n    is_superuser: z.boolean(),\n    is_active: z.boolean(),\n  })\n  .refine((data) => data.password === data.confirm_password, {\n    message: \"The passwords don't match\",\n    path: [\"confirm_password\"],\n  })\n\ntype FormData = z.infer<typeof formSchema>\n\nconst AddUser = () => {\n  const [isOpen, setIsOpen] = useState(false)\n  const queryClient = useQueryClient()\n  const { showSuccessToast, showErrorToast } = useCustomToast()\n\n  const form = useForm<FormData>({\n    resolver: zodResolver(formSchema),\n    mode: \"onBlur\",\n    criteriaMode: \"all\",\n    defaultValues: {\n      email: \"\",\n      full_name: \"\",\n      password: \"\",\n      confirm_password: \"\",\n      is_superuser: false,\n      is_active: false,\n    },\n  })\n\n  const mutation = useMutation({\n    mutationFn: (data: UserCreate) =>\n      UsersService.createUser({ requestBody: data }),\n    onSuccess: () => {\n      showSuccessToast(\"User created successfully\")\n      form.reset()\n      setIsOpen(false)\n    },\n    onError: handleError.bind(showErrorToast),\n    onSettled: () => {\n      queryClient.invalidateQueries({ queryKey: [\"users\"] })\n    },\n  })\n\n  const onSubmit = (data: FormData) => {\n    mutation.mutate(data)\n  }\n\n  return (\n    <Dialog open={isOpen} onOpenChange={setIsOpen}>\n      <DialogTrigger asChild>\n        <Button className=\"my-4\">\n          <Plus className=\"mr-2\" />\n          Add User\n        </Button>\n      </DialogTrigger>\n      <DialogContent className=\"sm:max-w-md\">\n        <DialogHeader>\n          <DialogTitle>Add User</DialogTitle>\n          <DialogDescription>\n            Fill in the form below to add a new user to the system.\n          </DialogDescription>\n        </DialogHeader>\n        <Form {...form}>\n          <form onSubmit={form.handleSubmit(onSubmit)}>\n            <div className=\"grid gap-4 py-4\">\n              <FormField\n                control={form.control}\n                name=\"email\"\n                render={({ field }) => (\n                  <FormItem>\n                    <FormLabel>\n                      Email <span className=\"text-destructive\">*</span>\n                    </FormLabel>\n                    <FormControl>\n                      <Input\n                        placeholder=\"Email\"\n                        type=\"email\"\n                        {...field}\n                        required\n                      />\n                    </FormControl>\n                    <FormMessage />\n                  </FormItem>\n                )}\n              />\n\n              <FormField\n                control={form.control}\n                name=\"full_name\"\n                render={({ field }) => (\n                  <FormItem>\n                    <FormLabel>Full Name</FormLabel>\n                    <FormControl>\n                      <Input placeholder=\"Full name\" type=\"text\" {...field} />\n                    </FormControl>\n                    <FormMessage />\n                  </FormItem>\n                )}\n              />\n\n              <FormField\n                control={form.control}\n                name=\"password\"\n                render={({ field }) => (\n                  <FormItem>\n                    <FormLabel>\n                      Set Password <span className=\"text-destructive\">*</span>\n                    </FormLabel>\n                    <FormControl>\n                      <Input\n                        placeholder=\"Password\"\n                        type=\"password\"\n                        {...field}\n                        required\n                      />\n                    </FormControl>\n                    <FormMessage />\n                  </FormItem>\n                )}\n              />\n\n              <FormField\n                control={form.control}\n                name=\"confirm_password\"\n                render={({ field }) => (\n                  <FormItem>\n                    <FormLabel>\n                      Confirm Password{\" \"}\n                      <span className=\"text-destructive\">*</span>\n                    </FormLabel>\n                    <FormControl>\n                      <Input\n                        placeholder=\"Password\"\n                        type=\"password\"\n                        {...field}\n                        required\n                      />\n                    </FormControl>\n                    <FormMessage />\n                  </FormItem>\n                )}\n              />\n\n              <FormField\n                control={form.control}\n                name=\"is_superuser\"\n                render={({ field }) => (\n                  <FormItem className=\"flex items-center gap-3 space-y-0\">\n                    <FormControl>\n                      <Checkbox\n                        checked={field.value}\n                        onCheckedChange={field.onChange}\n                      />\n                    </FormControl>\n                    <FormLabel className=\"font-normal\">Is superuser?</FormLabel>\n                  </FormItem>\n                )}\n              />\n\n              <FormField\n                control={form.control}\n                name=\"is_active\"\n                render={({ field }) => (\n                  <FormItem className=\"flex items-center gap-3 space-y-0\">\n                    <FormControl>\n                      <Checkbox\n                        checked={field.value}\n                        onCheckedChange={field.onChange}\n                      />\n                    </FormControl>\n                    <FormLabel className=\"font-normal\">Is active?</FormLabel>\n                  </FormItem>\n                )}\n              />\n            </div>\n\n            <DialogFooter>\n              <DialogClose asChild>\n                <Button variant=\"outline\" disabled={mutation.isPending}>\n                  Cancel\n                </Button>\n              </DialogClose>\n              <LoadingButton type=\"submit\" loading={mutation.isPending}>\n                Save\n              </LoadingButton>\n            </DialogFooter>\n          </form>\n        </Form>\n      </DialogContent>\n    </Dialog>\n  )\n}\n\nexport default AddUser\n"
  },
  {
    "path": "frontend/src/components/Admin/DeleteUser.tsx",
    "content": "import { useMutation, useQueryClient } from \"@tanstack/react-query\"\nimport { Trash2 } from \"lucide-react\"\nimport { useState } from \"react\"\nimport { useForm } from \"react-hook-form\"\n\nimport { UsersService } from \"@/client\"\nimport { Button } from \"@/components/ui/button\"\nimport {\n  Dialog,\n  DialogClose,\n  DialogContent,\n  DialogDescription,\n  DialogFooter,\n  DialogHeader,\n  DialogTitle,\n} from \"@/components/ui/dialog\"\nimport { DropdownMenuItem } from \"@/components/ui/dropdown-menu\"\nimport { LoadingButton } from \"@/components/ui/loading-button\"\nimport useCustomToast from \"@/hooks/useCustomToast\"\nimport { handleError } from \"@/utils\"\n\ninterface DeleteUserProps {\n  id: string\n  onSuccess: () => void\n}\n\nconst DeleteUser = ({ id, onSuccess }: DeleteUserProps) => {\n  const [isOpen, setIsOpen] = useState(false)\n  const queryClient = useQueryClient()\n  const { showSuccessToast, showErrorToast } = useCustomToast()\n  const { handleSubmit } = useForm()\n\n  const deleteUser = async (id: string) => {\n    await UsersService.deleteUser({ userId: id })\n  }\n\n  const mutation = useMutation({\n    mutationFn: deleteUser,\n    onSuccess: () => {\n      showSuccessToast(\"The user was deleted successfully\")\n      setIsOpen(false)\n      onSuccess()\n    },\n    onError: handleError.bind(showErrorToast),\n    onSettled: () => {\n      queryClient.invalidateQueries()\n    },\n  })\n\n  const onSubmit = async () => {\n    mutation.mutate(id)\n  }\n\n  return (\n    <Dialog open={isOpen} onOpenChange={setIsOpen}>\n      <DropdownMenuItem\n        variant=\"destructive\"\n        onSelect={(e) => e.preventDefault()}\n        onClick={() => setIsOpen(true)}\n      >\n        <Trash2 />\n        Delete User\n      </DropdownMenuItem>\n      <DialogContent className=\"sm:max-w-md\">\n        <form onSubmit={handleSubmit(onSubmit)}>\n          <DialogHeader>\n            <DialogTitle>Delete User</DialogTitle>\n            <DialogDescription>\n              All items associated with this user will also be{\" \"}\n              <strong>permanently deleted.</strong> Are you sure? You will not\n              be able to undo this action.\n            </DialogDescription>\n          </DialogHeader>\n\n          <DialogFooter className=\"mt-4\">\n            <DialogClose asChild>\n              <Button variant=\"outline\" disabled={mutation.isPending}>\n                Cancel\n              </Button>\n            </DialogClose>\n            <LoadingButton\n              variant=\"destructive\"\n              type=\"submit\"\n              loading={mutation.isPending}\n            >\n              Delete\n            </LoadingButton>\n          </DialogFooter>\n        </form>\n      </DialogContent>\n    </Dialog>\n  )\n}\n\nexport default DeleteUser\n"
  },
  {
    "path": "frontend/src/components/Admin/EditUser.tsx",
    "content": "import { zodResolver } from \"@hookform/resolvers/zod\"\nimport { useMutation, useQueryClient } from \"@tanstack/react-query\"\nimport { Pencil } from \"lucide-react\"\nimport { useState } from \"react\"\nimport { useForm } from \"react-hook-form\"\nimport { z } from \"zod\"\n\nimport { type UserPublic, UsersService } from \"@/client\"\nimport { Button } from \"@/components/ui/button\"\nimport { Checkbox } from \"@/components/ui/checkbox\"\nimport {\n  Dialog,\n  DialogClose,\n  DialogContent,\n  DialogDescription,\n  DialogFooter,\n  DialogHeader,\n  DialogTitle,\n} from \"@/components/ui/dialog\"\nimport { DropdownMenuItem } from \"@/components/ui/dropdown-menu\"\nimport {\n  Form,\n  FormControl,\n  FormField,\n  FormItem,\n  FormLabel,\n  FormMessage,\n} from \"@/components/ui/form\"\nimport { Input } from \"@/components/ui/input\"\nimport { LoadingButton } from \"@/components/ui/loading-button\"\nimport useCustomToast from \"@/hooks/useCustomToast\"\nimport { handleError } from \"@/utils\"\n\nconst formSchema = z\n  .object({\n    email: z.email({ message: \"Invalid email address\" }),\n    full_name: z.string().optional(),\n    password: z\n      .string()\n      .min(8, { message: \"Password must be at least 8 characters\" })\n      .optional()\n      .or(z.literal(\"\")),\n    confirm_password: z.string().optional(),\n    is_superuser: z.boolean().optional(),\n    is_active: z.boolean().optional(),\n  })\n  .refine((data) => !data.password || data.password === data.confirm_password, {\n    message: \"The passwords don't match\",\n    path: [\"confirm_password\"],\n  })\n\ntype FormData = z.infer<typeof formSchema>\n\ninterface EditUserProps {\n  user: UserPublic\n  onSuccess: () => void\n}\n\nconst EditUser = ({ user, onSuccess }: EditUserProps) => {\n  const [isOpen, setIsOpen] = useState(false)\n  const queryClient = useQueryClient()\n  const { showSuccessToast, showErrorToast } = useCustomToast()\n\n  const form = useForm<FormData>({\n    resolver: zodResolver(formSchema),\n    mode: \"onBlur\",\n    criteriaMode: \"all\",\n    defaultValues: {\n      email: user.email,\n      full_name: user.full_name ?? undefined,\n      is_superuser: user.is_superuser,\n      is_active: user.is_active,\n    },\n  })\n\n  const mutation = useMutation({\n    mutationFn: (data: FormData) =>\n      UsersService.updateUser({ userId: user.id, requestBody: data }),\n    onSuccess: () => {\n      showSuccessToast(\"User updated successfully\")\n      setIsOpen(false)\n      onSuccess()\n    },\n    onError: handleError.bind(showErrorToast),\n    onSettled: () => {\n      queryClient.invalidateQueries({ queryKey: [\"users\"] })\n    },\n  })\n\n  const onSubmit = (data: FormData) => {\n    // exclude confirm_password from submission data and remove password if empty\n    const { confirm_password: _, ...submitData } = data\n    if (!submitData.password) {\n      delete submitData.password\n    }\n    mutation.mutate(submitData)\n  }\n\n  return (\n    <Dialog open={isOpen} onOpenChange={setIsOpen}>\n      <DropdownMenuItem\n        onSelect={(e) => e.preventDefault()}\n        onClick={() => setIsOpen(true)}\n      >\n        <Pencil />\n        Edit User\n      </DropdownMenuItem>\n      <DialogContent className=\"sm:max-w-md\">\n        <Form {...form}>\n          <form onSubmit={form.handleSubmit(onSubmit)}>\n            <DialogHeader>\n              <DialogTitle>Edit User</DialogTitle>\n              <DialogDescription>\n                Update the user details below.\n              </DialogDescription>\n            </DialogHeader>\n            <div className=\"grid gap-4 py-4\">\n              <FormField\n                control={form.control}\n                name=\"email\"\n                render={({ field }) => (\n                  <FormItem>\n                    <FormLabel>\n                      Email <span className=\"text-destructive\">*</span>\n                    </FormLabel>\n                    <FormControl>\n                      <Input\n                        placeholder=\"Email\"\n                        type=\"email\"\n                        {...field}\n                        required\n                      />\n                    </FormControl>\n                    <FormMessage />\n                  </FormItem>\n                )}\n              />\n\n              <FormField\n                control={form.control}\n                name=\"full_name\"\n                render={({ field }) => (\n                  <FormItem>\n                    <FormLabel>Full Name</FormLabel>\n                    <FormControl>\n                      <Input placeholder=\"Full name\" type=\"text\" {...field} />\n                    </FormControl>\n                    <FormMessage />\n                  </FormItem>\n                )}\n              />\n\n              <FormField\n                control={form.control}\n                name=\"password\"\n                render={({ field }) => (\n                  <FormItem>\n                    <FormLabel>Set Password</FormLabel>\n                    <FormControl>\n                      <Input\n                        placeholder=\"Password\"\n                        type=\"password\"\n                        {...field}\n                      />\n                    </FormControl>\n                    <FormMessage />\n                  </FormItem>\n                )}\n              />\n\n              <FormField\n                control={form.control}\n                name=\"confirm_password\"\n                render={({ field }) => (\n                  <FormItem>\n                    <FormLabel>Confirm Password</FormLabel>\n                    <FormControl>\n                      <Input\n                        placeholder=\"Password\"\n                        type=\"password\"\n                        {...field}\n                      />\n                    </FormControl>\n                    <FormMessage />\n                  </FormItem>\n                )}\n              />\n\n              <FormField\n                control={form.control}\n                name=\"is_superuser\"\n                render={({ field }) => (\n                  <FormItem className=\"flex items-center gap-3 space-y-0\">\n                    <FormControl>\n                      <Checkbox\n                        checked={field.value}\n                        onCheckedChange={field.onChange}\n                      />\n                    </FormControl>\n                    <FormLabel className=\"font-normal\">Is superuser?</FormLabel>\n                  </FormItem>\n                )}\n              />\n\n              <FormField\n                control={form.control}\n                name=\"is_active\"\n                render={({ field }) => (\n                  <FormItem className=\"flex items-center gap-3 space-y-0\">\n                    <FormControl>\n                      <Checkbox\n                        checked={field.value}\n                        onCheckedChange={field.onChange}\n                      />\n                    </FormControl>\n                    <FormLabel className=\"font-normal\">Is active?</FormLabel>\n                  </FormItem>\n                )}\n              />\n            </div>\n\n            <DialogFooter>\n              <DialogClose asChild>\n                <Button variant=\"outline\" disabled={mutation.isPending}>\n                  Cancel\n                </Button>\n              </DialogClose>\n              <LoadingButton type=\"submit\" loading={mutation.isPending}>\n                Save\n              </LoadingButton>\n            </DialogFooter>\n          </form>\n        </Form>\n      </DialogContent>\n    </Dialog>\n  )\n}\n\nexport default EditUser\n"
  },
  {
    "path": "frontend/src/components/Admin/UserActionsMenu.tsx",
    "content": "import { EllipsisVertical } from \"lucide-react\"\nimport { useState } from \"react\"\n\nimport type { UserPublic } from \"@/client\"\nimport { Button } from \"@/components/ui/button\"\nimport {\n  DropdownMenu,\n  DropdownMenuContent,\n  DropdownMenuTrigger,\n} from \"@/components/ui/dropdown-menu\"\nimport useAuth from \"@/hooks/useAuth\"\nimport DeleteUser from \"./DeleteUser\"\nimport EditUser from \"./EditUser\"\n\ninterface UserActionsMenuProps {\n  user: UserPublic\n}\n\nexport const UserActionsMenu = ({ user }: UserActionsMenuProps) => {\n  const [open, setOpen] = useState(false)\n  const { user: currentUser } = useAuth()\n\n  if (user.id === currentUser?.id) {\n    return null\n  }\n\n  return (\n    <DropdownMenu open={open} onOpenChange={setOpen}>\n      <DropdownMenuTrigger asChild>\n        <Button variant=\"ghost\" size=\"icon\">\n          <EllipsisVertical />\n        </Button>\n      </DropdownMenuTrigger>\n      <DropdownMenuContent align=\"end\">\n        <EditUser user={user} onSuccess={() => setOpen(false)} />\n        <DeleteUser id={user.id} onSuccess={() => setOpen(false)} />\n      </DropdownMenuContent>\n    </DropdownMenu>\n  )\n}\n"
  },
  {
    "path": "frontend/src/components/Admin/columns.tsx",
    "content": "import type { ColumnDef } from \"@tanstack/react-table\"\n\nimport type { UserPublic } from \"@/client\"\nimport { Badge } from \"@/components/ui/badge\"\nimport { cn } from \"@/lib/utils\"\nimport { UserActionsMenu } from \"./UserActionsMenu\"\n\nexport type UserTableData = UserPublic & {\n  isCurrentUser: boolean\n}\n\nexport const columns: ColumnDef<UserTableData>[] = [\n  {\n    accessorKey: \"full_name\",\n    header: \"Full Name\",\n    cell: ({ row }) => {\n      const fullName = row.original.full_name\n      return (\n        <div className=\"flex items-center gap-2\">\n          <span\n            className={cn(\"font-medium\", !fullName && \"text-muted-foreground\")}\n          >\n            {fullName || \"N/A\"}\n          </span>\n          {row.original.isCurrentUser && (\n            <Badge variant=\"outline\" className=\"text-xs\">\n              You\n            </Badge>\n          )}\n        </div>\n      )\n    },\n  },\n  {\n    accessorKey: \"email\",\n    header: \"Email\",\n    cell: ({ row }) => (\n      <span className=\"text-muted-foreground\">{row.original.email}</span>\n    ),\n  },\n  {\n    accessorKey: \"is_superuser\",\n    header: \"Role\",\n    cell: ({ row }) => (\n      <Badge variant={row.original.is_superuser ? \"default\" : \"secondary\"}>\n        {row.original.is_superuser ? \"Superuser\" : \"User\"}\n      </Badge>\n    ),\n  },\n  {\n    accessorKey: \"is_active\",\n    header: \"Status\",\n    cell: ({ row }) => (\n      <div className=\"flex items-center gap-2\">\n        <span\n          className={cn(\n            \"size-2 rounded-full\",\n            row.original.is_active ? \"bg-green-500\" : \"bg-gray-400\",\n          )}\n        />\n        <span className={row.original.is_active ? \"\" : \"text-muted-foreground\"}>\n          {row.original.is_active ? \"Active\" : \"Inactive\"}\n        </span>\n      </div>\n    ),\n  },\n  {\n    id: \"actions\",\n    header: () => <span className=\"sr-only\">Actions</span>,\n    cell: ({ row }) => (\n      <div className=\"flex justify-end\">\n        <UserActionsMenu user={row.original} />\n      </div>\n    ),\n  },\n]\n"
  },
  {
    "path": "frontend/src/components/Common/Appearance.tsx",
    "content": "import { Monitor, Moon, Sun } from \"lucide-react\"\n\nimport { type Theme, useTheme } from \"@/components/theme-provider\"\nimport { Button } from \"@/components/ui/button\"\nimport {\n  DropdownMenu,\n  DropdownMenuContent,\n  DropdownMenuItem,\n  DropdownMenuTrigger,\n} from \"@/components/ui/dropdown-menu\"\nimport {\n  SidebarMenuButton,\n  SidebarMenuItem,\n  useSidebar,\n} from \"@/components/ui/sidebar\"\n\ntype LucideIcon = React.FC<React.SVGProps<SVGSVGElement>>\n\nconst ICON_MAP: Record<Theme, LucideIcon> = {\n  system: Monitor,\n  light: Sun,\n  dark: Moon,\n}\n\nexport const SidebarAppearance = () => {\n  const { isMobile } = useSidebar()\n  const { setTheme, theme } = useTheme()\n  const Icon = ICON_MAP[theme]\n\n  return (\n    <SidebarMenuItem>\n      <DropdownMenu modal={false}>\n        <DropdownMenuTrigger asChild>\n          <SidebarMenuButton tooltip=\"Appearance\" data-testid=\"theme-button\">\n            <Icon className=\"size-4 text-muted-foreground\" />\n            <span>Appearance</span>\n            <span className=\"sr-only\">Toggle theme</span>\n          </SidebarMenuButton>\n        </DropdownMenuTrigger>\n        <DropdownMenuContent\n          side={isMobile ? \"top\" : \"right\"}\n          align=\"end\"\n          className=\"w-(--radix-dropdown-menu-trigger-width) min-w-56\"\n        >\n          <DropdownMenuItem\n            data-testid=\"light-mode\"\n            onClick={() => setTheme(\"light\")}\n          >\n            <Sun className=\"mr-2 h-4 w-4\" />\n            Light\n          </DropdownMenuItem>\n          <DropdownMenuItem\n            data-testid=\"dark-mode\"\n            onClick={() => setTheme(\"dark\")}\n          >\n            <Moon className=\"mr-2 h-4 w-4\" />\n            Dark\n          </DropdownMenuItem>\n          <DropdownMenuItem onClick={() => setTheme(\"system\")}>\n            <Monitor className=\"mr-2 h-4 w-4\" />\n            System\n          </DropdownMenuItem>\n        </DropdownMenuContent>\n      </DropdownMenu>\n    </SidebarMenuItem>\n  )\n}\n\nexport const Appearance = () => {\n  const { setTheme } = useTheme()\n\n  return (\n    <div className=\"flex items-center justify-center\">\n      <DropdownMenu modal={false}>\n        <DropdownMenuTrigger asChild>\n          <Button data-testid=\"theme-button\" variant=\"outline\" size=\"icon\">\n            <Sun className=\"h-[1.2rem] w-[1.2rem] rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0\" />\n            <Moon className=\"absolute h-[1.2rem] w-[1.2rem] rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100\" />\n            <span className=\"sr-only\">Toggle theme</span>\n          </Button>\n        </DropdownMenuTrigger>\n        <DropdownMenuContent align=\"end\">\n          <DropdownMenuItem\n            data-testid=\"light-mode\"\n            onClick={() => setTheme(\"light\")}\n          >\n            <Sun className=\"mr-2 h-4 w-4\" />\n            Light\n          </DropdownMenuItem>\n          <DropdownMenuItem\n            data-testid=\"dark-mode\"\n            onClick={() => setTheme(\"dark\")}\n          >\n            <Moon className=\"mr-2 h-4 w-4\" />\n            Dark\n          </DropdownMenuItem>\n          <DropdownMenuItem onClick={() => setTheme(\"system\")}>\n            <Monitor className=\"mr-2 h-4 w-4\" />\n            System\n          </DropdownMenuItem>\n        </DropdownMenuContent>\n      </DropdownMenu>\n    </div>\n  )\n}\n"
  },
  {
    "path": "frontend/src/components/Common/AuthLayout.tsx",
    "content": "import { Appearance } from \"@/components/Common/Appearance\"\nimport { Logo } from \"@/components/Common/Logo\"\nimport { Footer } from \"./Footer\"\n\ninterface AuthLayoutProps {\n  children: React.ReactNode\n}\n\nexport function AuthLayout({ children }: AuthLayoutProps) {\n  return (\n    <div className=\"grid min-h-svh lg:grid-cols-2\">\n      <div className=\"bg-muted dark:bg-zinc-900 relative hidden lg:flex lg:items-center lg:justify-center\">\n        <Logo variant=\"full\" className=\"h-16\" asLink={false} />\n      </div>\n      <div className=\"flex flex-col gap-4 p-6 md:p-10\">\n        <div className=\"flex justify-end\">\n          <Appearance />\n        </div>\n        <div className=\"flex flex-1 items-center justify-center\">\n          <div className=\"w-full max-w-xs\">{children}</div>\n        </div>\n        <Footer />\n      </div>\n    </div>\n  )\n}\n"
  },
  {
    "path": "frontend/src/components/Common/DataTable.tsx",
    "content": "import {\n  type ColumnDef,\n  flexRender,\n  getCoreRowModel,\n  getPaginationRowModel,\n  useReactTable,\n} from \"@tanstack/react-table\"\nimport {\n  ChevronLeft,\n  ChevronRight,\n  ChevronsLeft,\n  ChevronsRight,\n} from \"lucide-react\"\n\nimport { Button } from \"@/components/ui/button\"\nimport {\n  Select,\n  SelectContent,\n  SelectItem,\n  SelectTrigger,\n  SelectValue,\n} from \"@/components/ui/select\"\nimport {\n  Table,\n  TableBody,\n  TableCell,\n  TableHead,\n  TableHeader,\n  TableRow,\n} from \"@/components/ui/table\"\n\ninterface DataTableProps<TData, TValue> {\n  columns: ColumnDef<TData, TValue>[]\n  data: TData[]\n}\n\nexport function DataTable<TData, TValue>({\n  columns,\n  data,\n}: DataTableProps<TData, TValue>) {\n  const table = useReactTable({\n    data,\n    columns,\n    getCoreRowModel: getCoreRowModel(),\n    getPaginationRowModel: getPaginationRowModel(),\n  })\n\n  return (\n    <div className=\"flex flex-col gap-4\">\n      <Table>\n        <TableHeader>\n          {table.getHeaderGroups().map((headerGroup) => (\n            <TableRow key={headerGroup.id} className=\"hover:bg-transparent\">\n              {headerGroup.headers.map((header) => {\n                return (\n                  <TableHead key={header.id}>\n                    {header.isPlaceholder\n                      ? null\n                      : flexRender(\n                          header.column.columnDef.header,\n                          header.getContext(),\n                        )}\n                  </TableHead>\n                )\n              })}\n            </TableRow>\n          ))}\n        </TableHeader>\n        <TableBody>\n          {table.getRowModel().rows.length ? (\n            table.getRowModel().rows.map((row) => (\n              <TableRow key={row.id}>\n                {row.getVisibleCells().map((cell) => (\n                  <TableCell key={cell.id}>\n                    {flexRender(cell.column.columnDef.cell, cell.getContext())}\n                  </TableCell>\n                ))}\n              </TableRow>\n            ))\n          ) : (\n            <TableRow className=\"hover:bg-transparent\">\n              <TableCell\n                colSpan={columns.length}\n                className=\"h-32 text-center text-muted-foreground\"\n              >\n                No results found.\n              </TableCell>\n            </TableRow>\n          )}\n        </TableBody>\n      </Table>\n\n      {table.getPageCount() > 1 && (\n        <div className=\"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-4 p-4 border-t bg-muted/20\">\n          <div className=\"flex flex-col sm:flex-row sm:items-center gap-4\">\n            <div className=\"text-sm text-muted-foreground\">\n              Showing{\" \"}\n              {table.getState().pagination.pageIndex *\n                table.getState().pagination.pageSize +\n                1}{\" \"}\n              to{\" \"}\n              {Math.min(\n                (table.getState().pagination.pageIndex + 1) *\n                  table.getState().pagination.pageSize,\n                data.length,\n              )}{\" \"}\n              of{\" \"}\n              <span className=\"font-medium text-foreground\">{data.length}</span>{\" \"}\n              entries\n            </div>\n            <div className=\"flex items-center gap-x-2\">\n              <p className=\"text-sm text-muted-foreground\">Rows per page</p>\n              <Select\n                value={`${table.getState().pagination.pageSize}`}\n                onValueChange={(value) => {\n                  table.setPageSize(Number(value))\n                }}\n              >\n                <SelectTrigger className=\"h-8 w-[70px]\">\n                  <SelectValue\n                    placeholder={table.getState().pagination.pageSize}\n                  />\n                </SelectTrigger>\n                <SelectContent side=\"top\">\n                  {[5, 10, 25, 50].map((pageSize) => (\n                    <SelectItem key={pageSize} value={`${pageSize}`}>\n                      {pageSize}\n                    </SelectItem>\n                  ))}\n                </SelectContent>\n              </Select>\n            </div>\n          </div>\n\n          <div className=\"flex items-center gap-x-6\">\n            <div className=\"flex items-center gap-x-1 text-sm text-muted-foreground\">\n              <span>Page</span>\n              <span className=\"font-medium text-foreground\">\n                {table.getState().pagination.pageIndex + 1}\n              </span>\n              <span>of</span>\n              <span className=\"font-medium text-foreground\">\n                {table.getPageCount()}\n              </span>\n            </div>\n\n            <div className=\"flex items-center gap-x-1\">\n              <Button\n                variant=\"outline\"\n                size=\"sm\"\n                className=\"h-8 w-8 p-0\"\n                onClick={() => table.setPageIndex(0)}\n                disabled={!table.getCanPreviousPage()}\n              >\n                <span className=\"sr-only\">Go to first page</span>\n                <ChevronsLeft className=\"h-4 w-4\" />\n              </Button>\n              <Button\n                variant=\"outline\"\n                size=\"sm\"\n                className=\"h-8 w-8 p-0\"\n                onClick={() => table.previousPage()}\n                disabled={!table.getCanPreviousPage()}\n              >\n                <span className=\"sr-only\">Go to previous page</span>\n                <ChevronLeft className=\"h-4 w-4\" />\n              </Button>\n              <Button\n                variant=\"outline\"\n                size=\"sm\"\n                className=\"h-8 w-8 p-0\"\n                onClick={() => table.nextPage()}\n                disabled={!table.getCanNextPage()}\n              >\n                <span className=\"sr-only\">Go to next page</span>\n                <ChevronRight className=\"h-4 w-4\" />\n              </Button>\n              <Button\n                variant=\"outline\"\n                size=\"sm\"\n                className=\"h-8 w-8 p-0\"\n                onClick={() => table.setPageIndex(table.getPageCount() - 1)}\n                disabled={!table.getCanNextPage()}\n              >\n                <span className=\"sr-only\">Go to last page</span>\n                <ChevronsRight className=\"h-4 w-4\" />\n              </Button>\n            </div>\n          </div>\n        </div>\n      )}\n    </div>\n  )\n}\n"
  },
  {
    "path": "frontend/src/components/Common/ErrorComponent.tsx",
    "content": "import { Link } from \"@tanstack/react-router\"\nimport { Button } from \"@/components/ui/button\"\n\nconst ErrorComponent = () => {\n  return (\n    <div\n      className=\"flex min-h-screen items-center justify-center flex-col p-4\"\n      data-testid=\"error-component\"\n    >\n      <div className=\"flex items-center z-10\">\n        <div className=\"flex flex-col ml-4 items-center justify-center p-4\">\n          <span className=\"text-6xl md:text-8xl font-bold leading-none mb-4\">\n            Error\n          </span>\n          <span className=\"text-2xl font-bold mb-2\">Oops!</span>\n        </div>\n      </div>\n\n      <p className=\"text-lg text-muted-foreground mb-4 text-center z-10\">\n        Something went wrong. Please try again.\n      </p>\n      <Link to=\"/\">\n        <Button>Go Home</Button>\n      </Link>\n    </div>\n  )\n}\n\nexport default ErrorComponent\n"
  },
  {
    "path": "frontend/src/components/Common/Footer.tsx",
    "content": "import { FaGithub, FaLinkedinIn } from \"react-icons/fa\"\nimport { FaXTwitter } from \"react-icons/fa6\"\n\nconst socialLinks = [\n  {\n    icon: FaGithub,\n    href: \"https://github.com/fastapi/fastapi\",\n    label: \"GitHub\",\n  },\n  { icon: FaXTwitter, href: \"https://x.com/fastapi\", label: \"X\" },\n  {\n    icon: FaLinkedinIn,\n    href: \"https://linkedin.com/company/fastapi\",\n    label: \"LinkedIn\",\n  },\n]\n\nexport function Footer() {\n  const currentYear = new Date().getFullYear()\n\n  return (\n    <footer className=\"border-t py-4 px-6\">\n      <div className=\"flex flex-col items-center justify-between gap-4 sm:flex-row\">\n        <p className=\"text-muted-foreground text-sm\">\n          Full Stack FastAPI Template - {currentYear}\n        </p>\n        <div className=\"flex items-center gap-4\">\n          {socialLinks.map(({ icon: Icon, href, label }) => (\n            <a\n              key={label}\n              href={href}\n              target=\"_blank\"\n              rel=\"noopener noreferrer\"\n              aria-label={label}\n              className=\"text-muted-foreground hover:text-foreground transition-colors\"\n            >\n              <Icon className=\"h-5 w-5\" />\n            </a>\n          ))}\n        </div>\n      </div>\n    </footer>\n  )\n}\n"
  },
  {
    "path": "frontend/src/components/Common/Logo.tsx",
    "content": "import { Link } from \"@tanstack/react-router\"\n\nimport { useTheme } from \"@/components/theme-provider\"\nimport { cn } from \"@/lib/utils\"\nimport icon from \"/assets/images/fastapi-icon.svg\"\nimport iconLight from \"/assets/images/fastapi-icon-light.svg\"\nimport logo from \"/assets/images/fastapi-logo.svg\"\nimport logoLight from \"/assets/images/fastapi-logo-light.svg\"\n\ninterface LogoProps {\n  variant?: \"full\" | \"icon\" | \"responsive\"\n  className?: string\n  asLink?: boolean\n}\n\nexport function Logo({\n  variant = \"full\",\n  className,\n  asLink = true,\n}: LogoProps) {\n  const { resolvedTheme } = useTheme()\n  const isDark = resolvedTheme === \"dark\"\n\n  const fullLogo = isDark ? logoLight : logo\n  const iconLogo = isDark ? iconLight : icon\n\n  const content =\n    variant === \"responsive\" ? (\n      <>\n        <img\n          src={fullLogo}\n          alt=\"FastAPI\"\n          className={cn(\n            \"h-6 w-auto group-data-[collapsible=icon]:hidden\",\n            className,\n          )}\n        />\n        <img\n          src={iconLogo}\n          alt=\"FastAPI\"\n          className={cn(\n            \"size-5 hidden group-data-[collapsible=icon]:block\",\n            className,\n          )}\n        />\n      </>\n    ) : (\n      <img\n        src={variant === \"full\" ? fullLogo : iconLogo}\n        alt=\"FastAPI\"\n        className={cn(variant === \"full\" ? \"h-6 w-auto\" : \"size-5\", className)}\n      />\n    )\n\n  if (!asLink) {\n    return content\n  }\n\n  return <Link to=\"/\">{content}</Link>\n}\n"
  },
  {
    "path": "frontend/src/components/Common/NotFound.tsx",
    "content": "import { Link } from \"@tanstack/react-router\"\nimport { Button } from \"@/components/ui/button\"\n\nconst NotFound = () => {\n  return (\n    <div\n      className=\"flex min-h-screen items-center justify-center flex-col p-4\"\n      data-testid=\"not-found\"\n    >\n      <div className=\"flex items-center z-10\">\n        <div className=\"flex flex-col ml-4 items-center justify-center p-4\">\n          <span className=\"text-6xl md:text-8xl font-bold leading-none mb-4\">\n            404\n          </span>\n          <span className=\"text-2xl font-bold mb-2\">Oops!</span>\n        </div>\n      </div>\n\n      <p className=\"text-lg text-muted-foreground mb-4 text-center z-10\">\n        The page you are looking for was not found.\n      </p>\n      <div className=\"z-10\">\n        <Link to=\"/\">\n          <Button className=\"mt-4\">Go Back</Button>\n        </Link>\n      </div>\n    </div>\n  )\n}\n\nexport default NotFound\n"
  },
  {
    "path": "frontend/src/components/Items/AddItem.tsx",
    "content": "import { zodResolver } from \"@hookform/resolvers/zod\"\nimport { useMutation, useQueryClient } from \"@tanstack/react-query\"\nimport { Plus } from \"lucide-react\"\nimport { useState } from \"react\"\nimport { useForm } from \"react-hook-form\"\nimport { z } from \"zod\"\n\nimport { type ItemCreate, ItemsService } from \"@/client\"\nimport { Button } from \"@/components/ui/button\"\nimport {\n  Dialog,\n  DialogClose,\n  DialogContent,\n  DialogDescription,\n  DialogFooter,\n  DialogHeader,\n  DialogTitle,\n  DialogTrigger,\n} from \"@/components/ui/dialog\"\nimport {\n  Form,\n  FormControl,\n  FormField,\n  FormItem,\n  FormLabel,\n  FormMessage,\n} from \"@/components/ui/form\"\nimport { Input } from \"@/components/ui/input\"\nimport { LoadingButton } from \"@/components/ui/loading-button\"\nimport useCustomToast from \"@/hooks/useCustomToast\"\nimport { handleError } from \"@/utils\"\n\nconst formSchema = z.object({\n  title: z.string().min(1, { message: \"Title is required\" }),\n  description: z.string().optional(),\n})\n\ntype FormData = z.infer<typeof formSchema>\n\nconst AddItem = () => {\n  const [isOpen, setIsOpen] = useState(false)\n  const queryClient = useQueryClient()\n  const { showSuccessToast, showErrorToast } = useCustomToast()\n\n  const form = useForm<FormData>({\n    resolver: zodResolver(formSchema),\n    mode: \"onBlur\",\n    criteriaMode: \"all\",\n    defaultValues: {\n      title: \"\",\n      description: \"\",\n    },\n  })\n\n  const mutation = useMutation({\n    mutationFn: (data: ItemCreate) =>\n      ItemsService.createItem({ requestBody: data }),\n    onSuccess: () => {\n      showSuccessToast(\"Item created successfully\")\n      form.reset()\n      setIsOpen(false)\n    },\n    onError: handleError.bind(showErrorToast),\n    onSettled: () => {\n      queryClient.invalidateQueries({ queryKey: [\"items\"] })\n    },\n  })\n\n  const onSubmit = (data: FormData) => {\n    mutation.mutate(data)\n  }\n\n  return (\n    <Dialog open={isOpen} onOpenChange={setIsOpen}>\n      <DialogTrigger asChild>\n        <Button className=\"my-4\">\n          <Plus className=\"mr-2\" />\n          Add Item\n        </Button>\n      </DialogTrigger>\n      <DialogContent className=\"sm:max-w-md\">\n        <DialogHeader>\n          <DialogTitle>Add Item</DialogTitle>\n          <DialogDescription>\n            Fill in the details to add a new item.\n          </DialogDescription>\n        </DialogHeader>\n        <Form {...form}>\n          <form onSubmit={form.handleSubmit(onSubmit)}>\n            <div className=\"grid gap-4 py-4\">\n              <FormField\n                control={form.control}\n                name=\"title\"\n                render={({ field }) => (\n                  <FormItem>\n                    <FormLabel>\n                      Title <span className=\"text-destructive\">*</span>\n                    </FormLabel>\n                    <FormControl>\n                      <Input\n                        placeholder=\"Title\"\n                        type=\"text\"\n                        {...field}\n                        required\n                      />\n                    </FormControl>\n                    <FormMessage />\n                  </FormItem>\n                )}\n              />\n\n              <FormField\n                control={form.control}\n                name=\"description\"\n                render={({ field }) => (\n                  <FormItem>\n                    <FormLabel>Description</FormLabel>\n                    <FormControl>\n                      <Input placeholder=\"Description\" type=\"text\" {...field} />\n                    </FormControl>\n                    <FormMessage />\n                  </FormItem>\n                )}\n              />\n            </div>\n\n            <DialogFooter>\n              <DialogClose asChild>\n                <Button variant=\"outline\" disabled={mutation.isPending}>\n                  Cancel\n                </Button>\n              </DialogClose>\n              <LoadingButton type=\"submit\" loading={mutation.isPending}>\n                Save\n              </LoadingButton>\n            </DialogFooter>\n          </form>\n        </Form>\n      </DialogContent>\n    </Dialog>\n  )\n}\n\nexport default AddItem\n"
  },
  {
    "path": "frontend/src/components/Items/DeleteItem.tsx",
    "content": "import { useMutation, useQueryClient } from \"@tanstack/react-query\"\nimport { Trash2 } from \"lucide-react\"\nimport { useState } from \"react\"\nimport { useForm } from \"react-hook-form\"\n\nimport { ItemsService } from \"@/client\"\nimport { Button } from \"@/components/ui/button\"\nimport {\n  Dialog,\n  DialogClose,\n  DialogContent,\n  DialogDescription,\n  DialogFooter,\n  DialogHeader,\n  DialogTitle,\n} from \"@/components/ui/dialog\"\nimport { DropdownMenuItem } from \"@/components/ui/dropdown-menu\"\nimport { LoadingButton } from \"@/components/ui/loading-button\"\nimport useCustomToast from \"@/hooks/useCustomToast\"\nimport { handleError } from \"@/utils\"\n\ninterface DeleteItemProps {\n  id: string\n  onSuccess: () => void\n}\n\nconst DeleteItem = ({ id, onSuccess }: DeleteItemProps) => {\n  const [isOpen, setIsOpen] = useState(false)\n  const queryClient = useQueryClient()\n  const { showSuccessToast, showErrorToast } = useCustomToast()\n  const { handleSubmit } = useForm()\n\n  const deleteItem = async (id: string) => {\n    await ItemsService.deleteItem({ id: id })\n  }\n\n  const mutation = useMutation({\n    mutationFn: deleteItem,\n    onSuccess: () => {\n      showSuccessToast(\"The item was deleted successfully\")\n      setIsOpen(false)\n      onSuccess()\n    },\n    onError: handleError.bind(showErrorToast),\n    onSettled: () => {\n      queryClient.invalidateQueries()\n    },\n  })\n\n  const onSubmit = async () => {\n    mutation.mutate(id)\n  }\n\n  return (\n    <Dialog open={isOpen} onOpenChange={setIsOpen}>\n      <DropdownMenuItem\n        variant=\"destructive\"\n        onSelect={(e) => e.preventDefault()}\n        onClick={() => setIsOpen(true)}\n      >\n        <Trash2 />\n        Delete Item\n      </DropdownMenuItem>\n      <DialogContent className=\"sm:max-w-md\">\n        <form onSubmit={handleSubmit(onSubmit)}>\n          <DialogHeader>\n            <DialogTitle>Delete Item</DialogTitle>\n            <DialogDescription>\n              This item will be permanently deleted. Are you sure? You will not\n              be able to undo this action.\n            </DialogDescription>\n          </DialogHeader>\n\n          <DialogFooter className=\"mt-4\">\n            <DialogClose asChild>\n              <Button variant=\"outline\" disabled={mutation.isPending}>\n                Cancel\n              </Button>\n            </DialogClose>\n            <LoadingButton\n              variant=\"destructive\"\n              type=\"submit\"\n              loading={mutation.isPending}\n            >\n              Delete\n            </LoadingButton>\n          </DialogFooter>\n        </form>\n      </DialogContent>\n    </Dialog>\n  )\n}\n\nexport default DeleteItem\n"
  },
  {
    "path": "frontend/src/components/Items/EditItem.tsx",
    "content": "import { zodResolver } from \"@hookform/resolvers/zod\"\nimport { useMutation, useQueryClient } from \"@tanstack/react-query\"\nimport { Pencil } from \"lucide-react\"\nimport { useState } from \"react\"\nimport { useForm } from \"react-hook-form\"\nimport { z } from \"zod\"\n\nimport { type ItemPublic, ItemsService } from \"@/client\"\nimport { Button } from \"@/components/ui/button\"\nimport {\n  Dialog,\n  DialogClose,\n  DialogContent,\n  DialogDescription,\n  DialogFooter,\n  DialogHeader,\n  DialogTitle,\n} from \"@/components/ui/dialog\"\nimport { DropdownMenuItem } from \"@/components/ui/dropdown-menu\"\nimport {\n  Form,\n  FormControl,\n  FormField,\n  FormItem,\n  FormLabel,\n  FormMessage,\n} from \"@/components/ui/form\"\nimport { Input } from \"@/components/ui/input\"\nimport { LoadingButton } from \"@/components/ui/loading-button\"\nimport useCustomToast from \"@/hooks/useCustomToast\"\nimport { handleError } from \"@/utils\"\n\nconst formSchema = z.object({\n  title: z.string().min(1, { message: \"Title is required\" }),\n  description: z.string().optional(),\n})\n\ntype FormData = z.infer<typeof formSchema>\n\ninterface EditItemProps {\n  item: ItemPublic\n  onSuccess: () => void\n}\n\nconst EditItem = ({ item, onSuccess }: EditItemProps) => {\n  const [isOpen, setIsOpen] = useState(false)\n  const queryClient = useQueryClient()\n  const { showSuccessToast, showErrorToast } = useCustomToast()\n\n  const form = useForm<FormData>({\n    resolver: zodResolver(formSchema),\n    mode: \"onBlur\",\n    criteriaMode: \"all\",\n    defaultValues: {\n      title: item.title,\n      description: item.description ?? undefined,\n    },\n  })\n\n  const mutation = useMutation({\n    mutationFn: (data: FormData) =>\n      ItemsService.updateItem({ id: item.id, requestBody: data }),\n    onSuccess: () => {\n      showSuccessToast(\"Item updated successfully\")\n      setIsOpen(false)\n      onSuccess()\n    },\n    onError: handleError.bind(showErrorToast),\n    onSettled: () => {\n      queryClient.invalidateQueries({ queryKey: [\"items\"] })\n    },\n  })\n\n  const onSubmit = (data: FormData) => {\n    mutation.mutate(data)\n  }\n\n  return (\n    <Dialog open={isOpen} onOpenChange={setIsOpen}>\n      <DropdownMenuItem\n        onSelect={(e) => e.preventDefault()}\n        onClick={() => setIsOpen(true)}\n      >\n        <Pencil />\n        Edit Item\n      </DropdownMenuItem>\n      <DialogContent className=\"sm:max-w-md\">\n        <Form {...form}>\n          <form onSubmit={form.handleSubmit(onSubmit)}>\n            <DialogHeader>\n              <DialogTitle>Edit Item</DialogTitle>\n              <DialogDescription>\n                Update the item details below.\n              </DialogDescription>\n            </DialogHeader>\n            <div className=\"grid gap-4 py-4\">\n              <FormField\n                control={form.control}\n                name=\"title\"\n                render={({ field }) => (\n                  <FormItem>\n                    <FormLabel>\n                      Title <span className=\"text-destructive\">*</span>\n                    </FormLabel>\n                    <FormControl>\n                      <Input placeholder=\"Title\" type=\"text\" {...field} />\n                    </FormControl>\n                    <FormMessage />\n                  </FormItem>\n                )}\n              />\n\n              <FormField\n                control={form.control}\n                name=\"description\"\n                render={({ field }) => (\n                  <FormItem>\n                    <FormLabel>Description</FormLabel>\n                    <FormControl>\n                      <Input placeholder=\"Description\" type=\"text\" {...field} />\n                    </FormControl>\n                    <FormMessage />\n                  </FormItem>\n                )}\n              />\n            </div>\n\n            <DialogFooter>\n              <DialogClose asChild>\n                <Button variant=\"outline\" disabled={mutation.isPending}>\n                  Cancel\n                </Button>\n              </DialogClose>\n              <LoadingButton type=\"submit\" loading={mutation.isPending}>\n                Save\n              </LoadingButton>\n            </DialogFooter>\n          </form>\n        </Form>\n      </DialogContent>\n    </Dialog>\n  )\n}\n\nexport default EditItem\n"
  },
  {
    "path": "frontend/src/components/Items/ItemActionsMenu.tsx",
    "content": "import { EllipsisVertical } from \"lucide-react\"\nimport { useState } from \"react\"\n\nimport type { ItemPublic } from \"@/client\"\nimport { Button } from \"@/components/ui/button\"\nimport {\n  DropdownMenu,\n  DropdownMenuContent,\n  DropdownMenuTrigger,\n} from \"@/components/ui/dropdown-menu\"\nimport DeleteItem from \"../Items/DeleteItem\"\nimport EditItem from \"../Items/EditItem\"\n\ninterface ItemActionsMenuProps {\n  item: ItemPublic\n}\n\nexport const ItemActionsMenu = ({ item }: ItemActionsMenuProps) => {\n  const [open, setOpen] = useState(false)\n\n  return (\n    <DropdownMenu open={open} onOpenChange={setOpen}>\n      <DropdownMenuTrigger asChild>\n        <Button variant=\"ghost\" size=\"icon\">\n          <EllipsisVertical />\n        </Button>\n      </DropdownMenuTrigger>\n      <DropdownMenuContent align=\"end\">\n        <EditItem item={item} onSuccess={() => setOpen(false)} />\n        <DeleteItem id={item.id} onSuccess={() => setOpen(false)} />\n      </DropdownMenuContent>\n    </DropdownMenu>\n  )\n}\n"
  },
  {
    "path": "frontend/src/components/Items/columns.tsx",
    "content": "import type { ColumnDef } from \"@tanstack/react-table\"\nimport { Check, Copy } from \"lucide-react\"\n\nimport type { ItemPublic } from \"@/client\"\nimport { Button } from \"@/components/ui/button\"\nimport { useCopyToClipboard } from \"@/hooks/useCopyToClipboard\"\nimport { cn } from \"@/lib/utils\"\nimport { ItemActionsMenu } from \"./ItemActionsMenu\"\n\nfunction CopyId({ id }: { id: string }) {\n  const [copiedText, copy] = useCopyToClipboard()\n  const isCopied = copiedText === id\n\n  return (\n    <div className=\"flex items-center gap-1.5 group\">\n      <span className=\"font-mono text-xs text-muted-foreground\">{id}</span>\n      <Button\n        variant=\"ghost\"\n        size=\"icon\"\n        className=\"size-6 opacity-0 group-hover:opacity-100 transition-opacity\"\n        onClick={() => copy(id)}\n      >\n        {isCopied ? (\n          <Check className=\"size-3 text-green-500\" />\n        ) : (\n          <Copy className=\"size-3\" />\n        )}\n        <span className=\"sr-only\">Copy ID</span>\n      </Button>\n    </div>\n  )\n}\n\nexport const columns: ColumnDef<ItemPublic>[] = [\n  {\n    accessorKey: \"id\",\n    header: \"ID\",\n    cell: ({ row }) => <CopyId id={row.original.id} />,\n  },\n  {\n    accessorKey: \"title\",\n    header: \"Title\",\n    cell: ({ row }) => (\n      <span className=\"font-medium\">{row.original.title}</span>\n    ),\n  },\n  {\n    accessorKey: \"description\",\n    header: \"Description\",\n    cell: ({ row }) => {\n      const description = row.original.description\n      return (\n        <span\n          className={cn(\n            \"max-w-xs truncate block text-muted-foreground\",\n            !description && \"italic\",\n          )}\n        >\n          {description || \"No description\"}\n        </span>\n      )\n    },\n  },\n  {\n    id: \"actions\",\n    header: () => <span className=\"sr-only\">Actions</span>,\n    cell: ({ row }) => (\n      <div className=\"flex justify-end\">\n        <ItemActionsMenu item={row.original} />\n      </div>\n    ),\n  },\n]\n"
  },
  {
    "path": "frontend/src/components/Pending/PendingItems.tsx",
    "content": "import { Skeleton } from \"@/components/ui/skeleton\"\nimport {\n  Table,\n  TableBody,\n  TableCell,\n  TableHead,\n  TableHeader,\n  TableRow,\n} from \"@/components/ui/table\"\n\nconst PendingItems = () => (\n  <Table>\n    <TableHeader>\n      <TableRow>\n        <TableHead>ID</TableHead>\n        <TableHead>Title</TableHead>\n        <TableHead>Description</TableHead>\n        <TableHead>\n          <span className=\"sr-only\">Actions</span>\n        </TableHead>\n      </TableRow>\n    </TableHeader>\n    <TableBody>\n      {Array.from({ length: 5 }).map((_, index) => (\n        <TableRow key={index}>\n          <TableCell>\n            <Skeleton className=\"h-4 w-64 font-mono\" />\n          </TableCell>\n          <TableCell>\n            <Skeleton className=\"h-4 w-32\" />\n          </TableCell>\n          <TableCell>\n            <Skeleton className=\"h-4 w-48\" />\n          </TableCell>\n          <TableCell>\n            <div className=\"flex justify-end\">\n              <Skeleton className=\"size-8 rounded-md\" />\n            </div>\n          </TableCell>\n        </TableRow>\n      ))}\n    </TableBody>\n  </Table>\n)\n\nexport default PendingItems\n"
  },
  {
    "path": "frontend/src/components/Pending/PendingUsers.tsx",
    "content": "import { Skeleton } from \"@/components/ui/skeleton\"\nimport {\n  Table,\n  TableBody,\n  TableCell,\n  TableHead,\n  TableHeader,\n  TableRow,\n} from \"@/components/ui/table\"\n\nconst PendingUsers = () => (\n  <Table>\n    <TableHeader>\n      <TableRow>\n        <TableHead>Full Name</TableHead>\n        <TableHead>Email</TableHead>\n        <TableHead>Role</TableHead>\n        <TableHead>Status</TableHead>\n        <TableHead>\n          <span className=\"sr-only\">Actions</span>\n        </TableHead>\n      </TableRow>\n    </TableHeader>\n    <TableBody>\n      {Array.from({ length: 5 }).map((_, index) => (\n        <TableRow key={index}>\n          <TableCell>\n            <Skeleton className=\"h-4 w-32\" />\n          </TableCell>\n          <TableCell>\n            <Skeleton className=\"h-4 w-40\" />\n          </TableCell>\n          <TableCell>\n            <Skeleton className=\"h-5 w-20 rounded-full\" />\n          </TableCell>\n          <TableCell>\n            <div className=\"flex items-center gap-2\">\n              <Skeleton className=\"size-2 rounded-full\" />\n              <Skeleton className=\"h-4 w-12\" />\n            </div>\n          </TableCell>\n          <TableCell>\n            <div className=\"flex justify-end\">\n              <Skeleton className=\"size-8 rounded-md\" />\n            </div>\n          </TableCell>\n        </TableRow>\n      ))}\n    </TableBody>\n  </Table>\n)\n\nexport default PendingUsers\n"
  },
  {
    "path": "frontend/src/components/Sidebar/AppSidebar.tsx",
    "content": "import { Briefcase, Home, Users } from \"lucide-react\"\n\nimport { SidebarAppearance } from \"@/components/Common/Appearance\"\nimport { Logo } from \"@/components/Common/Logo\"\nimport {\n  Sidebar,\n  SidebarContent,\n  SidebarFooter,\n  SidebarHeader,\n} from \"@/components/ui/sidebar\"\nimport useAuth from \"@/hooks/useAuth\"\nimport { type Item, Main } from \"./Main\"\nimport { User } from \"./User\"\n\nconst baseItems: Item[] = [\n  { icon: Home, title: \"Dashboard\", path: \"/\" },\n  { icon: Briefcase, title: \"Items\", path: \"/items\" },\n]\n\nexport function AppSidebar() {\n  const { user: currentUser } = useAuth()\n\n  const items = currentUser?.is_superuser\n    ? [...baseItems, { icon: Users, title: \"Admin\", path: \"/admin\" }]\n    : baseItems\n\n  return (\n    <Sidebar collapsible=\"icon\">\n      <SidebarHeader className=\"px-4 py-6 group-data-[collapsible=icon]:px-0 group-data-[collapsible=icon]:items-center\">\n        <Logo variant=\"responsive\" />\n      </SidebarHeader>\n      <SidebarContent>\n        <Main items={items} />\n      </SidebarContent>\n      <SidebarFooter>\n        <SidebarAppearance />\n        <User user={currentUser} />\n      </SidebarFooter>\n    </Sidebar>\n  )\n}\n\nexport default AppSidebar\n"
  },
  {
    "path": "frontend/src/components/Sidebar/Main.tsx",
    "content": "import { Link as RouterLink, useRouterState } from \"@tanstack/react-router\"\nimport type { LucideIcon } from \"lucide-react\"\n\nimport {\n  SidebarGroup,\n  SidebarGroupContent,\n  SidebarMenu,\n  SidebarMenuButton,\n  SidebarMenuItem,\n  useSidebar,\n} from \"@/components/ui/sidebar\"\n\nexport type Item = {\n  icon: LucideIcon\n  title: string\n  path: string\n}\n\ninterface MainProps {\n  items: Item[]\n}\n\nexport function Main({ items }: MainProps) {\n  const { isMobile, setOpenMobile } = useSidebar()\n  const router = useRouterState()\n  const currentPath = router.location.pathname\n\n  const handleMenuClick = () => {\n    if (isMobile) {\n      setOpenMobile(false)\n    }\n  }\n\n  return (\n    <SidebarGroup>\n      <SidebarGroupContent>\n        <SidebarMenu>\n          {items.map((item) => {\n            const isActive = currentPath === item.path\n\n            return (\n              <SidebarMenuItem key={item.title}>\n                <SidebarMenuButton\n                  tooltip={item.title}\n                  isActive={isActive}\n                  asChild\n                >\n                  <RouterLink to={item.path} onClick={handleMenuClick}>\n                    <item.icon />\n                    <span>{item.title}</span>\n                  </RouterLink>\n                </SidebarMenuButton>\n              </SidebarMenuItem>\n            )\n          })}\n        </SidebarMenu>\n      </SidebarGroupContent>\n    </SidebarGroup>\n  )\n}\n"
  },
  {
    "path": "frontend/src/components/Sidebar/User.tsx",
    "content": "import { Link as RouterLink } from \"@tanstack/react-router\"\nimport { ChevronsUpDown, LogOut, Settings } from \"lucide-react\"\n\nimport { Avatar, AvatarFallback } from \"@/components/ui/avatar\"\nimport {\n  DropdownMenu,\n  DropdownMenuContent,\n  DropdownMenuItem,\n  DropdownMenuLabel,\n  DropdownMenuSeparator,\n  DropdownMenuTrigger,\n} from \"@/components/ui/dropdown-menu\"\nimport {\n  SidebarMenu,\n  SidebarMenuButton,\n  SidebarMenuItem,\n  useSidebar,\n} from \"@/components/ui/sidebar\"\nimport useAuth from \"@/hooks/useAuth\"\nimport { getInitials } from \"@/utils\"\n\ninterface UserInfoProps {\n  fullName?: string\n  email?: string\n}\n\nfunction UserInfo({ fullName, email }: UserInfoProps) {\n  return (\n    <div className=\"flex items-center gap-2.5 w-full min-w-0\">\n      <Avatar className=\"size-8\">\n        <AvatarFallback className=\"bg-zinc-600 text-white\">\n          {getInitials(fullName || \"User\")}\n        </AvatarFallback>\n      </Avatar>\n      <div className=\"flex flex-col items-start min-w-0\">\n        <p className=\"text-sm font-medium truncate w-full\">{fullName}</p>\n        <p className=\"text-xs text-muted-foreground truncate w-full\">{email}</p>\n      </div>\n    </div>\n  )\n}\n\nexport function User({ user }: { user: any }) {\n  const { logout } = useAuth()\n  const { isMobile, setOpenMobile } = useSidebar()\n\n  if (!user) return null\n\n  const handleMenuClick = () => {\n    if (isMobile) {\n      setOpenMobile(false)\n    }\n  }\n  const handleLogout = async () => {\n    logout()\n  }\n\n  return (\n    <SidebarMenu>\n      <SidebarMenuItem>\n        <DropdownMenu>\n          <DropdownMenuTrigger asChild>\n            <SidebarMenuButton\n              size=\"lg\"\n              className=\"data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground\"\n              data-testid=\"user-menu\"\n            >\n              <UserInfo fullName={user?.full_name} email={user?.email} />\n              <ChevronsUpDown className=\"ml-auto size-4 text-muted-foreground\" />\n            </SidebarMenuButton>\n          </DropdownMenuTrigger>\n          <DropdownMenuContent\n            className=\"w-(--radix-dropdown-menu-trigger-width) min-w-56 rounded-lg\"\n            side={isMobile ? \"bottom\" : \"right\"}\n            align=\"end\"\n            sideOffset={4}\n          >\n            <DropdownMenuLabel className=\"p-0 font-normal\">\n              <UserInfo fullName={user?.full_name} email={user?.email} />\n            </DropdownMenuLabel>\n            <DropdownMenuSeparator />\n            <RouterLink to=\"/settings\" onClick={handleMenuClick}>\n              <DropdownMenuItem>\n                <Settings />\n                User Settings\n              </DropdownMenuItem>\n            </RouterLink>\n            <DropdownMenuItem onClick={handleLogout}>\n              <LogOut />\n              Log Out\n            </DropdownMenuItem>\n          </DropdownMenuContent>\n        </DropdownMenu>\n      </SidebarMenuItem>\n    </SidebarMenu>\n  )\n}\n"
  },
  {
    "path": "frontend/src/components/UserSettings/ChangePassword.tsx",
    "content": "import { zodResolver } from \"@hookform/resolvers/zod\"\nimport { useMutation } from \"@tanstack/react-query\"\nimport { useForm } from \"react-hook-form\"\nimport { z } from \"zod\"\n\nimport { type UpdatePassword, UsersService } from \"@/client\"\nimport {\n  Form,\n  FormControl,\n  FormField,\n  FormItem,\n  FormLabel,\n  FormMessage,\n} from \"@/components/ui/form\"\nimport { LoadingButton } from \"@/components/ui/loading-button\"\nimport { PasswordInput } from \"@/components/ui/password-input\"\nimport useCustomToast from \"@/hooks/useCustomToast\"\nimport { handleError } from \"@/utils\"\n\nconst formSchema = z\n  .object({\n    current_password: z\n      .string()\n      .min(1, { message: \"Password is required\" })\n      .min(8, { message: \"Password must be at least 8 characters\" }),\n    new_password: z\n      .string()\n      .min(1, { message: \"Password is required\" })\n      .min(8, { message: \"Password must be at least 8 characters\" }),\n    confirm_password: z\n      .string()\n      .min(1, { message: \"Password confirmation is required\" }),\n  })\n  .refine((data) => data.new_password === data.confirm_password, {\n    message: \"The passwords don't match\",\n    path: [\"confirm_password\"],\n  })\n\ntype FormData = z.infer<typeof formSchema>\n\nconst ChangePassword = () => {\n  const { showSuccessToast, showErrorToast } = useCustomToast()\n  const form = useForm<FormData>({\n    resolver: zodResolver(formSchema),\n    mode: \"onSubmit\",\n    criteriaMode: \"all\",\n    defaultValues: {\n      current_password: \"\",\n      new_password: \"\",\n      confirm_password: \"\",\n    },\n  })\n\n  const mutation = useMutation({\n    mutationFn: (data: UpdatePassword) =>\n      UsersService.updatePasswordMe({ requestBody: data }),\n    onSuccess: () => {\n      showSuccessToast(\"Password updated successfully\")\n      form.reset()\n    },\n    onError: handleError.bind(showErrorToast),\n  })\n\n  const onSubmit = async (data: FormData) => {\n    mutation.mutate(data)\n  }\n\n  return (\n    <div className=\"max-w-md\">\n      <h3 className=\"text-lg font-semibold py-4\">Change Password</h3>\n      <Form {...form}>\n        <form\n          onSubmit={form.handleSubmit(onSubmit)}\n          className=\"flex flex-col gap-4\"\n        >\n          <FormField\n            control={form.control}\n            name=\"current_password\"\n            render={({ field, fieldState }) => (\n              <FormItem>\n                <FormLabel>Current Password</FormLabel>\n                <FormControl>\n                  <PasswordInput\n                    data-testid=\"current-password-input\"\n                    placeholder=\"••••••••\"\n                    aria-invalid={fieldState.invalid}\n                    {...field}\n                  />\n                </FormControl>\n                <FormMessage />\n              </FormItem>\n            )}\n          />\n\n          <FormField\n            control={form.control}\n            name=\"new_password\"\n            render={({ field, fieldState }) => (\n              <FormItem>\n                <FormLabel>New Password</FormLabel>\n                <FormControl>\n                  <PasswordInput\n                    data-testid=\"new-password-input\"\n                    placeholder=\"••••••••\"\n                    aria-invalid={fieldState.invalid}\n                    {...field}\n                  />\n                </FormControl>\n                <FormMessage />\n              </FormItem>\n            )}\n          />\n\n          <FormField\n            control={form.control}\n            name=\"confirm_password\"\n            render={({ field, fieldState }) => (\n              <FormItem>\n                <FormLabel>Confirm Password</FormLabel>\n                <FormControl>\n                  <PasswordInput\n                    data-testid=\"confirm-password-input\"\n                    placeholder=\"••••••••\"\n                    aria-invalid={fieldState.invalid}\n                    {...field}\n                  />\n                </FormControl>\n                <FormMessage />\n              </FormItem>\n            )}\n          />\n\n          <LoadingButton\n            type=\"submit\"\n            loading={mutation.isPending}\n            className=\"self-start\"\n          >\n            Update Password\n          </LoadingButton>\n        </form>\n      </Form>\n    </div>\n  )\n}\n\nexport default ChangePassword\n"
  },
  {
    "path": "frontend/src/components/UserSettings/DeleteAccount.tsx",
    "content": "import DeleteConfirmation from \"./DeleteConfirmation\"\n\nconst DeleteAccount = () => {\n  return (\n    <div className=\"max-w-md mt-4 rounded-lg border border-destructive/50 p-4\">\n      <h3 className=\"font-semibold text-destructive\">Delete Account</h3>\n      <p className=\"mt-1 text-sm text-muted-foreground\">\n        Permanently delete your account and all associated data.\n      </p>\n      <DeleteConfirmation />\n    </div>\n  )\n}\n\nexport default DeleteAccount\n"
  },
  {
    "path": "frontend/src/components/UserSettings/DeleteConfirmation.tsx",
    "content": "import { useMutation, useQueryClient } from \"@tanstack/react-query\"\nimport { useForm } from \"react-hook-form\"\n\nimport { UsersService } from \"@/client\"\nimport { Button } from \"@/components/ui/button\"\nimport {\n  Dialog,\n  DialogClose,\n  DialogContent,\n  DialogDescription,\n  DialogFooter,\n  DialogHeader,\n  DialogTitle,\n  DialogTrigger,\n} from \"@/components/ui/dialog\"\nimport { LoadingButton } from \"@/components/ui/loading-button\"\nimport useAuth from \"@/hooks/useAuth\"\nimport useCustomToast from \"@/hooks/useCustomToast\"\nimport { handleError } from \"@/utils\"\n\nconst DeleteConfirmation = () => {\n  const queryClient = useQueryClient()\n  const { showSuccessToast, showErrorToast } = useCustomToast()\n  const { handleSubmit } = useForm()\n  const { logout } = useAuth()\n\n  const mutation = useMutation({\n    mutationFn: () => UsersService.deleteUserMe(),\n    onSuccess: () => {\n      showSuccessToast(\"Your account has been successfully deleted\")\n      logout()\n    },\n    onError: handleError.bind(showErrorToast),\n    onSettled: () => {\n      queryClient.invalidateQueries({ queryKey: [\"currentUser\"] })\n    },\n  })\n\n  const onSubmit = async () => {\n    mutation.mutate()\n  }\n\n  return (\n    <Dialog>\n      <DialogTrigger asChild>\n        <Button variant=\"destructive\" className=\"mt-3\">\n          Delete Account\n        </Button>\n      </DialogTrigger>\n      <DialogContent>\n        <form onSubmit={handleSubmit(onSubmit)}>\n          <DialogHeader>\n            <DialogTitle>Confirmation Required</DialogTitle>\n            <DialogDescription>\n              All your account data will be{\" \"}\n              <strong>permanently deleted.</strong> If you are sure, please\n              click <strong>\"Confirm\"</strong> to proceed. This action cannot be\n              undone.\n            </DialogDescription>\n          </DialogHeader>\n\n          <DialogFooter className=\"mt-4\">\n            <DialogClose asChild>\n              <Button variant=\"outline\" disabled={mutation.isPending}>\n                Cancel\n              </Button>\n            </DialogClose>\n            <LoadingButton\n              variant=\"destructive\"\n              type=\"submit\"\n              loading={mutation.isPending}\n            >\n              Delete\n            </LoadingButton>\n          </DialogFooter>\n        </form>\n      </DialogContent>\n    </Dialog>\n  )\n}\n\nexport default DeleteConfirmation\n"
  },
  {
    "path": "frontend/src/components/UserSettings/UserInformation.tsx",
    "content": "import { zodResolver } from \"@hookform/resolvers/zod\"\nimport { useMutation, useQueryClient } from \"@tanstack/react-query\"\nimport { useState } from \"react\"\nimport { useForm } from \"react-hook-form\"\nimport { z } from \"zod\"\n\nimport { UsersService, type UserUpdateMe } from \"@/client\"\nimport { Button } from \"@/components/ui/button\"\nimport {\n  Form,\n  FormControl,\n  FormField,\n  FormItem,\n  FormLabel,\n  FormMessage,\n} from \"@/components/ui/form\"\nimport { Input } from \"@/components/ui/input\"\nimport { LoadingButton } from \"@/components/ui/loading-button\"\nimport useAuth from \"@/hooks/useAuth\"\nimport useCustomToast from \"@/hooks/useCustomToast\"\nimport { cn } from \"@/lib/utils\"\nimport { handleError } from \"@/utils\"\n\nconst formSchema = z.object({\n  full_name: z.string().max(30).optional(),\n  email: z.email({ message: \"Invalid email address\" }),\n})\n\ntype FormData = z.infer<typeof formSchema>\n\nconst UserInformation = () => {\n  const queryClient = useQueryClient()\n  const { showSuccessToast, showErrorToast } = useCustomToast()\n  const [editMode, setEditMode] = useState(false)\n  const { user: currentUser } = useAuth()\n\n  const form = useForm<FormData>({\n    resolver: zodResolver(formSchema),\n    mode: \"onBlur\",\n    criteriaMode: \"all\",\n    defaultValues: {\n      full_name: currentUser?.full_name ?? undefined,\n      email: currentUser?.email,\n    },\n  })\n\n  const toggleEditMode = () => {\n    setEditMode(!editMode)\n  }\n\n  const mutation = useMutation({\n    mutationFn: (data: UserUpdateMe) =>\n      UsersService.updateUserMe({ requestBody: data }),\n    onSuccess: () => {\n      showSuccessToast(\"User updated successfully\")\n      toggleEditMode()\n    },\n    onError: handleError.bind(showErrorToast),\n    onSettled: () => {\n      queryClient.invalidateQueries()\n    },\n  })\n\n  const onSubmit = (data: FormData) => {\n    const updateData: UserUpdateMe = {}\n\n    // only include fields that have changed\n    if (data.full_name !== currentUser?.full_name) {\n      updateData.full_name = data.full_name\n    }\n    if (data.email !== currentUser?.email) {\n      updateData.email = data.email\n    }\n\n    mutation.mutate(updateData)\n  }\n\n  const onCancel = () => {\n    form.reset()\n    toggleEditMode()\n  }\n\n  return (\n    <div className=\"max-w-md\">\n      <h3 className=\"text-lg font-semibold py-4\">User Information</h3>\n      <Form {...form}>\n        <form\n          onSubmit={form.handleSubmit(onSubmit)}\n          className=\"flex flex-col gap-4\"\n        >\n          <FormField\n            control={form.control}\n            name=\"full_name\"\n            render={({ field }) =>\n              editMode ? (\n                <FormItem>\n                  <FormLabel>Full name</FormLabel>\n                  <FormControl>\n                    <Input type=\"text\" {...field} />\n                  </FormControl>\n                  <FormMessage />\n                </FormItem>\n              ) : (\n                <FormItem>\n                  <FormLabel>Full name</FormLabel>\n                  <p\n                    className={cn(\n                      \"py-2 truncate max-w-sm\",\n                      !field.value && \"text-muted-foreground\",\n                    )}\n                  >\n                    {field.value || \"N/A\"}\n                  </p>\n                </FormItem>\n              )\n            }\n          />\n\n          <FormField\n            control={form.control}\n            name=\"email\"\n            render={({ field }) =>\n              editMode ? (\n                <FormItem>\n                  <FormLabel>Email</FormLabel>\n                  <FormControl>\n                    <Input type=\"email\" {...field} />\n                  </FormControl>\n                  <FormMessage />\n                </FormItem>\n              ) : (\n                <FormItem>\n                  <FormLabel>Email</FormLabel>\n                  <p className=\"py-2 truncate max-w-sm\">{field.value}</p>\n                </FormItem>\n              )\n            }\n          />\n\n          <div className=\"flex gap-3\">\n            {editMode ? (\n              <>\n                <LoadingButton\n                  type=\"submit\"\n                  loading={mutation.isPending}\n                  disabled={!form.formState.isDirty}\n                >\n                  Save\n                </LoadingButton>\n                <Button\n                  type=\"button\"\n                  variant=\"outline\"\n                  onClick={onCancel}\n                  disabled={mutation.isPending}\n                >\n                  Cancel\n                </Button>\n              </>\n            ) : (\n              <Button type=\"button\" onClick={toggleEditMode}>\n                Edit\n              </Button>\n            )}\n          </div>\n        </form>\n      </Form>\n    </div>\n  )\n}\n\nexport default UserInformation\n"
  },
  {
    "path": "frontend/src/components/theme-provider.tsx",
    "content": "import {\n  createContext,\n  useCallback,\n  useContext,\n  useEffect,\n  useState,\n} from \"react\"\n\nexport type Theme = \"dark\" | \"light\" | \"system\"\n\ntype ThemeProviderProps = {\n  children: React.ReactNode\n  defaultTheme?: Theme\n  storageKey?: string\n}\n\ntype ThemeProviderState = {\n  theme: Theme\n  resolvedTheme: \"dark\" | \"light\"\n  setTheme: (theme: Theme) => void\n}\n\nconst initialState: ThemeProviderState = {\n  theme: \"system\",\n  resolvedTheme: \"light\",\n  setTheme: () => null,\n}\n\nconst ThemeProviderContext = createContext<ThemeProviderState>(initialState)\n\nexport function ThemeProvider({\n  children,\n  defaultTheme = \"system\",\n  storageKey = \"vite-ui-theme\",\n  ...props\n}: ThemeProviderProps) {\n  const [theme, setTheme] = useState<Theme>(\n    () => (localStorage.getItem(storageKey) as Theme) || defaultTheme,\n  )\n\n  const getResolvedTheme = useCallback((theme: Theme): \"dark\" | \"light\" => {\n    if (theme === \"system\") {\n      return window.matchMedia(\"(prefers-color-scheme: dark)\").matches\n        ? \"dark\"\n        : \"light\"\n    }\n    return theme\n  }, [])\n\n  const [resolvedTheme, setResolvedTheme] = useState<\"dark\" | \"light\">(() =>\n    getResolvedTheme(theme),\n  )\n\n  const updateTheme = useCallback((newTheme: Theme) => {\n    const root = window.document.documentElement\n\n    root.classList.remove(\"light\", \"dark\")\n\n    if (newTheme === \"system\") {\n      const systemTheme = window.matchMedia(\"(prefers-color-scheme: dark)\")\n        .matches\n        ? \"dark\"\n        : \"light\"\n\n      root.classList.add(systemTheme)\n      return\n    }\n\n    root.classList.add(newTheme)\n  }, [])\n\n  useEffect(() => {\n    updateTheme(theme)\n    setResolvedTheme(getResolvedTheme(theme))\n\n    const mediaQuery = window.matchMedia(\"(prefers-color-scheme: dark)\")\n\n    const handleChange = () => {\n      if (theme === \"system\") {\n        updateTheme(\"system\")\n        setResolvedTheme(getResolvedTheme(\"system\"))\n      }\n    }\n\n    mediaQuery.addEventListener(\"change\", handleChange)\n\n    return () => {\n      mediaQuery.removeEventListener(\"change\", handleChange)\n    }\n  }, [theme, updateTheme, getResolvedTheme])\n\n  const value = {\n    theme,\n    resolvedTheme,\n    setTheme: (theme: Theme) => {\n      localStorage.setItem(storageKey, theme)\n      setTheme(theme)\n    },\n  }\n\n  return (\n    <ThemeProviderContext.Provider {...props} value={value}>\n      {children}\n    </ThemeProviderContext.Provider>\n  )\n}\n\nexport const useTheme = () => {\n  const context = useContext(ThemeProviderContext)\n\n  if (context === undefined)\n    throw new Error(\"useTheme must be used within a ThemeProvider\")\n\n  return context\n}\n"
  },
  {
    "path": "frontend/src/components/ui/alert.tsx",
    "content": "import * as React from \"react\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"@/lib/utils\"\n\nconst alertVariants = cva(\n  \"relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current\",\n  {\n    variants: {\n      variant: {\n        default: \"bg-card text-card-foreground\",\n        destructive:\n          \"text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90\",\n      },\n    },\n    defaultVariants: {\n      variant: \"default\",\n    },\n  }\n)\n\nfunction Alert({\n  className,\n  variant,\n  ...props\n}: React.ComponentProps<\"div\"> & VariantProps<typeof alertVariants>) {\n  return (\n    <div\n      data-slot=\"alert\"\n      role=\"alert\"\n      className={cn(alertVariants({ variant }), className)}\n      {...props}\n    />\n  )\n}\n\nfunction AlertTitle({ className, ...props }: React.ComponentProps<\"div\">) {\n  return (\n    <div\n      data-slot=\"alert-title\"\n      className={cn(\n        \"col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight\",\n        className\n      )}\n      {...props}\n    />\n  )\n}\n\nfunction AlertDescription({\n  className,\n  ...props\n}: React.ComponentProps<\"div\">) {\n  return (\n    <div\n      data-slot=\"alert-description\"\n      className={cn(\n        \"text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed\",\n        className\n      )}\n      {...props}\n    />\n  )\n}\n\nexport { Alert, AlertTitle, AlertDescription }\n"
  },
  {
    "path": "frontend/src/components/ui/avatar.tsx",
    "content": "import * as React from \"react\"\nimport * as AvatarPrimitive from \"@radix-ui/react-avatar\"\n\nimport { cn } from \"@/lib/utils\"\n\nfunction Avatar({\n  className,\n  ...props\n}: React.ComponentProps<typeof AvatarPrimitive.Root>) {\n  return (\n    <AvatarPrimitive.Root\n      data-slot=\"avatar\"\n      className={cn(\n        \"relative flex size-8 shrink-0 overflow-hidden rounded-full\",\n        className\n      )}\n      {...props}\n    />\n  )\n}\n\nfunction AvatarImage({\n  className,\n  ...props\n}: React.ComponentProps<typeof AvatarPrimitive.Image>) {\n  return (\n    <AvatarPrimitive.Image\n      data-slot=\"avatar-image\"\n      className={cn(\"aspect-square size-full\", className)}\n      {...props}\n    />\n  )\n}\n\nfunction AvatarFallback({\n  className,\n  ...props\n}: React.ComponentProps<typeof AvatarPrimitive.Fallback>) {\n  return (\n    <AvatarPrimitive.Fallback\n      data-slot=\"avatar-fallback\"\n      className={cn(\n        \"bg-muted flex size-full items-center justify-center rounded-full\",\n        className\n      )}\n      {...props}\n    />\n  )\n}\n\nexport { Avatar, AvatarImage, AvatarFallback }\n"
  },
  {
    "path": "frontend/src/components/ui/badge.tsx",
    "content": "import * as React from \"react\"\nimport { Slot } from \"@radix-ui/react-slot\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"@/lib/utils\"\n\nconst badgeVariants = cva(\n  \"inline-flex items-center justify-center rounded-full border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden\",\n  {\n    variants: {\n      variant: {\n        default:\n          \"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90\",\n        secondary:\n          \"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90\",\n        destructive:\n          \"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60\",\n        outline:\n          \"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground\",\n      },\n    },\n    defaultVariants: {\n      variant: \"default\",\n    },\n  }\n)\n\nfunction Badge({\n  className,\n  variant,\n  asChild = false,\n  ...props\n}: React.ComponentProps<\"span\"> &\n  VariantProps<typeof badgeVariants> & { asChild?: boolean }) {\n  const Comp = asChild ? Slot : \"span\"\n\n  return (\n    <Comp\n      data-slot=\"badge\"\n      className={cn(badgeVariants({ variant }), className)}\n      {...props}\n    />\n  )\n}\n\nexport { Badge, badgeVariants }\n"
  },
  {
    "path": "frontend/src/components/ui/button-group.tsx",
    "content": "import { Slot } from \"@radix-ui/react-slot\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Separator } from \"@/components/ui/separator\"\n\nconst buttonGroupVariants = cva(\n  \"flex w-fit items-stretch [&>*]:focus-visible:z-10 [&>*]:focus-visible:relative [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-md has-[>[data-slot=button-group]]:gap-2\",\n  {\n    variants: {\n      orientation: {\n        horizontal:\n          \"[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none\",\n        vertical:\n          \"flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none\",\n      },\n    },\n    defaultVariants: {\n      orientation: \"horizontal\",\n    },\n  }\n)\n\nfunction ButtonGroup({\n  className,\n  orientation,\n  ...props\n}: React.ComponentProps<\"div\"> & VariantProps<typeof buttonGroupVariants>) {\n  return (\n    <div\n      role=\"group\"\n      data-slot=\"button-group\"\n      data-orientation={orientation}\n      className={cn(buttonGroupVariants({ orientation }), className)}\n      {...props}\n    />\n  )\n}\n\nfunction ButtonGroupText({\n  className,\n  asChild = false,\n  ...props\n}: React.ComponentProps<\"div\"> & {\n  asChild?: boolean\n}) {\n  const Comp = asChild ? Slot : \"div\"\n\n  return (\n    <Comp\n      className={cn(\n        \"bg-muted flex items-center gap-2 rounded-md border px-4 text-sm font-medium shadow-xs [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4\",\n        className\n      )}\n      {...props}\n    />\n  )\n}\n\nfunction ButtonGroupSeparator({\n  className,\n  orientation = \"vertical\",\n  ...props\n}: React.ComponentProps<typeof Separator>) {\n  return (\n    <Separator\n      data-slot=\"button-group-separator\"\n      orientation={orientation}\n      className={cn(\n        \"bg-input relative !m-0 self-stretch data-[orientation=vertical]:h-auto\",\n        className\n      )}\n      {...props}\n    />\n  )\n}\n\nexport {\n  ButtonGroup,\n  ButtonGroupSeparator,\n  ButtonGroupText,\n  buttonGroupVariants,\n}\n"
  },
  {
    "path": "frontend/src/components/ui/button.tsx",
    "content": "import * as React from \"react\"\nimport { Slot } from \"@radix-ui/react-slot\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"@/lib/utils\"\n\nconst buttonVariants = cva(\n  \"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive\",\n  {\n    variants: {\n      variant: {\n        default: \"bg-primary text-primary-foreground hover:bg-primary/90\",\n        destructive:\n          \"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60\",\n        outline:\n          \"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50\",\n        secondary:\n          \"bg-secondary text-secondary-foreground hover:bg-secondary/80\",\n        ghost:\n          \"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50\",\n        link: \"text-primary underline-offset-4 hover:underline\",\n      },\n      size: {\n        default: \"h-9 px-4 py-2 has-[>svg]:px-3\",\n        sm: \"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5\",\n        lg: \"h-10 rounded-md px-6 has-[>svg]:px-4\",\n        icon: \"size-9\",\n        \"icon-sm\": \"size-8\",\n        \"icon-lg\": \"size-10\",\n      },\n    },\n    defaultVariants: {\n      variant: \"default\",\n      size: \"default\",\n    },\n  }\n)\n\nfunction Button({\n  className,\n  variant,\n  size,\n  asChild = false,\n  ...props\n}: React.ComponentProps<\"button\"> &\n  VariantProps<typeof buttonVariants> & {\n    asChild?: boolean\n  }) {\n  const Comp = asChild ? Slot : \"button\"\n\n  return (\n    <Comp\n      data-slot=\"button\"\n      className={cn(buttonVariants({ variant, size, className }))}\n      {...props}\n    />\n  )\n}\n\nexport { Button, buttonVariants }\n"
  },
  {
    "path": "frontend/src/components/ui/card.tsx",
    "content": "import * as React from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\nfunction Card({ className, ...props }: React.ComponentProps<\"div\">) {\n  return (\n    <div\n      data-slot=\"card\"\n      className={cn(\n        \"bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm\",\n        className\n      )}\n      {...props}\n    />\n  )\n}\n\nfunction CardHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n  return (\n    <div\n      data-slot=\"card-header\"\n      className={cn(\n        \"@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6\",\n        className\n      )}\n      {...props}\n    />\n  )\n}\n\nfunction CardTitle({ className, ...props }: React.ComponentProps<\"div\">) {\n  return (\n    <div\n      data-slot=\"card-title\"\n      className={cn(\"leading-none font-semibold\", className)}\n      {...props}\n    />\n  )\n}\n\nfunction CardDescription({ className, ...props }: React.ComponentProps<\"div\">) {\n  return (\n    <div\n      data-slot=\"card-description\"\n      className={cn(\"text-muted-foreground text-sm\", className)}\n      {...props}\n    />\n  )\n}\n\nfunction CardAction({ className, ...props }: React.ComponentProps<\"div\">) {\n  return (\n    <div\n      data-slot=\"card-action\"\n      className={cn(\n        \"col-start-2 row-span-2 row-start-1 self-start justify-self-end\",\n        className\n      )}\n      {...props}\n    />\n  )\n}\n\nfunction CardContent({ className, ...props }: React.ComponentProps<\"div\">) {\n  return (\n    <div\n      data-slot=\"card-content\"\n      className={cn(\"px-6\", className)}\n      {...props}\n    />\n  )\n}\n\nfunction CardFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n  return (\n    <div\n      data-slot=\"card-footer\"\n      className={cn(\"flex items-center px-6 [.border-t]:pt-6\", className)}\n      {...props}\n    />\n  )\n}\n\nexport {\n  Card,\n  CardHeader,\n  CardFooter,\n  CardTitle,\n  CardAction,\n  CardDescription,\n  CardContent,\n}\n"
  },
  {
    "path": "frontend/src/components/ui/checkbox.tsx",
    "content": "import * as React from \"react\"\nimport * as CheckboxPrimitive from \"@radix-ui/react-checkbox\"\nimport { CheckIcon } from \"lucide-react\"\n\nimport { cn } from \"@/lib/utils\"\n\nfunction Checkbox({\n  className,\n  ...props\n}: React.ComponentProps<typeof CheckboxPrimitive.Root>) {\n  return (\n    <CheckboxPrimitive.Root\n      data-slot=\"checkbox\"\n      className={cn(\n        \"peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50\",\n        className\n      )}\n      {...props}\n    >\n      <CheckboxPrimitive.Indicator\n        data-slot=\"checkbox-indicator\"\n        className=\"grid place-content-center text-current transition-none\"\n      >\n        <CheckIcon className=\"size-3.5\" />\n      </CheckboxPrimitive.Indicator>\n    </CheckboxPrimitive.Root>\n  )\n}\n\nexport { Checkbox }\n"
  },
  {
    "path": "frontend/src/components/ui/dialog.tsx",
    "content": "import * as React from \"react\"\nimport * as DialogPrimitive from \"@radix-ui/react-dialog\"\nimport { XIcon } from \"lucide-react\"\n\nimport { cn } from \"@/lib/utils\"\n\nfunction Dialog({\n  ...props\n}: React.ComponentProps<typeof DialogPrimitive.Root>) {\n  return <DialogPrimitive.Root data-slot=\"dialog\" {...props} />\n}\n\nfunction DialogTrigger({\n  ...props\n}: React.ComponentProps<typeof DialogPrimitive.Trigger>) {\n  return <DialogPrimitive.Trigger data-slot=\"dialog-trigger\" {...props} />\n}\n\nfunction DialogPortal({\n  ...props\n}: React.ComponentProps<typeof DialogPrimitive.Portal>) {\n  return <DialogPrimitive.Portal data-slot=\"dialog-portal\" {...props} />\n}\n\nfunction DialogClose({\n  ...props\n}: React.ComponentProps<typeof DialogPrimitive.Close>) {\n  return <DialogPrimitive.Close data-slot=\"dialog-close\" {...props} />\n}\n\nfunction DialogOverlay({\n  className,\n  ...props\n}: React.ComponentProps<typeof DialogPrimitive.Overlay>) {\n  return (\n    <DialogPrimitive.Overlay\n      data-slot=\"dialog-overlay\"\n      className={cn(\n        \"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50\",\n        className\n      )}\n      {...props}\n    />\n  )\n}\n\nfunction DialogContent({\n  className,\n  children,\n  showCloseButton = true,\n  ...props\n}: React.ComponentProps<typeof DialogPrimitive.Content> & {\n  showCloseButton?: boolean\n}) {\n  return (\n    <DialogPortal data-slot=\"dialog-portal\">\n      <DialogOverlay />\n      <DialogPrimitive.Content\n        data-slot=\"dialog-content\"\n        className={cn(\n          \"bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg\",\n          className\n        )}\n        {...props}\n      >\n        {children}\n        {showCloseButton && (\n          <DialogPrimitive.Close\n            data-slot=\"dialog-close\"\n            className=\"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\"\n          >\n            <XIcon />\n            <span className=\"sr-only\">Close</span>\n          </DialogPrimitive.Close>\n        )}\n      </DialogPrimitive.Content>\n    </DialogPortal>\n  )\n}\n\nfunction DialogHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n  return (\n    <div\n      data-slot=\"dialog-header\"\n      className={cn(\"flex flex-col gap-2 text-center sm:text-left\", className)}\n      {...props}\n    />\n  )\n}\n\nfunction DialogFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n  return (\n    <div\n      data-slot=\"dialog-footer\"\n      className={cn(\n        \"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end\",\n        className\n      )}\n      {...props}\n    />\n  )\n}\n\nfunction DialogTitle({\n  className,\n  ...props\n}: React.ComponentProps<typeof DialogPrimitive.Title>) {\n  return (\n    <DialogPrimitive.Title\n      data-slot=\"dialog-title\"\n      className={cn(\"text-lg leading-none font-semibold\", className)}\n      {...props}\n    />\n  )\n}\n\nfunction DialogDescription({\n  className,\n  ...props\n}: React.ComponentProps<typeof DialogPrimitive.Description>) {\n  return (\n    <DialogPrimitive.Description\n      data-slot=\"dialog-description\"\n      className={cn(\"text-muted-foreground text-sm\", className)}\n      {...props}\n    />\n  )\n}\n\nexport {\n  Dialog,\n  DialogClose,\n  DialogContent,\n  DialogDescription,\n  DialogFooter,\n  DialogHeader,\n  DialogOverlay,\n  DialogPortal,\n  DialogTitle,\n  DialogTrigger,\n}\n"
  },
  {
    "path": "frontend/src/components/ui/dropdown-menu.tsx",
    "content": "\"use client\"\n\nimport * as React from \"react\"\nimport * as DropdownMenuPrimitive from \"@radix-ui/react-dropdown-menu\"\nimport { CheckIcon, ChevronRightIcon, CircleIcon } from \"lucide-react\"\n\nimport { cn } from \"@/lib/utils\"\n\nfunction DropdownMenu({\n  ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Root>) {\n  return <DropdownMenuPrimitive.Root data-slot=\"dropdown-menu\" {...props} />\n}\n\nfunction DropdownMenuPortal({\n  ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>) {\n  return (\n    <DropdownMenuPrimitive.Portal data-slot=\"dropdown-menu-portal\" {...props} />\n  )\n}\n\nfunction DropdownMenuTrigger({\n  ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>) {\n  return (\n    <DropdownMenuPrimitive.Trigger\n      data-slot=\"dropdown-menu-trigger\"\n      {...props}\n    />\n  )\n}\n\nfunction DropdownMenuContent({\n  className,\n  sideOffset = 4,\n  ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Content>) {\n  return (\n    <DropdownMenuPrimitive.Portal>\n      <DropdownMenuPrimitive.Content\n        data-slot=\"dropdown-menu-content\"\n        sideOffset={sideOffset}\n        className={cn(\n          \"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md\",\n          className\n        )}\n        {...props}\n      />\n    </DropdownMenuPrimitive.Portal>\n  )\n}\n\nfunction DropdownMenuGroup({\n  ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Group>) {\n  return (\n    <DropdownMenuPrimitive.Group data-slot=\"dropdown-menu-group\" {...props} />\n  )\n}\n\nfunction DropdownMenuItem({\n  className,\n  inset,\n  variant = \"default\",\n  ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {\n  inset?: boolean\n  variant?: \"default\" | \"destructive\"\n}) {\n  return (\n    <DropdownMenuPrimitive.Item\n      data-slot=\"dropdown-menu-item\"\n      data-inset={inset}\n      data-variant={variant}\n      className={cn(\n        \"focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n        className\n      )}\n      {...props}\n    />\n  )\n}\n\nfunction DropdownMenuCheckboxItem({\n  className,\n  children,\n  checked,\n  ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>) {\n  return (\n    <DropdownMenuPrimitive.CheckboxItem\n      data-slot=\"dropdown-menu-checkbox-item\"\n      className={cn(\n        \"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n        className\n      )}\n      checked={checked}\n      {...props}\n    >\n      <span className=\"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center\">\n        <DropdownMenuPrimitive.ItemIndicator>\n          <CheckIcon className=\"size-4\" />\n        </DropdownMenuPrimitive.ItemIndicator>\n      </span>\n      {children}\n    </DropdownMenuPrimitive.CheckboxItem>\n  )\n}\n\nfunction DropdownMenuRadioGroup({\n  ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>) {\n  return (\n    <DropdownMenuPrimitive.RadioGroup\n      data-slot=\"dropdown-menu-radio-group\"\n      {...props}\n    />\n  )\n}\n\nfunction DropdownMenuRadioItem({\n  className,\n  children,\n  ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem>) {\n  return (\n    <DropdownMenuPrimitive.RadioItem\n      data-slot=\"dropdown-menu-radio-item\"\n      className={cn(\n        \"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n        className\n      )}\n      {...props}\n    >\n      <span className=\"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center\">\n        <DropdownMenuPrimitive.ItemIndicator>\n          <CircleIcon className=\"size-2 fill-current\" />\n        </DropdownMenuPrimitive.ItemIndicator>\n      </span>\n      {children}\n    </DropdownMenuPrimitive.RadioItem>\n  )\n}\n\nfunction DropdownMenuLabel({\n  className,\n  inset,\n  ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Label> & {\n  inset?: boolean\n}) {\n  return (\n    <DropdownMenuPrimitive.Label\n      data-slot=\"dropdown-menu-label\"\n      data-inset={inset}\n      className={cn(\n        \"px-2 py-1.5 text-sm font-medium data-[inset]:pl-8\",\n        className\n      )}\n      {...props}\n    />\n  )\n}\n\nfunction DropdownMenuSeparator({\n  className,\n  ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Separator>) {\n  return (\n    <DropdownMenuPrimitive.Separator\n      data-slot=\"dropdown-menu-separator\"\n      className={cn(\"bg-border -mx-1 my-1 h-px\", className)}\n      {...props}\n    />\n  )\n}\n\nfunction DropdownMenuShortcut({\n  className,\n  ...props\n}: React.ComponentProps<\"span\">) {\n  return (\n    <span\n      data-slot=\"dropdown-menu-shortcut\"\n      className={cn(\n        \"text-muted-foreground ml-auto text-xs tracking-widest\",\n        className\n      )}\n      {...props}\n    />\n  )\n}\n\nfunction DropdownMenuSub({\n  ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>) {\n  return <DropdownMenuPrimitive.Sub data-slot=\"dropdown-menu-sub\" {...props} />\n}\n\nfunction DropdownMenuSubTrigger({\n  className,\n  inset,\n  children,\n  ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {\n  inset?: boolean\n}) {\n  return (\n    <DropdownMenuPrimitive.SubTrigger\n      data-slot=\"dropdown-menu-sub-trigger\"\n      data-inset={inset}\n      className={cn(\n        \"focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8\",\n        className\n      )}\n      {...props}\n    >\n      {children}\n      <ChevronRightIcon className=\"ml-auto size-4\" />\n    </DropdownMenuPrimitive.SubTrigger>\n  )\n}\n\nfunction DropdownMenuSubContent({\n  className,\n  ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>) {\n  return (\n    <DropdownMenuPrimitive.SubContent\n      data-slot=\"dropdown-menu-sub-content\"\n      className={cn(\n        \"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg\",\n        className\n      )}\n      {...props}\n    />\n  )\n}\n\nexport {\n  DropdownMenu,\n  DropdownMenuPortal,\n  DropdownMenuTrigger,\n  DropdownMenuContent,\n  DropdownMenuGroup,\n  DropdownMenuItem,\n  DropdownMenuCheckboxItem,\n  DropdownMenuRadioGroup,\n  DropdownMenuRadioItem,\n  DropdownMenuLabel,\n  DropdownMenuSeparator,\n  DropdownMenuShortcut,\n  DropdownMenuSub,\n  DropdownMenuSubTrigger,\n  DropdownMenuSubContent,\n}\n"
  },
  {
    "path": "frontend/src/components/ui/form.tsx",
    "content": "import * as React from \"react\"\nimport * as LabelPrimitive from \"@radix-ui/react-label\"\nimport { Slot } from \"@radix-ui/react-slot\"\nimport {\n  Controller,\n  FormProvider,\n  useFormContext,\n  useFormState,\n  type ControllerProps,\n  type FieldPath,\n  type FieldValues,\n} from \"react-hook-form\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Label } from \"@/components/ui/label\"\n\nconst Form = FormProvider\n\ntype FormFieldContextValue<\n  TFieldValues extends FieldValues = FieldValues,\n  TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n> = {\n  name: TName\n}\n\nconst FormFieldContext = React.createContext<FormFieldContextValue>(\n  {} as FormFieldContextValue\n)\n\nconst FormField = <\n  TFieldValues extends FieldValues = FieldValues,\n  TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n>({\n  ...props\n}: ControllerProps<TFieldValues, TName>) => {\n  return (\n    <FormFieldContext.Provider value={{ name: props.name }}>\n      <Controller {...props} />\n    </FormFieldContext.Provider>\n  )\n}\n\nconst useFormField = () => {\n  const fieldContext = React.useContext(FormFieldContext)\n  const itemContext = React.useContext(FormItemContext)\n  const { getFieldState } = useFormContext()\n  const formState = useFormState({ name: fieldContext.name })\n  const fieldState = getFieldState(fieldContext.name, formState)\n\n  if (!fieldContext) {\n    throw new Error(\"useFormField should be used within <FormField>\")\n  }\n\n  const { id } = itemContext\n\n  return {\n    id,\n    name: fieldContext.name,\n    formItemId: `${id}-form-item`,\n    formDescriptionId: `${id}-form-item-description`,\n    formMessageId: `${id}-form-item-message`,\n    ...fieldState,\n  }\n}\n\ntype FormItemContextValue = {\n  id: string\n}\n\nconst FormItemContext = React.createContext<FormItemContextValue>(\n  {} as FormItemContextValue\n)\n\nfunction FormItem({ className, ...props }: React.ComponentProps<\"div\">) {\n  const id = React.useId()\n\n  return (\n    <FormItemContext.Provider value={{ id }}>\n      <div\n        data-slot=\"form-item\"\n        className={cn(\"grid gap-2\", className)}\n        {...props}\n      />\n    </FormItemContext.Provider>\n  )\n}\n\nfunction FormLabel({\n  className,\n  ...props\n}: React.ComponentProps<typeof LabelPrimitive.Root>) {\n  const { error, formItemId } = useFormField()\n\n  return (\n    <Label\n      data-slot=\"form-label\"\n      data-error={!!error}\n      className={cn(\"data-[error=true]:text-destructive\", className)}\n      htmlFor={formItemId}\n      {...props}\n    />\n  )\n}\n\nfunction FormControl({ ...props }: React.ComponentProps<typeof Slot>) {\n  const { error, formItemId, formDescriptionId, formMessageId } = useFormField()\n\n  return (\n    <Slot\n      data-slot=\"form-control\"\n      id={formItemId}\n      aria-describedby={\n        !error\n          ? `${formDescriptionId}`\n          : `${formDescriptionId} ${formMessageId}`\n      }\n      aria-invalid={!!error}\n      {...props}\n    />\n  )\n}\n\nfunction FormDescription({ className, ...props }: React.ComponentProps<\"p\">) {\n  const { formDescriptionId } = useFormField()\n\n  return (\n    <p\n      data-slot=\"form-description\"\n      id={formDescriptionId}\n      className={cn(\"text-muted-foreground text-sm\", className)}\n      {...props}\n    />\n  )\n}\n\nfunction FormMessage({ className, ...props }: React.ComponentProps<\"p\">) {\n  const { error, formMessageId } = useFormField()\n  const body = error ? String(error?.message ?? \"\") : props.children\n\n  if (!body) {\n    return null\n  }\n\n  return (\n    <p\n      data-slot=\"form-message\"\n      id={formMessageId}\n      className={cn(\"text-destructive text-sm\", className)}\n      {...props}\n    >\n      {body}\n    </p>\n  )\n}\n\nexport {\n  useFormField,\n  Form,\n  FormItem,\n  FormLabel,\n  FormControl,\n  FormDescription,\n  FormMessage,\n  FormField,\n}\n"
  },
  {
    "path": "frontend/src/components/ui/input.tsx",
    "content": "import * as React from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\nfunction Input({ className, type, ...props }: React.ComponentProps<\"input\">) {\n  return (\n    <input\n      type={type}\n      data-slot=\"input\"\n      className={cn(\n        \"file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm\",\n        \"focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]\",\n        \"aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive\",\n        className\n      )}\n      {...props}\n    />\n  )\n}\n\nexport { Input }\n"
  },
  {
    "path": "frontend/src/components/ui/label.tsx",
    "content": "\"use client\"\n\nimport * as React from \"react\"\nimport * as LabelPrimitive from \"@radix-ui/react-label\"\n\nimport { cn } from \"@/lib/utils\"\n\nfunction Label({\n  className,\n  ...props\n}: React.ComponentProps<typeof LabelPrimitive.Root>) {\n  return (\n    <LabelPrimitive.Root\n      data-slot=\"label\"\n      className={cn(\n        \"flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50\",\n        className\n      )}\n      {...props}\n    />\n  )\n}\n\nexport { Label }\n"
  },
  {
    "path": "frontend/src/components/ui/loading-button.tsx",
    "content": "import { Slot, Slottable } from \"@radix-ui/react-slot\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport { Loader2 } from \"lucide-react\"\nimport { cn } from \"@/lib/utils\"\n\nconst buttonVariants = cva(\n  \"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive\",\n  {\n    variants: {\n      variant: {\n        default:\n          \"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90\",\n        destructive:\n          \"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60\",\n        outline:\n          \"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50\",\n        secondary:\n          \"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80\",\n        ghost:\n          \"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50\",\n        link: \"text-primary underline-offset-4 hover:underline\",\n      },\n      size: {\n        default: \"h-9 px-4 py-2 has-[>svg]:px-3\",\n        sm: \"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5\",\n        lg: \"h-10 rounded-md px-6 has-[>svg]:px-4\",\n        icon: \"size-9\",\n      },\n    },\n    defaultVariants: {\n      variant: \"default\",\n      size: \"default\",\n    },\n  },\n)\n\nexport interface ButtonProps\n  extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n  VariantProps<typeof buttonVariants> {\n  asChild?: boolean\n  loading?: boolean\n}\n\nfunction LoadingButton({\n  className,\n  loading = false,\n  children,\n  disabled,\n  variant,\n  size,\n  asChild = false,\n  ...props\n}: ButtonProps) {\n  const Comp = asChild ? Slot : \"button\"\n  return (\n    <Comp\n      className={cn(buttonVariants({ variant, size, className }))}\n      disabled={loading || disabled}\n      {...props}\n    >\n      {loading && <Loader2 className=\"mr-2 h-5 w-5 animate-spin\" />}\n      <Slottable>{children}</Slottable>\n    </Comp>\n  )\n}\n\nexport { buttonVariants, LoadingButton }\n"
  },
  {
    "path": "frontend/src/components/ui/pagination.tsx",
    "content": "import * as React from \"react\"\nimport {\n  ChevronLeftIcon,\n  ChevronRightIcon,\n  MoreHorizontalIcon,\n} from \"lucide-react\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button, buttonVariants } from \"@/components/ui/button\"\n\nfunction Pagination({ className, ...props }: React.ComponentProps<\"nav\">) {\n  return (\n    <nav\n      role=\"navigation\"\n      aria-label=\"pagination\"\n      data-slot=\"pagination\"\n      className={cn(\"mx-auto flex w-full justify-center\", className)}\n      {...props}\n    />\n  )\n}\n\nfunction PaginationContent({\n  className,\n  ...props\n}: React.ComponentProps<\"ul\">) {\n  return (\n    <ul\n      data-slot=\"pagination-content\"\n      className={cn(\"flex flex-row items-center gap-1\", className)}\n      {...props}\n    />\n  )\n}\n\nfunction PaginationItem({ ...props }: React.ComponentProps<\"li\">) {\n  return <li data-slot=\"pagination-item\" {...props} />\n}\n\ntype PaginationLinkProps = {\n  isActive?: boolean\n} & Pick<React.ComponentProps<typeof Button>, \"size\"> &\n  React.ComponentProps<\"a\">\n\nfunction PaginationLink({\n  className,\n  isActive,\n  size = \"icon\",\n  ...props\n}: PaginationLinkProps) {\n  return (\n    <a\n      aria-current={isActive ? \"page\" : undefined}\n      data-slot=\"pagination-link\"\n      data-active={isActive}\n      className={cn(\n        buttonVariants({\n          variant: isActive ? \"outline\" : \"ghost\",\n          size,\n        }),\n        className\n      )}\n      {...props}\n    />\n  )\n}\n\nfunction PaginationPrevious({\n  className,\n  ...props\n}: React.ComponentProps<typeof PaginationLink>) {\n  return (\n    <PaginationLink\n      aria-label=\"Go to previous page\"\n      size=\"default\"\n      className={cn(\"gap-1 px-2.5 sm:pl-2.5\", className)}\n      {...props}\n    >\n      <ChevronLeftIcon />\n      <span className=\"hidden sm:block\">Previous</span>\n    </PaginationLink>\n  )\n}\n\nfunction PaginationNext({\n  className,\n  ...props\n}: React.ComponentProps<typeof PaginationLink>) {\n  return (\n    <PaginationLink\n      aria-label=\"Go to next page\"\n      size=\"default\"\n      className={cn(\"gap-1 px-2.5 sm:pr-2.5\", className)}\n      {...props}\n    >\n      <span className=\"hidden sm:block\">Next</span>\n      <ChevronRightIcon />\n    </PaginationLink>\n  )\n}\n\nfunction PaginationEllipsis({\n  className,\n  ...props\n}: React.ComponentProps<\"span\">) {\n  return (\n    <span\n      aria-hidden\n      data-slot=\"pagination-ellipsis\"\n      className={cn(\"flex size-9 items-center justify-center\", className)}\n      {...props}\n    >\n      <MoreHorizontalIcon className=\"size-4\" />\n      <span className=\"sr-only\">More pages</span>\n    </span>\n  )\n}\n\nexport {\n  Pagination,\n  PaginationContent,\n  PaginationLink,\n  PaginationItem,\n  PaginationPrevious,\n  PaginationNext,\n  PaginationEllipsis,\n}\n"
  },
  {
    "path": "frontend/src/components/ui/password-input.tsx",
    "content": "import * as React from \"react\"\nimport { Eye, EyeOff } from \"lucide-react\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"./button\"\n\ninterface PasswordInputProps extends React.ComponentProps<\"input\"> {\n  error?: string\n}\n\nconst PasswordInput = React.forwardRef<HTMLInputElement, PasswordInputProps>(\n  ({ className, error, ...props }, ref) => {\n    const [showPassword, setShowPassword] = React.useState(false)\n\n    return (\n      <div className=\"relative\">\n        <input\n          type={showPassword ? \"text\" : \"password\"}\n          data-slot=\"input\"\n          className={cn(\n            \"file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 pr-10 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm\",\n            \"focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]\",\n            \"aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive\",\n            className\n          )}\n          ref={ref}\n          aria-invalid={!!error}\n          {...props}\n        />\n        <Button\n          type=\"button\"\n          variant=\"ghost\"\n          size=\"icon-sm\"\n          className=\"absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent\"\n          onClick={() => setShowPassword(!showPassword)}\n          aria-label={showPassword ? \"Hide password\" : \"Show password\"}\n        >\n          {showPassword ? (\n            <EyeOff className=\"h-4 w-4 text-muted-foreground\" />\n          ) : (\n            <Eye className=\"h-4 w-4 text-muted-foreground\" />\n          )}\n        </Button>\n      </div>\n    )\n  }\n)\n\nPasswordInput.displayName = \"PasswordInput\"\n\nexport { PasswordInput }\n"
  },
  {
    "path": "frontend/src/components/ui/select.tsx",
    "content": "import * as React from \"react\"\nimport * as SelectPrimitive from \"@radix-ui/react-select\"\nimport { CheckIcon, ChevronDownIcon, ChevronUpIcon } from \"lucide-react\"\n\nimport { cn } from \"@/lib/utils\"\n\nfunction Select({\n  ...props\n}: React.ComponentProps<typeof SelectPrimitive.Root>) {\n  return <SelectPrimitive.Root data-slot=\"select\" {...props} />\n}\n\nfunction SelectGroup({\n  ...props\n}: React.ComponentProps<typeof SelectPrimitive.Group>) {\n  return <SelectPrimitive.Group data-slot=\"select-group\" {...props} />\n}\n\nfunction SelectValue({\n  ...props\n}: React.ComponentProps<typeof SelectPrimitive.Value>) {\n  return <SelectPrimitive.Value data-slot=\"select-value\" {...props} />\n}\n\nfunction SelectTrigger({\n  className,\n  size = \"default\",\n  children,\n  ...props\n}: React.ComponentProps<typeof SelectPrimitive.Trigger> & {\n  size?: \"sm\" | \"default\"\n}) {\n  return (\n    <SelectPrimitive.Trigger\n      data-slot=\"select-trigger\"\n      data-size={size}\n      className={cn(\n        \"border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n        className\n      )}\n      {...props}\n    >\n      {children}\n      <SelectPrimitive.Icon asChild>\n        <ChevronDownIcon className=\"size-4 opacity-50\" />\n      </SelectPrimitive.Icon>\n    </SelectPrimitive.Trigger>\n  )\n}\n\nfunction SelectContent({\n  className,\n  children,\n  position = \"popper\",\n  align = \"center\",\n  ...props\n}: React.ComponentProps<typeof SelectPrimitive.Content>) {\n  return (\n    <SelectPrimitive.Portal>\n      <SelectPrimitive.Content\n        data-slot=\"select-content\"\n        className={cn(\n          \"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md\",\n          position === \"popper\" &&\n            \"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1\",\n          className\n        )}\n        position={position}\n        align={align}\n        {...props}\n      >\n        <SelectScrollUpButton />\n        <SelectPrimitive.Viewport\n          className={cn(\n            \"p-1\",\n            position === \"popper\" &&\n              \"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1\"\n          )}\n        >\n          {children}\n        </SelectPrimitive.Viewport>\n        <SelectScrollDownButton />\n      </SelectPrimitive.Content>\n    </SelectPrimitive.Portal>\n  )\n}\n\nfunction SelectLabel({\n  className,\n  ...props\n}: React.ComponentProps<typeof SelectPrimitive.Label>) {\n  return (\n    <SelectPrimitive.Label\n      data-slot=\"select-label\"\n      className={cn(\"text-muted-foreground px-2 py-1.5 text-xs\", className)}\n      {...props}\n    />\n  )\n}\n\nfunction SelectItem({\n  className,\n  children,\n  ...props\n}: React.ComponentProps<typeof SelectPrimitive.Item>) {\n  return (\n    <SelectPrimitive.Item\n      data-slot=\"select-item\"\n      className={cn(\n        \"focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2\",\n        className\n      )}\n      {...props}\n    >\n      <span className=\"absolute right-2 flex size-3.5 items-center justify-center\">\n        <SelectPrimitive.ItemIndicator>\n          <CheckIcon className=\"size-4\" />\n        </SelectPrimitive.ItemIndicator>\n      </span>\n      <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\n    </SelectPrimitive.Item>\n  )\n}\n\nfunction SelectSeparator({\n  className,\n  ...props\n}: React.ComponentProps<typeof SelectPrimitive.Separator>) {\n  return (\n    <SelectPrimitive.Separator\n      data-slot=\"select-separator\"\n      className={cn(\"bg-border pointer-events-none -mx-1 my-1 h-px\", className)}\n      {...props}\n    />\n  )\n}\n\nfunction SelectScrollUpButton({\n  className,\n  ...props\n}: React.ComponentProps<typeof SelectPrimitive.ScrollUpButton>) {\n  return (\n    <SelectPrimitive.ScrollUpButton\n      data-slot=\"select-scroll-up-button\"\n      className={cn(\n        \"flex cursor-default items-center justify-center py-1\",\n        className\n      )}\n      {...props}\n    >\n      <ChevronUpIcon className=\"size-4\" />\n    </SelectPrimitive.ScrollUpButton>\n  )\n}\n\nfunction SelectScrollDownButton({\n  className,\n  ...props\n}: React.ComponentProps<typeof SelectPrimitive.ScrollDownButton>) {\n  return (\n    <SelectPrimitive.ScrollDownButton\n      data-slot=\"select-scroll-down-button\"\n      className={cn(\n        \"flex cursor-default items-center justify-center py-1\",\n        className\n      )}\n      {...props}\n    >\n      <ChevronDownIcon className=\"size-4\" />\n    </SelectPrimitive.ScrollDownButton>\n  )\n}\n\nexport {\n  Select,\n  SelectContent,\n  SelectGroup,\n  SelectItem,\n  SelectLabel,\n  SelectScrollDownButton,\n  SelectScrollUpButton,\n  SelectSeparator,\n  SelectTrigger,\n  SelectValue,\n}\n"
  },
  {
    "path": "frontend/src/components/ui/separator.tsx",
    "content": "import * as React from \"react\"\nimport * as SeparatorPrimitive from \"@radix-ui/react-separator\"\n\nimport { cn } from \"@/lib/utils\"\n\nfunction Separator({\n  className,\n  orientation = \"horizontal\",\n  decorative = true,\n  ...props\n}: React.ComponentProps<typeof SeparatorPrimitive.Root>) {\n  return (\n    <SeparatorPrimitive.Root\n      data-slot=\"separator\"\n      decorative={decorative}\n      orientation={orientation}\n      className={cn(\n        \"bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px\",\n        className\n      )}\n      {...props}\n    />\n  )\n}\n\nexport { Separator }\n"
  },
  {
    "path": "frontend/src/components/ui/sheet.tsx",
    "content": "\"use client\"\n\nimport * as React from \"react\"\nimport * as SheetPrimitive from \"@radix-ui/react-dialog\"\nimport { XIcon } from \"lucide-react\"\n\nimport { cn } from \"@/lib/utils\"\n\nfunction Sheet({ ...props }: React.ComponentProps<typeof SheetPrimitive.Root>) {\n  return <SheetPrimitive.Root data-slot=\"sheet\" {...props} />\n}\n\nfunction SheetTrigger({\n  ...props\n}: React.ComponentProps<typeof SheetPrimitive.Trigger>) {\n  return <SheetPrimitive.Trigger data-slot=\"sheet-trigger\" {...props} />\n}\n\nfunction SheetClose({\n  ...props\n}: React.ComponentProps<typeof SheetPrimitive.Close>) {\n  return <SheetPrimitive.Close data-slot=\"sheet-close\" {...props} />\n}\n\nfunction SheetPortal({\n  ...props\n}: React.ComponentProps<typeof SheetPrimitive.Portal>) {\n  return <SheetPrimitive.Portal data-slot=\"sheet-portal\" {...props} />\n}\n\nfunction SheetOverlay({\n  className,\n  ...props\n}: React.ComponentProps<typeof SheetPrimitive.Overlay>) {\n  return (\n    <SheetPrimitive.Overlay\n      data-slot=\"sheet-overlay\"\n      className={cn(\n        \"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50\",\n        className\n      )}\n      {...props}\n    />\n  )\n}\n\nfunction SheetContent({\n  className,\n  children,\n  side = \"right\",\n  ...props\n}: React.ComponentProps<typeof SheetPrimitive.Content> & {\n  side?: \"top\" | \"right\" | \"bottom\" | \"left\"\n}) {\n  return (\n    <SheetPortal>\n      <SheetOverlay />\n      <SheetPrimitive.Content\n        data-slot=\"sheet-content\"\n        className={cn(\n          \"bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500\",\n          side === \"right\" &&\n            \"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm\",\n          side === \"left\" &&\n            \"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm\",\n          side === \"top\" &&\n            \"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b\",\n          side === \"bottom\" &&\n            \"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t\",\n          className\n        )}\n        {...props}\n      >\n        {children}\n        <SheetPrimitive.Close className=\"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none\">\n          <XIcon className=\"size-4\" />\n          <span className=\"sr-only\">Close</span>\n        </SheetPrimitive.Close>\n      </SheetPrimitive.Content>\n    </SheetPortal>\n  )\n}\n\nfunction SheetHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n  return (\n    <div\n      data-slot=\"sheet-header\"\n      className={cn(\"flex flex-col gap-1.5 p-4\", className)}\n      {...props}\n    />\n  )\n}\n\nfunction SheetFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n  return (\n    <div\n      data-slot=\"sheet-footer\"\n      className={cn(\"mt-auto flex flex-col gap-2 p-4\", className)}\n      {...props}\n    />\n  )\n}\n\nfunction SheetTitle({\n  className,\n  ...props\n}: React.ComponentProps<typeof SheetPrimitive.Title>) {\n  return (\n    <SheetPrimitive.Title\n      data-slot=\"sheet-title\"\n      className={cn(\"text-foreground font-semibold\", className)}\n      {...props}\n    />\n  )\n}\n\nfunction SheetDescription({\n  className,\n  ...props\n}: React.ComponentProps<typeof SheetPrimitive.Description>) {\n  return (\n    <SheetPrimitive.Description\n      data-slot=\"sheet-description\"\n      className={cn(\"text-muted-foreground text-sm\", className)}\n      {...props}\n    />\n  )\n}\n\nexport {\n  Sheet,\n  SheetTrigger,\n  SheetClose,\n  SheetContent,\n  SheetHeader,\n  SheetFooter,\n  SheetTitle,\n  SheetDescription,\n}\n"
  },
  {
    "path": "frontend/src/components/ui/sidebar.tsx",
    "content": "import { Slot } from \"@radix-ui/react-slot\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport { PanelLeftIcon } from \"lucide-react\"\nimport * as React from \"react\"\n\nimport { Button } from \"@/components/ui/button\"\nimport { Input } from \"@/components/ui/input\"\nimport { Separator } from \"@/components/ui/separator\"\nimport {\n  Sheet,\n  SheetContent,\n  SheetDescription,\n  SheetHeader,\n  SheetTitle,\n} from \"@/components/ui/sheet\"\nimport { Skeleton } from \"@/components/ui/skeleton\"\nimport {\n  Tooltip,\n  TooltipContent,\n  TooltipProvider,\n  TooltipTrigger,\n} from \"@/components/ui/tooltip\"\nimport { cn } from \"@/lib/utils\"\nimport { useIsMobile } from \"@/hooks/useMobile\"\n\nconst SIDEBAR_COOKIE_NAME = \"sidebar_state\"\nconst SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7\nconst SIDEBAR_WIDTH = \"16rem\"\nconst SIDEBAR_WIDTH_MOBILE = \"18rem\"\nconst SIDEBAR_WIDTH_ICON = \"3rem\"\nconst SIDEBAR_KEYBOARD_SHORTCUT = \"b\"\n\ntype SidebarContextProps = {\n  state: \"expanded\" | \"collapsed\"\n  open: boolean\n  setOpen: (open: boolean) => void\n  openMobile: boolean\n  setOpenMobile: (open: boolean) => void\n  isMobile: boolean\n  toggleSidebar: () => void\n}\n\nconst SidebarContext = React.createContext<SidebarContextProps | null>(null)\n\nfunction useSidebar() {\n  const context = React.useContext(SidebarContext)\n  if (!context) {\n    throw new Error(\"useSidebar must be used within a SidebarProvider.\")\n  }\n\n  return context\n}\n\nfunction SidebarProvider({\n  defaultOpen = true,\n  open: openProp,\n  onOpenChange: setOpenProp,\n  className,\n  style,\n  children,\n  ...props\n}: React.ComponentProps<\"div\"> & {\n  defaultOpen?: boolean\n  open?: boolean\n  onOpenChange?: (open: boolean) => void\n}) {\n  const isMobile = useIsMobile()\n  const [openMobile, setOpenMobile] = React.useState(false)\n\n  const getInitialOpen = () => {\n    if (typeof document === \"undefined\") return defaultOpen\n\n    const cookie = document.cookie\n      .split(\"; \")\n      .find((c) => c.startsWith(`${SIDEBAR_COOKIE_NAME}=`))\n\n    if (!cookie) return defaultOpen\n\n    return cookie.split(\"=\")[1] === \"true\"\n  }\n\n  // This is the internal state of the sidebar.\n  // We use openProp and setOpenProp for control from outside the component.\n  const [_open, _setOpen] = React.useState(getInitialOpen)\n  const open = openProp ?? _open\n  const setOpen = React.useCallback(\n    (value: boolean | ((value: boolean) => boolean)) => {\n      const openState = typeof value === \"function\" ? value(open) : value\n      if (setOpenProp) {\n        setOpenProp(openState)\n      } else {\n        _setOpen(openState)\n      }\n\n      // This sets the cookie to keep the sidebar state.\n      document.cookie = `${SIDEBAR_COOKIE_NAME}=${openState}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`\n    },\n    [setOpenProp, open],\n  )\n\n  // Helper to toggle the sidebar.\n  const toggleSidebar = React.useCallback(() => {\n    return isMobile ? setOpenMobile((open) => !open) : setOpen((open) => !open)\n  }, [isMobile, setOpen])\n\n  // Adds a keyboard shortcut to toggle the sidebar.\n  React.useEffect(() => {\n    const handleKeyDown = (event: KeyboardEvent) => {\n      if (\n        event.key === SIDEBAR_KEYBOARD_SHORTCUT &&\n        (event.metaKey || event.ctrlKey)\n      ) {\n        event.preventDefault()\n        toggleSidebar()\n      }\n    }\n\n    window.addEventListener(\"keydown\", handleKeyDown)\n    return () => window.removeEventListener(\"keydown\", handleKeyDown)\n  }, [toggleSidebar])\n\n  // We add a state so that we can do data-state=\"expanded\" or \"collapsed\".\n  // This makes it easier to style the sidebar with Tailwind classes.\n  const state = open ? \"expanded\" : \"collapsed\"\n\n  const contextValue = React.useMemo<SidebarContextProps>(\n    () => ({\n      state,\n      open,\n      setOpen,\n      isMobile,\n      openMobile,\n      setOpenMobile,\n      toggleSidebar,\n    }),\n    [state, open, setOpen, isMobile, openMobile, toggleSidebar],\n  )\n\n  return (\n    <SidebarContext.Provider value={contextValue}>\n      <TooltipProvider delayDuration={0}>\n        <div\n          data-slot=\"sidebar-wrapper\"\n          style={\n            {\n              \"--sidebar-width\": SIDEBAR_WIDTH,\n              \"--sidebar-width-icon\": SIDEBAR_WIDTH_ICON,\n              ...style,\n            } as React.CSSProperties\n          }\n          className={cn(\n            \"group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full\",\n            className,\n          )}\n          {...props}\n        >\n          {children}\n        </div>\n      </TooltipProvider>\n    </SidebarContext.Provider>\n  )\n}\n\nfunction Sidebar({\n  side = \"left\",\n  variant = \"sidebar\",\n  collapsible = \"offcanvas\",\n  className,\n  children,\n  ...props\n}: React.ComponentProps<\"div\"> & {\n  side?: \"left\" | \"right\"\n  variant?: \"sidebar\" | \"floating\" | \"inset\"\n  collapsible?: \"offcanvas\" | \"icon\" | \"none\"\n}) {\n  const { isMobile, state, openMobile, setOpenMobile } = useSidebar()\n\n  if (collapsible === \"none\") {\n    return (\n      <div\n        data-slot=\"sidebar\"\n        className={cn(\n          \"bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col\",\n          className,\n        )}\n        {...props}\n      >\n        {children}\n      </div>\n    )\n  }\n\n  if (isMobile) {\n    return (\n      <Sheet open={openMobile} onOpenChange={setOpenMobile} {...props}>\n        <SheetContent\n          data-sidebar=\"sidebar\"\n          data-slot=\"sidebar\"\n          data-mobile=\"true\"\n          className=\"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden\"\n          style={\n            {\n              \"--sidebar-width\": SIDEBAR_WIDTH_MOBILE,\n            } as React.CSSProperties\n          }\n          side={side}\n        >\n          <SheetHeader className=\"sr-only\">\n            <SheetTitle>Sidebar</SheetTitle>\n            <SheetDescription>Displays the mobile sidebar.</SheetDescription>\n          </SheetHeader>\n          <div className=\"flex h-full w-full flex-col\">{children}</div>\n        </SheetContent>\n      </Sheet>\n    )\n  }\n\n  return (\n    <div\n      className=\"group peer text-sidebar-foreground hidden md:block\"\n      data-state={state}\n      data-collapsible={state === \"collapsed\" ? collapsible : \"\"}\n      data-variant={variant}\n      data-side={side}\n      data-slot=\"sidebar\"\n    >\n      {/* This is what handles the sidebar gap on desktop */}\n      <div\n        data-slot=\"sidebar-gap\"\n        className={cn(\n          \"relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear\",\n          \"group-data-[collapsible=offcanvas]:w-0\",\n          \"group-data-[side=right]:rotate-180\",\n          variant === \"floating\" || variant === \"inset\"\n            ? \"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]\"\n            : \"group-data-[collapsible=icon]:w-(--sidebar-width-icon)\",\n        )}\n      />\n      <div\n        data-slot=\"sidebar-container\"\n        className={cn(\n          \"fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex\",\n          side === \"left\"\n            ? \"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]\"\n            : \"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]\",\n          // Adjust the padding for floating and inset variants.\n          variant === \"floating\" || variant === \"inset\"\n            ? \"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]\"\n            : \"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l\",\n          className,\n        )}\n        {...props}\n      >\n        <div\n          data-sidebar=\"sidebar\"\n          data-slot=\"sidebar-inner\"\n          className=\"bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm\"\n        >\n          {children}\n        </div>\n      </div>\n    </div>\n  )\n}\n\nfunction SidebarTrigger({\n  className,\n  onClick,\n  ...props\n}: React.ComponentProps<typeof Button>) {\n  const { toggleSidebar, open } = useSidebar()\n  const sidebarCopy = open ? \"Collapse Sidebar\" : \"Open Sidebar\"\n\n  return (\n    <Button\n      data-sidebar=\"trigger\"\n      data-slot=\"sidebar-trigger\"\n      variant=\"ghost\"\n      size=\"icon\"\n      className={cn(\"size-7\", className)}\n      onClick={(event) => {\n        onClick?.(event)\n        toggleSidebar()\n      }}\n      {...props}\n    >\n      <PanelLeftIcon />\n      <span className=\"sr-only\">{sidebarCopy}</span>\n    </Button>\n  )\n}\n\nfunction SidebarRail({ className, ...props }: React.ComponentProps<\"button\">) {\n  const { toggleSidebar } = useSidebar()\n\n  return (\n    <button\n      data-sidebar=\"rail\"\n      data-slot=\"sidebar-rail\"\n      aria-label=\"Toggle Sidebar\"\n      tabIndex={-1}\n      onClick={toggleSidebar}\n      title=\"Toggle Sidebar\"\n      className={cn(\n        \"hover:after:bg-sidebar-border absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] sm:flex\",\n        \"in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize\",\n        \"[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize\",\n        \"hover:group-data-[collapsible=offcanvas]:bg-sidebar group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full\",\n        \"[[data-side=left][data-collapsible=offcanvas]_&]:-right-2\",\n        \"[[data-side=right][data-collapsible=offcanvas]_&]:-left-2\",\n        className,\n      )}\n      {...props}\n    />\n  )\n}\n\nfunction SidebarInset({ className, ...props }: React.ComponentProps<\"main\">) {\n  return (\n    <main\n      data-slot=\"sidebar-inset\"\n      className={cn(\n        \"bg-transparent relative flex w-full flex-1 flex-col\",\n        \"md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2\",\n        className,\n      )}\n      {...props}\n    />\n  )\n}\n\nfunction SidebarInput({\n  className,\n  ...props\n}: React.ComponentProps<typeof Input>) {\n  return (\n    <Input\n      data-slot=\"sidebar-input\"\n      data-sidebar=\"input\"\n      className={cn(\"bg-background h-8 w-full shadow-none\", className)}\n      {...props}\n    />\n  )\n}\n\nfunction SidebarHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n  return (\n    <div\n      data-slot=\"sidebar-header\"\n      data-sidebar=\"header\"\n      className={cn(\"flex flex-col gap-2 p-2 pb-3\", className)}\n      {...props}\n    />\n  )\n}\n\nfunction SidebarFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n  return (\n    <div\n      data-slot=\"sidebar-footer\"\n      data-sidebar=\"footer\"\n      className={cn(\"flex flex-col gap-3 p-2\", className)}\n      {...props}\n    />\n  )\n}\n\nfunction SidebarSeparator({\n  className,\n  ...props\n}: React.ComponentProps<typeof Separator>) {\n  return (\n    <Separator\n      data-slot=\"sidebar-separator\"\n      data-sidebar=\"separator\"\n      className={cn(\"bg-sidebar-border mx-2 w-auto\", className)}\n      {...props}\n    />\n  )\n}\n\nfunction SidebarContent({ className, ...props }: React.ComponentProps<\"div\">) {\n  return (\n    <div\n      data-slot=\"sidebar-content\"\n      data-sidebar=\"content\"\n      className={cn(\n        \"flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden\",\n        className,\n      )}\n      {...props}\n    />\n  )\n}\n\nfunction SidebarGroup({ className, ...props }: React.ComponentProps<\"div\">) {\n  return (\n    <div\n      data-slot=\"sidebar-group\"\n      data-sidebar=\"group\"\n      className={cn(\"relative flex w-full min-w-0 flex-col px-2\", className)}\n      {...props}\n    />\n  )\n}\n\nfunction SidebarGroupLabel({\n  className,\n  asChild = false,\n  ...props\n}: React.ComponentProps<\"div\"> & { asChild?: boolean }) {\n  const Comp = asChild ? Slot : \"div\"\n\n  return (\n    <Comp\n      data-slot=\"sidebar-group-label\"\n      data-sidebar=\"group-label\"\n      className={cn(\n        \"text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0\",\n        \"group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0\",\n        className,\n      )}\n      {...props}\n    />\n  )\n}\n\nfunction SidebarGroupAction({\n  className,\n  asChild = false,\n  ...props\n}: React.ComponentProps<\"button\"> & { asChild?: boolean }) {\n  const Comp = asChild ? Slot : \"button\"\n\n  return (\n    <Comp\n      data-slot=\"sidebar-group-action\"\n      data-sidebar=\"group-action\"\n      className={cn(\n        \"text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0\",\n        // Increases the hit area of the button on mobile.\n        \"after:absolute after:-inset-2 md:after:hidden\",\n        \"group-data-[collapsible=icon]:hidden\",\n        className,\n      )}\n      {...props}\n    />\n  )\n}\n\nfunction SidebarGroupContent({\n  className,\n  ...props\n}: React.ComponentProps<\"div\">) {\n  return (\n    <div\n      data-slot=\"sidebar-group-content\"\n      data-sidebar=\"group-content\"\n      className={cn(\"w-full text-sm\", className)}\n      {...props}\n    />\n  )\n}\n\nfunction SidebarMenu({ className, ...props }: React.ComponentProps<\"ul\">) {\n  return (\n    <ul\n      data-slot=\"sidebar-menu\"\n      data-sidebar=\"menu\"\n      className={cn(\"flex w-full min-w-0 flex-col gap-1\", className)}\n      {...props}\n    />\n  )\n}\n\nfunction SidebarMenuItem({ className, ...props }: React.ComponentProps<\"li\">) {\n  return (\n    <li\n      data-slot=\"sidebar-menu-item\"\n      data-sidebar=\"menu-item\"\n      className={cn(\"group/menu-item relative\", className)}\n      {...props}\n    />\n  )\n}\n\nconst sidebarMenuButtonVariants = cva(\n  \"peer/menu-button flex w-full items-center gap-2 overflow-hidden p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 data-[state=open]:bg-sidebar-accent\",\n  {\n    variants: {\n      variant: {\n        default: \"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground\",\n        outline:\n          \"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]\",\n      },\n      size: {\n        default: \"h-8 text-sm rounded-lg\",\n        sm: \"h-7 text-xs\",\n        lg: \"h-12 text-sm group-data-[collapsible=icon]:p-0! rounded-xl data-[state=closed]:rounded-lg\",\n      },\n    },\n    defaultVariants: {\n      variant: \"default\",\n      size: \"default\",\n    },\n  },\n)\n\nfunction SidebarMenuButton({\n  asChild = false,\n  isActive = false,\n  variant = \"default\",\n  size = \"default\",\n  tooltip,\n  className,\n  ...props\n}: React.ComponentProps<\"button\"> & {\n  asChild?: boolean\n  isActive?: boolean\n  tooltip?: string | React.ComponentProps<typeof TooltipContent>\n} & VariantProps<typeof sidebarMenuButtonVariants>) {\n  const Comp = asChild ? Slot : \"button\"\n  const { isMobile, state } = useSidebar()\n\n  const button = (\n    <Comp\n      data-slot=\"sidebar-menu-button\"\n      data-sidebar=\"menu-button\"\n      data-size={size}\n      data-active={isActive}\n      className={cn(sidebarMenuButtonVariants({ variant, size }), className)}\n      {...props}\n    />\n  )\n\n  if (!tooltip) {\n    return button\n  }\n\n  if (typeof tooltip === \"string\") {\n    tooltip = {\n      children: tooltip,\n    }\n  }\n\n  return (\n    <Tooltip>\n      <TooltipTrigger asChild>{button}</TooltipTrigger>\n      <TooltipContent\n        side=\"right\"\n        align=\"center\"\n        hidden={state !== \"collapsed\" || isMobile}\n        {...tooltip}\n      />\n    </Tooltip>\n  )\n}\n\nfunction SidebarMenuAction({\n  className,\n  asChild = false,\n  showOnHover = false,\n  ...props\n}: React.ComponentProps<\"button\"> & {\n  asChild?: boolean\n  showOnHover?: boolean\n}) {\n  const Comp = asChild ? Slot : \"button\"\n\n  return (\n    <Comp\n      data-slot=\"sidebar-menu-action\"\n      data-sidebar=\"menu-action\"\n      className={cn(\n        \"text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground peer-hover/menu-button:text-sidebar-accent-foreground absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0\",\n        // Increases the hit area of the button on mobile.\n        \"after:absolute after:-inset-2 md:after:hidden\",\n        \"peer-data-[size=sm]/menu-button:top-1\",\n        \"peer-data-[size=default]/menu-button:top-1.5\",\n        \"peer-data-[size=lg]/menu-button:top-2.5\",\n        \"group-data-[collapsible=icon]:hidden\",\n        showOnHover &&\n        \"peer-data-[active=true]/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 md:opacity-0\",\n        className,\n      )}\n      {...props}\n    />\n  )\n}\n\nfunction SidebarMenuBadge({\n  className,\n  ...props\n}: React.ComponentProps<\"div\">) {\n  return (\n    <div\n      data-slot=\"sidebar-menu-badge\"\n      data-sidebar=\"menu-badge\"\n      className={cn(\n        \"text-sidebar-foreground pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums select-none\",\n        \"peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground\",\n        \"peer-data-[size=sm]/menu-button:top-1\",\n        \"peer-data-[size=default]/menu-button:top-1.5\",\n        \"peer-data-[size=lg]/menu-button:top-2.5\",\n        \"group-data-[collapsible=icon]:hidden\",\n        className,\n      )}\n      {...props}\n    />\n  )\n}\n\nfunction SidebarMenuSkeleton({\n  className,\n  showIcon = false,\n  ...props\n}: React.ComponentProps<\"div\"> & {\n  showIcon?: boolean\n}) {\n  // Random width between 50 to 90%.\n  const width = React.useMemo(() => {\n    return `${Math.floor(Math.random() * 40) + 50}%`\n  }, [])\n\n  return (\n    <div\n      data-slot=\"sidebar-menu-skeleton\"\n      data-sidebar=\"menu-skeleton\"\n      className={cn(\"flex h-8 items-center gap-2 rounded-md px-2\", className)}\n      {...props}\n    >\n      {showIcon && (\n        <Skeleton\n          className=\"size-4 rounded-md\"\n          data-sidebar=\"menu-skeleton-icon\"\n        />\n      )}\n      <Skeleton\n        className=\"h-4 max-w-(--skeleton-width) flex-1\"\n        data-sidebar=\"menu-skeleton-text\"\n        style={\n          {\n            \"--skeleton-width\": width,\n          } as React.CSSProperties\n        }\n      />\n    </div>\n  )\n}\n\nfunction SidebarMenuSub({ className, ...props }: React.ComponentProps<\"ul\">) {\n  return (\n    <ul\n      data-slot=\"sidebar-menu-sub\"\n      data-sidebar=\"menu-sub\"\n      className={cn(\n        \"border-sidebar-border mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l px-2.5 py-0.5\",\n        \"group-data-[collapsible=icon]:hidden\",\n        className,\n      )}\n      {...props}\n    />\n  )\n}\n\nfunction SidebarMenuSubItem({\n  className,\n  ...props\n}: React.ComponentProps<\"li\">) {\n  return (\n    <li\n      data-slot=\"sidebar-menu-sub-item\"\n      data-sidebar=\"menu-sub-item\"\n      className={cn(\"group/menu-sub-item relative\", className)}\n      {...props}\n    />\n  )\n}\n\nfunction SidebarMenuSubButton({\n  asChild = false,\n  size = \"md\",\n  isActive = false,\n  className,\n  ...props\n}: React.ComponentProps<\"a\"> & {\n  asChild?: boolean\n  size?: \"sm\" | \"md\"\n  isActive?: boolean\n}) {\n  const Comp = asChild ? Slot : \"a\"\n\n  return (\n    <Comp\n      data-slot=\"sidebar-menu-sub-button\"\n      data-sidebar=\"menu-sub-button\"\n      data-size={size}\n      data-active={isActive}\n      className={cn(\n        \"text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-accent-foreground flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 outline-hidden focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0\",\n        \"data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground\",\n        size === \"sm\" && \"text-xs\",\n        size === \"md\" && \"text-sm\",\n        \"group-data-[collapsible=icon]:hidden\",\n        className,\n      )}\n      {...props}\n    />\n  )\n}\n\nexport {\n  Sidebar,\n  SidebarContent,\n  SidebarFooter,\n  SidebarGroup,\n  SidebarGroupAction,\n  SidebarGroupContent,\n  SidebarGroupLabel,\n  SidebarHeader,\n  SidebarInput,\n  SidebarInset,\n  SidebarMenu,\n  SidebarMenuAction,\n  SidebarMenuBadge,\n  SidebarMenuButton,\n  SidebarMenuItem,\n  SidebarMenuSkeleton,\n  SidebarMenuSub,\n  SidebarMenuSubButton,\n  SidebarMenuSubItem,\n  SidebarProvider,\n  SidebarRail,\n  SidebarSeparator,\n  SidebarTrigger,\n  useSidebar,\n}\n"
  },
  {
    "path": "frontend/src/components/ui/skeleton.tsx",
    "content": "import { cn } from \"@/lib/utils\"\n\nfunction Skeleton({ className, ...props }: React.ComponentProps<\"div\">) {\n  return (\n    <div\n      data-slot=\"skeleton\"\n      className={cn(\"bg-accent animate-pulse rounded-md\", className)}\n      {...props}\n    />\n  )\n}\n\nexport { Skeleton }\n"
  },
  {
    "path": "frontend/src/components/ui/sonner.tsx",
    "content": "\"use client\"\n\nimport {\n  CircleCheckIcon,\n  InfoIcon,\n  Loader2Icon,\n  OctagonXIcon,\n  TriangleAlertIcon,\n} from \"lucide-react\"\nimport { useTheme } from \"next-themes\"\nimport { Toaster as Sonner, type ToasterProps } from \"sonner\"\n\nconst Toaster = ({ ...props }: ToasterProps) => {\n  const { theme = \"system\" } = useTheme()\n\n  return (\n    <Sonner\n      theme={theme as ToasterProps[\"theme\"]}\n      className=\"toaster group\"\n      icons={{\n        success: <CircleCheckIcon className=\"size-4\" />,\n        info: <InfoIcon className=\"size-4\" />,\n        warning: <TriangleAlertIcon className=\"size-4\" />,\n        error: <OctagonXIcon className=\"size-4\" />,\n        loading: <Loader2Icon className=\"size-4 animate-spin\" />,\n      }}\n      style={\n        {\n          \"--normal-bg\": \"var(--popover)\",\n          \"--normal-text\": \"var(--popover-foreground)\",\n          \"--normal-border\": \"var(--border)\",\n          \"--border-radius\": \"var(--radius)\",\n        } as React.CSSProperties\n      }\n      {...props}\n    />\n  )\n}\n\nexport { Toaster }\n"
  },
  {
    "path": "frontend/src/components/ui/table.tsx",
    "content": "import * as React from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\nfunction Table({ className, ...props }: React.ComponentProps<\"table\">) {\n  return (\n    <div\n      data-slot=\"table-container\"\n      className=\"relative w-full overflow-x-auto rounded-lg border\"\n    >\n      <table\n        data-slot=\"table\"\n        className={cn(\"w-full caption-bottom text-sm\", className)}\n        {...props}\n      />\n    </div>\n  )\n}\n\nfunction TableHeader({ className, ...props }: React.ComponentProps<\"thead\">) {\n  return (\n    <thead\n      data-slot=\"table-header\"\n      className={cn(\"bg-muted/50 [&_tr]:border-b\", className)}\n      {...props}\n    />\n  )\n}\n\nfunction TableBody({ className, ...props }: React.ComponentProps<\"tbody\">) {\n  return (\n    <tbody\n      data-slot=\"table-body\"\n      className={cn(\"[&_tr:last-child]:border-0\", className)}\n      {...props}\n    />\n  )\n}\n\nfunction TableFooter({ className, ...props }: React.ComponentProps<\"tfoot\">) {\n  return (\n    <tfoot\n      data-slot=\"table-footer\"\n      className={cn(\n        \"bg-muted/50 border-t font-medium [&>tr]:last:border-b-0\",\n        className\n      )}\n      {...props}\n    />\n  )\n}\n\nfunction TableRow({ className, ...props }: React.ComponentProps<\"tr\">) {\n  return (\n    <tr\n      data-slot=\"table-row\"\n      className={cn(\n        \"hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors\",\n        className\n      )}\n      {...props}\n    />\n  )\n}\n\nfunction TableHead({ className, ...props }: React.ComponentProps<\"th\">) {\n  return (\n    <th\n      data-slot=\"table-head\"\n      className={cn(\n        \"text-muted-foreground h-11 px-4 text-left align-middle text-xs font-semibold uppercase tracking-wider whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]\",\n        className\n      )}\n      {...props}\n    />\n  )\n}\n\nfunction TableCell({ className, ...props }: React.ComponentProps<\"td\">) {\n  return (\n    <td\n      data-slot=\"table-cell\"\n      className={cn(\n        \"px-4 py-3 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]\",\n        className\n      )}\n      {...props}\n    />\n  )\n}\n\nfunction TableCaption({\n  className,\n  ...props\n}: React.ComponentProps<\"caption\">) {\n  return (\n    <caption\n      data-slot=\"table-caption\"\n      className={cn(\"text-muted-foreground mt-4 text-sm\", className)}\n      {...props}\n    />\n  )\n}\n\nexport {\n  Table,\n  TableHeader,\n  TableBody,\n  TableFooter,\n  TableHead,\n  TableRow,\n  TableCell,\n  TableCaption,\n}\n"
  },
  {
    "path": "frontend/src/components/ui/tabs.tsx",
    "content": "import * as React from \"react\"\nimport * as TabsPrimitive from \"@radix-ui/react-tabs\"\n\nimport { cn } from \"@/lib/utils\"\n\nfunction Tabs({\n  className,\n  ...props\n}: React.ComponentProps<typeof TabsPrimitive.Root>) {\n  return (\n    <TabsPrimitive.Root\n      data-slot=\"tabs\"\n      className={cn(\"flex flex-col gap-2\", className)}\n      {...props}\n    />\n  )\n}\n\nfunction TabsList({\n  className,\n  ...props\n}: React.ComponentProps<typeof TabsPrimitive.List>) {\n  return (\n    <TabsPrimitive.List\n      data-slot=\"tabs-list\"\n      className={cn(\n        \"bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]\",\n        className\n      )}\n      {...props}\n    />\n  )\n}\n\nfunction TabsTrigger({\n  className,\n  ...props\n}: React.ComponentProps<typeof TabsPrimitive.Trigger>) {\n  return (\n    <TabsPrimitive.Trigger\n      data-slot=\"tabs-trigger\"\n      className={cn(\n        \"data-[state=active]:bg-background dark:data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 text-foreground dark:text-muted-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n        className\n      )}\n      {...props}\n    />\n  )\n}\n\nfunction TabsContent({\n  className,\n  ...props\n}: React.ComponentProps<typeof TabsPrimitive.Content>) {\n  return (\n    <TabsPrimitive.Content\n      data-slot=\"tabs-content\"\n      className={cn(\"flex-1 outline-none\", className)}\n      {...props}\n    />\n  )\n}\n\nexport { Tabs, TabsList, TabsTrigger, TabsContent }\n"
  },
  {
    "path": "frontend/src/components/ui/tooltip.tsx",
    "content": "import * as React from \"react\"\nimport * as TooltipPrimitive from \"@radix-ui/react-tooltip\"\n\nimport { cn } from \"@/lib/utils\"\n\nfunction TooltipProvider({\n  delayDuration = 0,\n  ...props\n}: React.ComponentProps<typeof TooltipPrimitive.Provider>) {\n  return (\n    <TooltipPrimitive.Provider\n      data-slot=\"tooltip-provider\"\n      delayDuration={delayDuration}\n      {...props}\n    />\n  )\n}\n\nfunction Tooltip({\n  ...props\n}: React.ComponentProps<typeof TooltipPrimitive.Root>) {\n  return (\n    <TooltipProvider>\n      <TooltipPrimitive.Root data-slot=\"tooltip\" {...props} />\n    </TooltipProvider>\n  )\n}\n\nfunction TooltipTrigger({\n  ...props\n}: React.ComponentProps<typeof TooltipPrimitive.Trigger>) {\n  return <TooltipPrimitive.Trigger data-slot=\"tooltip-trigger\" {...props} />\n}\n\nfunction TooltipContent({\n  className,\n  sideOffset = 0,\n  children,\n  ...props\n}: React.ComponentProps<typeof TooltipPrimitive.Content>) {\n  return (\n    <TooltipPrimitive.Portal>\n      <TooltipPrimitive.Content\n        data-slot=\"tooltip-content\"\n        sideOffset={sideOffset}\n        className={cn(\n          \"bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance\",\n          className\n        )}\n        {...props}\n      >\n        {children}\n        <TooltipPrimitive.Arrow className=\"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]\" />\n      </TooltipPrimitive.Content>\n    </TooltipPrimitive.Portal>\n  )\n}\n\nexport { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider }\n"
  },
  {
    "path": "frontend/src/hooks/useAuth.ts",
    "content": "import { useMutation, useQuery, useQueryClient } from \"@tanstack/react-query\"\nimport { useNavigate } from \"@tanstack/react-router\"\n\nimport {\n  type Body_login_login_access_token as AccessToken,\n  LoginService,\n  type UserPublic,\n  type UserRegister,\n  UsersService,\n} from \"@/client\"\nimport { handleError } from \"@/utils\"\nimport useCustomToast from \"./useCustomToast\"\n\nconst isLoggedIn = () => {\n  return localStorage.getItem(\"access_token\") !== null\n}\n\nconst useAuth = () => {\n  const navigate = useNavigate()\n  const queryClient = useQueryClient()\n  const { showErrorToast } = useCustomToast()\n\n  const { data: user } = useQuery<UserPublic | null, Error>({\n    queryKey: [\"currentUser\"],\n    queryFn: UsersService.readUserMe,\n    enabled: isLoggedIn(),\n  })\n\n  const signUpMutation = useMutation({\n    mutationFn: (data: UserRegister) =>\n      UsersService.registerUser({ requestBody: data }),\n    onSuccess: () => {\n      navigate({ to: \"/login\" })\n    },\n    onError: handleError.bind(showErrorToast),\n    onSettled: () => {\n      queryClient.invalidateQueries({ queryKey: [\"users\"] })\n    },\n  })\n\n  const login = async (data: AccessToken) => {\n    const response = await LoginService.loginAccessToken({\n      formData: data,\n    })\n    localStorage.setItem(\"access_token\", response.access_token)\n  }\n\n  const loginMutation = useMutation({\n    mutationFn: login,\n    onSuccess: () => {\n      navigate({ to: \"/\" })\n    },\n    onError: handleError.bind(showErrorToast),\n  })\n\n  const logout = () => {\n    localStorage.removeItem(\"access_token\")\n    navigate({ to: \"/login\" })\n  }\n\n  return {\n    signUpMutation,\n    loginMutation,\n    logout,\n    user,\n  }\n}\n\nexport { isLoggedIn }\nexport default useAuth\n"
  },
  {
    "path": "frontend/src/hooks/useCopyToClipboard.ts",
    "content": "// source: https://usehooks-ts.com/react-hook/use-copy-to-clipboard\nimport { useCallback, useState } from \"react\"\n\ntype CopiedValue = string | null\n\ntype CopyFn = (text: string) => Promise<boolean>\n\nexport function useCopyToClipboard(): [CopiedValue, CopyFn] {\n  const [copiedText, setCopiedText] = useState<CopiedValue>(null)\n\n  const copy: CopyFn = useCallback(async (text) => {\n    if (!navigator?.clipboard) {\n      console.warn(\"Clipboard not supported\")\n      return false\n    }\n\n    try {\n      await navigator.clipboard.writeText(text)\n      setCopiedText(text)\n\n      setTimeout(() => setCopiedText(null), 2000)\n\n      return true\n    } catch (error) {\n      console.warn(\"Copy failed\", error)\n      setCopiedText(null)\n      return false\n    }\n  }, [])\n\n  return [copiedText, copy]\n}\n"
  },
  {
    "path": "frontend/src/hooks/useCustomToast.ts",
    "content": "import { toast } from \"sonner\"\n\nconst useCustomToast = () => {\n  const showSuccessToast = (description: string) => {\n    toast.success(\"Success!\", {\n      description,\n    })\n  }\n\n  const showErrorToast = (description: string) => {\n    toast.error(\"Something went wrong!\", {\n      description,\n    })\n  }\n\n  return { showSuccessToast, showErrorToast }\n}\n\nexport default useCustomToast\n"
  },
  {
    "path": "frontend/src/hooks/useMobile.ts",
    "content": "import * as React from \"react\"\n\nconst MOBILE_BREAKPOINT = 768\n\nexport function useIsMobile() {\n  const [isMobile, setIsMobile] = React.useState<boolean | undefined>(undefined)\n\n  React.useEffect(() => {\n    const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`)\n    const onChange = () => {\n      setIsMobile(window.innerWidth < MOBILE_BREAKPOINT)\n    }\n    mql.addEventListener(\"change\", onChange)\n    setIsMobile(window.innerWidth < MOBILE_BREAKPOINT)\n    return () => mql.removeEventListener(\"change\", onChange)\n  }, [])\n\n  return !!isMobile\n}\n"
  },
  {
    "path": "frontend/src/index.css",
    "content": "@import \"tailwindcss\";\n@import \"tw-animate-css\";\n\n@custom-variant dark (&:is(.dark *));\n\n@theme inline {\n  --radius-sm: calc(var(--radius) - 4px);\n  --radius-md: calc(var(--radius) - 2px);\n  --radius-lg: var(--radius);\n  --radius-xl: calc(var(--radius) + 4px);\n  --color-background: var(--background);\n  --color-foreground: var(--foreground);\n  --color-card: var(--card);\n  --color-card-foreground: var(--card-foreground);\n  --color-popover: var(--popover);\n  --color-popover-foreground: var(--popover-foreground);\n  --color-primary: var(--primary);\n  --color-primary-foreground: var(--primary-foreground);\n  --color-secondary: var(--secondary);\n  --color-secondary-foreground: var(--secondary-foreground);\n  --color-muted: var(--muted);\n  --color-muted-foreground: var(--muted-foreground);\n  --color-accent: var(--accent);\n  --color-accent-foreground: var(--accent-foreground);\n  --color-destructive: var(--destructive);\n  --color-border: var(--border);\n  --color-input: var(--input);\n  --color-ring: var(--ring);\n  --color-chart-1: var(--chart-1);\n  --color-chart-2: var(--chart-2);\n  --color-chart-3: var(--chart-3);\n  --color-chart-4: var(--chart-4);\n  --color-chart-5: var(--chart-5);\n  --color-sidebar: var(--sidebar);\n  --color-sidebar-foreground: var(--sidebar-foreground);\n  --color-sidebar-primary: var(--sidebar-primary);\n  --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);\n  --color-sidebar-accent: var(--sidebar-accent);\n  --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);\n  --color-sidebar-border: var(--sidebar-border);\n  --color-sidebar-ring: var(--sidebar-ring);\n}\n\n:root {\n  --radius: 0.625rem;\n  --background: oklch(1 0 0);\n  --foreground: oklch(0.145 0 0);\n  --card: oklch(1 0 0);\n  --card-foreground: oklch(0.145 0 0);\n  --popover: oklch(1 0 0);\n  --popover-foreground: oklch(0.145 0 0);\n  --primary: oklch(0.5982 0.10687 182.4689);\n  --primary-foreground: oklch(0.985 0 0);\n  --secondary: oklch(0.97 0 0);\n  --secondary-foreground: oklch(0.205 0 0);\n  --muted: oklch(0.97 0 0);\n  --muted-foreground: oklch(0.556 0 0);\n  --accent: oklch(0.97 0 0);\n  --accent-foreground: oklch(0.205 0 0);\n  --destructive: oklch(0.577 0.245 27.325);\n  --border: oklch(0.922 0 0);\n  --input: oklch(0.922 0 0);\n  --ring: oklch(0.708 0 0);\n  --chart-1: oklch(0.646 0.222 41.116);\n  --chart-2: oklch(0.6 0.118 184.704);\n  --chart-3: oklch(0.398 0.07 227.392);\n  --chart-4: oklch(0.828 0.189 84.429);\n  --chart-5: oklch(0.769 0.188 70.08);\n  --sidebar: oklch(0.985 0 0);\n  --sidebar-foreground: oklch(0.145 0 0);\n  --sidebar-primary: oklch(0.5982 0.10687 182.4689);\n  --sidebar-primary-foreground: oklch(0.985 0 0);\n  --sidebar-accent: oklch(0.97 0 0);\n  --sidebar-accent-foreground: oklch(0.205 0 0);\n  --sidebar-border: oklch(0.922 0 0);\n  --sidebar-ring: oklch(0.708 0 0);\n}\n\n.dark {\n  --background: oklch(0.145 0 0);\n  --foreground: oklch(0.985 0 0);\n  --card: oklch(0.205 0 0);\n  --card-foreground: oklch(0.985 0 0);\n  --popover: oklch(0.205 0 0);\n  --popover-foreground: oklch(0.985 0 0);\n  --primary: oklch(0.65 0.10687 182.4689);\n  --primary-foreground: oklch(0.985 0 0);\n  --secondary: oklch(0.269 0 0);\n  --secondary-foreground: oklch(0.985 0 0);\n  --muted: oklch(0.269 0 0);\n  --muted-foreground: oklch(0.708 0 0);\n  --accent: oklch(0.269 0 0);\n  --accent-foreground: oklch(0.985 0 0);\n  --destructive: oklch(0.704 0.191 22.216);\n  --border: oklch(1 0 0 / 10%);\n  --input: oklch(1 0 0 / 15%);\n  --ring: oklch(0.556 0 0);\n  --chart-1: oklch(0.488 0.243 264.376);\n  --chart-2: oklch(0.696 0.17 162.48);\n  --chart-3: oklch(0.769 0.188 70.08);\n  --chart-4: oklch(0.627 0.265 303.9);\n  --chart-5: oklch(0.645 0.246 16.439);\n  --sidebar: oklch(0.205 0 0);\n  --sidebar-foreground: oklch(0.985 0 0);\n  --sidebar-primary: oklch(0.65 0.10687 182.4689);\n  --sidebar-primary-foreground: oklch(0.985 0 0);\n  --sidebar-accent: oklch(0.269 0 0);\n  --sidebar-accent-foreground: oklch(0.985 0 0);\n  --sidebar-border: oklch(1 0 0 / 10%);\n  --sidebar-ring: oklch(0.556 0 0);\n}\n\n@layer base {\n  * {\n    @apply border-border outline-ring/50;\n  }\n  body {\n    @apply bg-background text-foreground;\n  }\n  button,\n  [role=\"button\"] {\n    cursor: pointer;\n  }\n}\n"
  },
  {
    "path": "frontend/src/lib/utils.ts",
    "content": "import { type ClassValue, clsx } from \"clsx\"\nimport { twMerge } from \"tailwind-merge\"\n\nexport function cn(...inputs: ClassValue[]) {\n  return twMerge(clsx(inputs))\n}\n"
  },
  {
    "path": "frontend/src/main.tsx",
    "content": "import {\n  MutationCache,\n  QueryCache,\n  QueryClient,\n  QueryClientProvider,\n} from \"@tanstack/react-query\"\nimport { createRouter, RouterProvider } from \"@tanstack/react-router\"\nimport { StrictMode } from \"react\"\nimport ReactDOM from \"react-dom/client\"\nimport { ApiError, OpenAPI } from \"./client\"\nimport { ThemeProvider } from \"./components/theme-provider\"\nimport { Toaster } from \"./components/ui/sonner\"\nimport \"./index.css\"\nimport { routeTree } from \"./routeTree.gen\"\n\nOpenAPI.BASE = import.meta.env.VITE_API_URL\nOpenAPI.TOKEN = async () => {\n  return localStorage.getItem(\"access_token\") || \"\"\n}\n\nconst handleApiError = (error: Error) => {\n  if (error instanceof ApiError && [401, 403].includes(error.status)) {\n    localStorage.removeItem(\"access_token\")\n    window.location.href = \"/login\"\n  }\n}\nconst queryClient = new QueryClient({\n  queryCache: new QueryCache({\n    onError: handleApiError,\n  }),\n  mutationCache: new MutationCache({\n    onError: handleApiError,\n  }),\n})\n\nconst router = createRouter({ routeTree })\ndeclare module \"@tanstack/react-router\" {\n  interface Register {\n    router: typeof router\n  }\n}\n\nReactDOM.createRoot(document.getElementById(\"root\")!).render(\n  <StrictMode>\n    <ThemeProvider defaultTheme=\"dark\" storageKey=\"vite-ui-theme\">\n      <QueryClientProvider client={queryClient}>\n        <RouterProvider router={router} />\n        <Toaster richColors closeButton />\n      </QueryClientProvider>\n    </ThemeProvider>\n  </StrictMode>,\n)\n"
  },
  {
    "path": "frontend/src/routeTree.gen.ts",
    "content": "/* eslint-disable */\n\n// @ts-nocheck\n\n// noinspection JSUnusedGlobalSymbols\n\n// This file was automatically generated by TanStack Router.\n// You should NOT make any changes in this file as it will be overwritten.\n// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.\n\nimport { Route as rootRouteImport } from './routes/__root'\nimport { Route as SignupRouteImport } from './routes/signup'\nimport { Route as ResetPasswordRouteImport } from './routes/reset-password'\nimport { Route as RecoverPasswordRouteImport } from './routes/recover-password'\nimport { Route as LoginRouteImport } from './routes/login'\nimport { Route as LayoutRouteImport } from './routes/_layout'\nimport { Route as LayoutIndexRouteImport } from './routes/_layout/index'\nimport { Route as LayoutSettingsRouteImport } from './routes/_layout/settings'\nimport { Route as LayoutItemsRouteImport } from './routes/_layout/items'\nimport { Route as LayoutAdminRouteImport } from './routes/_layout/admin'\n\nconst SignupRoute = SignupRouteImport.update({\n  id: '/signup',\n  path: '/signup',\n  getParentRoute: () => rootRouteImport,\n} as any)\nconst ResetPasswordRoute = ResetPasswordRouteImport.update({\n  id: '/reset-password',\n  path: '/reset-password',\n  getParentRoute: () => rootRouteImport,\n} as any)\nconst RecoverPasswordRoute = RecoverPasswordRouteImport.update({\n  id: '/recover-password',\n  path: '/recover-password',\n  getParentRoute: () => rootRouteImport,\n} as any)\nconst LoginRoute = LoginRouteImport.update({\n  id: '/login',\n  path: '/login',\n  getParentRoute: () => rootRouteImport,\n} as any)\nconst LayoutRoute = LayoutRouteImport.update({\n  id: '/_layout',\n  getParentRoute: () => rootRouteImport,\n} as any)\nconst LayoutIndexRoute = LayoutIndexRouteImport.update({\n  id: '/',\n  path: '/',\n  getParentRoute: () => LayoutRoute,\n} as any)\nconst LayoutSettingsRoute = LayoutSettingsRouteImport.update({\n  id: '/settings',\n  path: '/settings',\n  getParentRoute: () => LayoutRoute,\n} as any)\nconst LayoutItemsRoute = LayoutItemsRouteImport.update({\n  id: '/items',\n  path: '/items',\n  getParentRoute: () => LayoutRoute,\n} as any)\nconst LayoutAdminRoute = LayoutAdminRouteImport.update({\n  id: '/admin',\n  path: '/admin',\n  getParentRoute: () => LayoutRoute,\n} as any)\n\nexport interface FileRoutesByFullPath {\n  '/login': typeof LoginRoute\n  '/recover-password': typeof RecoverPasswordRoute\n  '/reset-password': typeof ResetPasswordRoute\n  '/signup': typeof SignupRoute\n  '/admin': typeof LayoutAdminRoute\n  '/items': typeof LayoutItemsRoute\n  '/settings': typeof LayoutSettingsRoute\n  '/': typeof LayoutIndexRoute\n}\nexport interface FileRoutesByTo {\n  '/login': typeof LoginRoute\n  '/recover-password': typeof RecoverPasswordRoute\n  '/reset-password': typeof ResetPasswordRoute\n  '/signup': typeof SignupRoute\n  '/admin': typeof LayoutAdminRoute\n  '/items': typeof LayoutItemsRoute\n  '/settings': typeof LayoutSettingsRoute\n  '/': typeof LayoutIndexRoute\n}\nexport interface FileRoutesById {\n  __root__: typeof rootRouteImport\n  '/_layout': typeof LayoutRouteWithChildren\n  '/login': typeof LoginRoute\n  '/recover-password': typeof RecoverPasswordRoute\n  '/reset-password': typeof ResetPasswordRoute\n  '/signup': typeof SignupRoute\n  '/_layout/admin': typeof LayoutAdminRoute\n  '/_layout/items': typeof LayoutItemsRoute\n  '/_layout/settings': typeof LayoutSettingsRoute\n  '/_layout/': typeof LayoutIndexRoute\n}\nexport interface FileRouteTypes {\n  fileRoutesByFullPath: FileRoutesByFullPath\n  fullPaths:\n    | '/login'\n    | '/recover-password'\n    | '/reset-password'\n    | '/signup'\n    | '/admin'\n    | '/items'\n    | '/settings'\n    | '/'\n  fileRoutesByTo: FileRoutesByTo\n  to:\n    | '/login'\n    | '/recover-password'\n    | '/reset-password'\n    | '/signup'\n    | '/admin'\n    | '/items'\n    | '/settings'\n    | '/'\n  id:\n    | '__root__'\n    | '/_layout'\n    | '/login'\n    | '/recover-password'\n    | '/reset-password'\n    | '/signup'\n    | '/_layout/admin'\n    | '/_layout/items'\n    | '/_layout/settings'\n    | '/_layout/'\n  fileRoutesById: FileRoutesById\n}\nexport interface RootRouteChildren {\n  LayoutRoute: typeof LayoutRouteWithChildren\n  LoginRoute: typeof LoginRoute\n  RecoverPasswordRoute: typeof RecoverPasswordRoute\n  ResetPasswordRoute: typeof ResetPasswordRoute\n  SignupRoute: typeof SignupRoute\n}\n\ndeclare module '@tanstack/react-router' {\n  interface FileRoutesByPath {\n    '/signup': {\n      id: '/signup'\n      path: '/signup'\n      fullPath: '/signup'\n      preLoaderRoute: typeof SignupRouteImport\n      parentRoute: typeof rootRouteImport\n    }\n    '/reset-password': {\n      id: '/reset-password'\n      path: '/reset-password'\n      fullPath: '/reset-password'\n      preLoaderRoute: typeof ResetPasswordRouteImport\n      parentRoute: typeof rootRouteImport\n    }\n    '/recover-password': {\n      id: '/recover-password'\n      path: '/recover-password'\n      fullPath: '/recover-password'\n      preLoaderRoute: typeof RecoverPasswordRouteImport\n      parentRoute: typeof rootRouteImport\n    }\n    '/login': {\n      id: '/login'\n      path: '/login'\n      fullPath: '/login'\n      preLoaderRoute: typeof LoginRouteImport\n      parentRoute: typeof rootRouteImport\n    }\n    '/_layout': {\n      id: '/_layout'\n      path: ''\n      fullPath: ''\n      preLoaderRoute: typeof LayoutRouteImport\n      parentRoute: typeof rootRouteImport\n    }\n    '/_layout/': {\n      id: '/_layout/'\n      path: '/'\n      fullPath: '/'\n      preLoaderRoute: typeof LayoutIndexRouteImport\n      parentRoute: typeof LayoutRoute\n    }\n    '/_layout/settings': {\n      id: '/_layout/settings'\n      path: '/settings'\n      fullPath: '/settings'\n      preLoaderRoute: typeof LayoutSettingsRouteImport\n      parentRoute: typeof LayoutRoute\n    }\n    '/_layout/items': {\n      id: '/_layout/items'\n      path: '/items'\n      fullPath: '/items'\n      preLoaderRoute: typeof LayoutItemsRouteImport\n      parentRoute: typeof LayoutRoute\n    }\n    '/_layout/admin': {\n      id: '/_layout/admin'\n      path: '/admin'\n      fullPath: '/admin'\n      preLoaderRoute: typeof LayoutAdminRouteImport\n      parentRoute: typeof LayoutRoute\n    }\n  }\n}\n\ninterface LayoutRouteChildren {\n  LayoutAdminRoute: typeof LayoutAdminRoute\n  LayoutItemsRoute: typeof LayoutItemsRoute\n  LayoutSettingsRoute: typeof LayoutSettingsRoute\n  LayoutIndexRoute: typeof LayoutIndexRoute\n}\n\nconst LayoutRouteChildren: LayoutRouteChildren = {\n  LayoutAdminRoute: LayoutAdminRoute,\n  LayoutItemsRoute: LayoutItemsRoute,\n  LayoutSettingsRoute: LayoutSettingsRoute,\n  LayoutIndexRoute: LayoutIndexRoute,\n}\n\nconst LayoutRouteWithChildren =\n  LayoutRoute._addFileChildren(LayoutRouteChildren)\n\nconst rootRouteChildren: RootRouteChildren = {\n  LayoutRoute: LayoutRouteWithChildren,\n  LoginRoute: LoginRoute,\n  RecoverPasswordRoute: RecoverPasswordRoute,\n  ResetPasswordRoute: ResetPasswordRoute,\n  SignupRoute: SignupRoute,\n}\nexport const routeTree = rootRouteImport\n  ._addFileChildren(rootRouteChildren)\n  ._addFileTypes<FileRouteTypes>()\n"
  },
  {
    "path": "frontend/src/routes/__root.tsx",
    "content": "import { ReactQueryDevtools } from \"@tanstack/react-query-devtools\"\nimport { createRootRoute, HeadContent, Outlet } from \"@tanstack/react-router\"\nimport { TanStackRouterDevtools } from \"@tanstack/react-router-devtools\"\nimport ErrorComponent from \"@/components/Common/ErrorComponent\"\nimport NotFound from \"@/components/Common/NotFound\"\n\nexport const Route = createRootRoute({\n  component: () => (\n    <>\n      <HeadContent />\n      <Outlet />\n      <TanStackRouterDevtools position=\"bottom-right\" />\n      <ReactQueryDevtools initialIsOpen={false} />\n    </>\n  ),\n  notFoundComponent: () => <NotFound />,\n  errorComponent: () => <ErrorComponent />,\n})\n"
  },
  {
    "path": "frontend/src/routes/_layout/admin.tsx",
    "content": "import { useSuspenseQuery } from \"@tanstack/react-query\"\nimport { createFileRoute, redirect } from \"@tanstack/react-router\"\nimport { Suspense } from \"react\"\n\nimport { type UserPublic, UsersService } from \"@/client\"\nimport AddUser from \"@/components/Admin/AddUser\"\nimport { columns, type UserTableData } from \"@/components/Admin/columns\"\nimport { DataTable } from \"@/components/Common/DataTable\"\nimport PendingUsers from \"@/components/Pending/PendingUsers\"\nimport useAuth from \"@/hooks/useAuth\"\n\nfunction getUsersQueryOptions() {\n  return {\n    queryFn: () => UsersService.readUsers({ skip: 0, limit: 100 }),\n    queryKey: [\"users\"],\n  }\n}\n\nexport const Route = createFileRoute(\"/_layout/admin\")({\n  component: Admin,\n  beforeLoad: async () => {\n    const user = await UsersService.readUserMe()\n    if (!user.is_superuser) {\n      throw redirect({\n        to: \"/\",\n      })\n    }\n  },\n  head: () => ({\n    meta: [\n      {\n        title: \"Admin - FastAPI Template\",\n      },\n    ],\n  }),\n})\n\nfunction UsersTableContent() {\n  const { user: currentUser } = useAuth()\n  const { data: users } = useSuspenseQuery(getUsersQueryOptions())\n\n  const tableData: UserTableData[] = users.data.map((user: UserPublic) => ({\n    ...user,\n    isCurrentUser: currentUser?.id === user.id,\n  }))\n\n  return <DataTable columns={columns} data={tableData} />\n}\n\nfunction UsersTable() {\n  return (\n    <Suspense fallback={<PendingUsers />}>\n      <UsersTableContent />\n    </Suspense>\n  )\n}\n\nfunction Admin() {\n  return (\n    <div className=\"flex flex-col gap-6\">\n      <div className=\"flex items-center justify-between\">\n        <div>\n          <h1 className=\"text-2xl font-bold tracking-tight\">Users</h1>\n          <p className=\"text-muted-foreground\">\n            Manage user accounts and permissions\n          </p>\n        </div>\n        <AddUser />\n      </div>\n      <UsersTable />\n    </div>\n  )\n}\n"
  },
  {
    "path": "frontend/src/routes/_layout/index.tsx",
    "content": "import { createFileRoute } from \"@tanstack/react-router\"\n\nimport useAuth from \"@/hooks/useAuth\"\n\nexport const Route = createFileRoute(\"/_layout/\")({\n  component: Dashboard,\n  head: () => ({\n    meta: [\n      {\n        title: \"Dashboard - FastAPI Template\",\n      },\n    ],\n  }),\n})\n\nfunction Dashboard() {\n  const { user: currentUser } = useAuth()\n\n  return (\n    <div>\n      <div>\n        <h1 className=\"text-2xl truncate max-w-sm\">\n          Hi, {currentUser?.full_name || currentUser?.email} 👋\n        </h1>\n        <p className=\"text-muted-foreground\">\n          Welcome back, nice to see you again!!!\n        </p>\n      </div>\n    </div>\n  )\n}\n"
  },
  {
    "path": "frontend/src/routes/_layout/items.tsx",
    "content": "import { useSuspenseQuery } from \"@tanstack/react-query\"\nimport { createFileRoute } from \"@tanstack/react-router\"\nimport { Search } from \"lucide-react\"\nimport { Suspense } from \"react\"\n\nimport { ItemsService } from \"@/client\"\nimport { DataTable } from \"@/components/Common/DataTable\"\nimport AddItem from \"@/components/Items/AddItem\"\nimport { columns } from \"@/components/Items/columns\"\nimport PendingItems from \"@/components/Pending/PendingItems\"\n\nfunction getItemsQueryOptions() {\n  return {\n    queryFn: () => ItemsService.readItems({ skip: 0, limit: 100 }),\n    queryKey: [\"items\"],\n  }\n}\n\nexport const Route = createFileRoute(\"/_layout/items\")({\n  component: Items,\n  head: () => ({\n    meta: [\n      {\n        title: \"Items - FastAPI Template\",\n      },\n    ],\n  }),\n})\n\nfunction ItemsTableContent() {\n  const { data: items } = useSuspenseQuery(getItemsQueryOptions())\n\n  if (items.data.length === 0) {\n    return (\n      <div className=\"flex flex-col items-center justify-center text-center py-12\">\n        <div className=\"rounded-full bg-muted p-4 mb-4\">\n          <Search className=\"h-8 w-8 text-muted-foreground\" />\n        </div>\n        <h3 className=\"text-lg font-semibold\">You don't have any items yet</h3>\n        <p className=\"text-muted-foreground\">Add a new item to get started</p>\n      </div>\n    )\n  }\n\n  return <DataTable columns={columns} data={items.data} />\n}\n\nfunction ItemsTable() {\n  return (\n    <Suspense fallback={<PendingItems />}>\n      <ItemsTableContent />\n    </Suspense>\n  )\n}\n\nfunction Items() {\n  return (\n    <div className=\"flex flex-col gap-6\">\n      <div className=\"flex items-center justify-between\">\n        <div>\n          <h1 className=\"text-2xl font-bold tracking-tight\">Items</h1>\n          <p className=\"text-muted-foreground\">Create and manage your items</p>\n        </div>\n        <AddItem />\n      </div>\n      <ItemsTable />\n    </div>\n  )\n}\n"
  },
  {
    "path": "frontend/src/routes/_layout/settings.tsx",
    "content": "import { createFileRoute } from \"@tanstack/react-router\"\n\nimport ChangePassword from \"@/components/UserSettings/ChangePassword\"\nimport DeleteAccount from \"@/components/UserSettings/DeleteAccount\"\nimport UserInformation from \"@/components/UserSettings/UserInformation\"\nimport { Tabs, TabsContent, TabsList, TabsTrigger } from \"@/components/ui/tabs\"\nimport useAuth from \"@/hooks/useAuth\"\n\nconst tabsConfig = [\n  { value: \"my-profile\", title: \"My profile\", component: UserInformation },\n  { value: \"password\", title: \"Password\", component: ChangePassword },\n  { value: \"danger-zone\", title: \"Danger zone\", component: DeleteAccount },\n]\n\nexport const Route = createFileRoute(\"/_layout/settings\")({\n  component: UserSettings,\n  head: () => ({\n    meta: [\n      {\n        title: \"Settings - FastAPI Template\",\n      },\n    ],\n  }),\n})\n\nfunction UserSettings() {\n  const { user: currentUser } = useAuth()\n  const finalTabs = currentUser?.is_superuser\n    ? tabsConfig.slice(0, 3)\n    : tabsConfig\n\n  if (!currentUser) {\n    return null\n  }\n\n  return (\n    <div className=\"flex flex-col gap-6\">\n      <div>\n        <h1 className=\"text-2xl font-bold tracking-tight\">User Settings</h1>\n        <p className=\"text-muted-foreground\">\n          Manage your account settings and preferences\n        </p>\n      </div>\n\n      <Tabs defaultValue=\"my-profile\">\n        <TabsList>\n          {finalTabs.map((tab) => (\n            <TabsTrigger key={tab.value} value={tab.value}>\n              {tab.title}\n            </TabsTrigger>\n          ))}\n        </TabsList>\n        {finalTabs.map((tab) => (\n          <TabsContent key={tab.value} value={tab.value}>\n            <tab.component />\n          </TabsContent>\n        ))}\n      </Tabs>\n    </div>\n  )\n}\n"
  },
  {
    "path": "frontend/src/routes/_layout.tsx",
    "content": "import { createFileRoute, Outlet, redirect } from \"@tanstack/react-router\"\n\nimport { Footer } from \"@/components/Common/Footer\"\nimport AppSidebar from \"@/components/Sidebar/AppSidebar\"\nimport {\n  SidebarInset,\n  SidebarProvider,\n  SidebarTrigger,\n} from \"@/components/ui/sidebar\"\nimport { isLoggedIn } from \"@/hooks/useAuth\"\n\nexport const Route = createFileRoute(\"/_layout\")({\n  component: Layout,\n  beforeLoad: async () => {\n    if (!isLoggedIn()) {\n      throw redirect({\n        to: \"/login\",\n      })\n    }\n  },\n})\n\nfunction Layout() {\n  return (\n    <SidebarProvider>\n      <AppSidebar />\n      <SidebarInset>\n        <header className=\"sticky top-0 z-10 flex h-16 shrink-0 items-center gap-2 border-b px-4\">\n          <SidebarTrigger className=\"-ml-1 text-muted-foreground\" />\n        </header>\n        <main className=\"flex-1 p-6 md:p-8\">\n          <div className=\"mx-auto max-w-7xl\">\n            <Outlet />\n          </div>\n        </main>\n        <Footer />\n      </SidebarInset>\n    </SidebarProvider>\n  )\n}\n\nexport default Layout\n"
  },
  {
    "path": "frontend/src/routes/login.tsx",
    "content": "import { zodResolver } from \"@hookform/resolvers/zod\"\nimport {\n  createFileRoute,\n  Link as RouterLink,\n  redirect,\n} from \"@tanstack/react-router\"\nimport { useForm } from \"react-hook-form\"\nimport { z } from \"zod\"\n\nimport type { Body_login_login_access_token as AccessToken } from \"@/client\"\nimport { AuthLayout } from \"@/components/Common/AuthLayout\"\nimport {\n  Form,\n  FormControl,\n  FormField,\n  FormItem,\n  FormLabel,\n  FormMessage,\n} from \"@/components/ui/form\"\nimport { Input } from \"@/components/ui/input\"\nimport { LoadingButton } from \"@/components/ui/loading-button\"\nimport { PasswordInput } from \"@/components/ui/password-input\"\nimport useAuth, { isLoggedIn } from \"@/hooks/useAuth\"\n\nconst formSchema = z.object({\n  username: z.email(),\n  password: z\n    .string()\n    .min(1, { message: \"Password is required\" })\n    .min(8, { message: \"Password must be at least 8 characters\" }),\n}) satisfies z.ZodType<AccessToken>\n\ntype FormData = z.infer<typeof formSchema>\n\nexport const Route = createFileRoute(\"/login\")({\n  component: Login,\n  beforeLoad: async () => {\n    if (isLoggedIn()) {\n      throw redirect({\n        to: \"/\",\n      })\n    }\n  },\n  head: () => ({\n    meta: [\n      {\n        title: \"Log In - FastAPI Template\",\n      },\n    ],\n  }),\n})\n\nfunction Login() {\n  const { loginMutation } = useAuth()\n  const form = useForm<FormData>({\n    resolver: zodResolver(formSchema),\n    mode: \"onBlur\",\n    criteriaMode: \"all\",\n    defaultValues: {\n      username: \"\",\n      password: \"\",\n    },\n  })\n\n  const onSubmit = (data: FormData) => {\n    if (loginMutation.isPending) return\n    loginMutation.mutate(data)\n  }\n\n  return (\n    <AuthLayout>\n      <Form {...form}>\n        <form\n          onSubmit={form.handleSubmit(onSubmit)}\n          className=\"flex flex-col gap-6\"\n        >\n          <div className=\"flex flex-col items-center gap-2 text-center\">\n            <h1 className=\"text-2xl font-bold\">Login to your account</h1>\n          </div>\n\n          <div className=\"grid gap-4\">\n            <FormField\n              control={form.control}\n              name=\"username\"\n              render={({ field }) => (\n                <FormItem>\n                  <FormLabel>Email</FormLabel>\n                  <FormControl>\n                    <Input\n                      data-testid=\"email-input\"\n                      placeholder=\"user@example.com\"\n                      type=\"email\"\n                      {...field}\n                    />\n                  </FormControl>\n                  <FormMessage className=\"text-xs\" />\n                </FormItem>\n              )}\n            />\n\n            <FormField\n              control={form.control}\n              name=\"password\"\n              render={({ field }) => (\n                <FormItem>\n                  <div className=\"flex items-center\">\n                    <FormLabel>Password</FormLabel>\n                    <RouterLink\n                      to=\"/recover-password\"\n                      className=\"ml-auto text-sm underline-offset-4 hover:underline\"\n                    >\n                      Forgot your password?\n                    </RouterLink>\n                  </div>\n                  <FormControl>\n                    <PasswordInput\n                      data-testid=\"password-input\"\n                      placeholder=\"Password\"\n                      {...field}\n                    />\n                  </FormControl>\n                  <FormMessage className=\"text-xs\" />\n                </FormItem>\n              )}\n            />\n\n            <LoadingButton type=\"submit\" loading={loginMutation.isPending}>\n              Log In\n            </LoadingButton>\n          </div>\n\n          <div className=\"text-center text-sm\">\n            Don't have an account yet?{\" \"}\n            <RouterLink to=\"/signup\" className=\"underline underline-offset-4\">\n              Sign up\n            </RouterLink>\n          </div>\n        </form>\n      </Form>\n    </AuthLayout>\n  )\n}\n"
  },
  {
    "path": "frontend/src/routes/recover-password.tsx",
    "content": "import { zodResolver } from \"@hookform/resolvers/zod\"\nimport { useMutation } from \"@tanstack/react-query\"\nimport {\n  createFileRoute,\n  Link as RouterLink,\n  redirect,\n} from \"@tanstack/react-router\"\nimport { useForm } from \"react-hook-form\"\nimport { z } from \"zod\"\n\nimport { LoginService } from \"@/client\"\nimport { AuthLayout } from \"@/components/Common/AuthLayout\"\nimport {\n  Form,\n  FormControl,\n  FormField,\n  FormItem,\n  FormLabel,\n  FormMessage,\n} from \"@/components/ui/form\"\nimport { Input } from \"@/components/ui/input\"\nimport { LoadingButton } from \"@/components/ui/loading-button\"\nimport { isLoggedIn } from \"@/hooks/useAuth\"\nimport useCustomToast from \"@/hooks/useCustomToast\"\nimport { handleError } from \"@/utils\"\n\nconst formSchema = z.object({\n  email: z.email(),\n})\n\ntype FormData = z.infer<typeof formSchema>\n\nexport const Route = createFileRoute(\"/recover-password\")({\n  component: RecoverPassword,\n  beforeLoad: async () => {\n    if (isLoggedIn()) {\n      throw redirect({\n        to: \"/\",\n      })\n    }\n  },\n  head: () => ({\n    meta: [\n      {\n        title: \"Recover Password - FastAPI Template\",\n      },\n    ],\n  }),\n})\n\nfunction RecoverPassword() {\n  const form = useForm<FormData>({\n    resolver: zodResolver(formSchema),\n    defaultValues: {\n      email: \"\",\n    },\n  })\n  const { showSuccessToast, showErrorToast } = useCustomToast()\n\n  const recoverPassword = async (data: FormData) => {\n    await LoginService.recoverPassword({\n      email: data.email,\n    })\n  }\n\n  const mutation = useMutation({\n    mutationFn: recoverPassword,\n    onSuccess: () => {\n      showSuccessToast(\"Password recovery email sent successfully\")\n      form.reset()\n    },\n    onError: handleError.bind(showErrorToast),\n  })\n\n  const onSubmit = async (data: FormData) => {\n    if (mutation.isPending) return\n    mutation.mutate(data)\n  }\n\n  return (\n    <AuthLayout>\n      <Form {...form}>\n        <form\n          onSubmit={form.handleSubmit(onSubmit)}\n          className=\"flex flex-col gap-6\"\n        >\n          <div className=\"flex flex-col items-center gap-2 text-center\">\n            <h1 className=\"text-2xl font-bold\">Password Recovery</h1>\n          </div>\n\n          <div className=\"grid gap-4\">\n            <FormField\n              control={form.control}\n              name=\"email\"\n              render={({ field }) => (\n                <FormItem>\n                  <FormLabel>Email</FormLabel>\n                  <FormControl>\n                    <Input\n                      data-testid=\"email-input\"\n                      placeholder=\"user@example.com\"\n                      type=\"email\"\n                      {...field}\n                    />\n                  </FormControl>\n                  <FormMessage />\n                </FormItem>\n              )}\n            />\n\n            <LoadingButton\n              type=\"submit\"\n              className=\"w-full\"\n              loading={mutation.isPending}\n            >\n              Continue\n            </LoadingButton>\n          </div>\n\n          <div className=\"text-center text-sm\">\n            Remember your password?{\" \"}\n            <RouterLink to=\"/login\" className=\"underline underline-offset-4\">\n              Log in\n            </RouterLink>\n          </div>\n        </form>\n      </Form>\n    </AuthLayout>\n  )\n}\n"
  },
  {
    "path": "frontend/src/routes/reset-password.tsx",
    "content": "import { zodResolver } from \"@hookform/resolvers/zod\"\nimport { useMutation } from \"@tanstack/react-query\"\nimport {\n  createFileRoute,\n  Link as RouterLink,\n  redirect,\n  useNavigate,\n} from \"@tanstack/react-router\"\nimport { useForm } from \"react-hook-form\"\nimport { z } from \"zod\"\n\nimport { LoginService } from \"@/client\"\nimport { AuthLayout } from \"@/components/Common/AuthLayout\"\nimport {\n  Form,\n  FormControl,\n  FormField,\n  FormItem,\n  FormLabel,\n  FormMessage,\n} from \"@/components/ui/form\"\nimport { LoadingButton } from \"@/components/ui/loading-button\"\nimport { PasswordInput } from \"@/components/ui/password-input\"\nimport { isLoggedIn } from \"@/hooks/useAuth\"\nimport useCustomToast from \"@/hooks/useCustomToast\"\nimport { handleError } from \"@/utils\"\n\nconst searchSchema = z.object({\n  token: z.string().catch(\"\"),\n})\n\nconst formSchema = z\n  .object({\n    new_password: z\n      .string()\n      .min(1, { message: \"Password is required\" })\n      .min(8, { message: \"Password must be at least 8 characters\" }),\n    confirm_password: z\n      .string()\n      .min(1, { message: \"Password confirmation is required\" }),\n  })\n  .refine((data) => data.new_password === data.confirm_password, {\n    message: \"The passwords don't match\",\n    path: [\"confirm_password\"],\n  })\n\ntype FormData = z.infer<typeof formSchema>\n\nexport const Route = createFileRoute(\"/reset-password\")({\n  component: ResetPassword,\n  validateSearch: searchSchema,\n  beforeLoad: async ({ search }) => {\n    if (isLoggedIn()) {\n      throw redirect({ to: \"/\" })\n    }\n    if (!search.token) {\n      throw redirect({ to: \"/login\" })\n    }\n  },\n  head: () => ({\n    meta: [\n      {\n        title: \"Reset Password - FastAPI Template\",\n      },\n    ],\n  }),\n})\n\nfunction ResetPassword() {\n  const { token } = Route.useSearch()\n  const { showSuccessToast, showErrorToast } = useCustomToast()\n  const navigate = useNavigate()\n\n  const form = useForm<FormData>({\n    resolver: zodResolver(formSchema),\n    mode: \"onBlur\",\n    criteriaMode: \"all\",\n    defaultValues: {\n      new_password: \"\",\n      confirm_password: \"\",\n    },\n  })\n\n  const mutation = useMutation({\n    mutationFn: (data: { new_password: string; token: string }) =>\n      LoginService.resetPassword({ requestBody: data }),\n    onSuccess: () => {\n      showSuccessToast(\"Password updated successfully\")\n      form.reset()\n      navigate({ to: \"/login\" })\n    },\n    onError: handleError.bind(showErrorToast),\n  })\n\n  const onSubmit = (data: FormData) => {\n    mutation.mutate({ new_password: data.new_password, token })\n  }\n\n  return (\n    <AuthLayout>\n      <Form {...form}>\n        <form\n          onSubmit={form.handleSubmit(onSubmit)}\n          className=\"flex flex-col gap-6\"\n        >\n          <div className=\"flex flex-col items-center gap-2 text-center\">\n            <h1 className=\"text-2xl font-bold\">Reset Password</h1>\n          </div>\n\n          <div className=\"grid gap-4\">\n            <FormField\n              control={form.control}\n              name=\"new_password\"\n              render={({ field }) => (\n                <FormItem>\n                  <FormLabel>New Password</FormLabel>\n                  <FormControl>\n                    <PasswordInput\n                      data-testid=\"new-password-input\"\n                      placeholder=\"New Password\"\n                      {...field}\n                    />\n                  </FormControl>\n                  <FormMessage />\n                </FormItem>\n              )}\n            />\n\n            <FormField\n              control={form.control}\n              name=\"confirm_password\"\n              render={({ field }) => (\n                <FormItem>\n                  <FormLabel>Confirm Password</FormLabel>\n                  <FormControl>\n                    <PasswordInput\n                      data-testid=\"confirm-password-input\"\n                      placeholder=\"Confirm Password\"\n                      {...field}\n                    />\n                  </FormControl>\n                  <FormMessage />\n                </FormItem>\n              )}\n            />\n\n            <LoadingButton\n              type=\"submit\"\n              className=\"w-full\"\n              loading={mutation.isPending}\n            >\n              Reset Password\n            </LoadingButton>\n          </div>\n\n          <div className=\"text-center text-sm\">\n            Remember your password?{\" \"}\n            <RouterLink to=\"/login\" className=\"underline underline-offset-4\">\n              Log in\n            </RouterLink>\n          </div>\n        </form>\n      </Form>\n    </AuthLayout>\n  )\n}\n"
  },
  {
    "path": "frontend/src/routes/signup.tsx",
    "content": "import { zodResolver } from \"@hookform/resolvers/zod\"\nimport {\n  createFileRoute,\n  Link as RouterLink,\n  redirect,\n} from \"@tanstack/react-router\"\nimport { useForm } from \"react-hook-form\"\nimport { z } from \"zod\"\nimport { AuthLayout } from \"@/components/Common/AuthLayout\"\nimport {\n  Form,\n  FormControl,\n  FormField,\n  FormItem,\n  FormLabel,\n  FormMessage,\n} from \"@/components/ui/form\"\nimport { Input } from \"@/components/ui/input\"\nimport { LoadingButton } from \"@/components/ui/loading-button\"\nimport { PasswordInput } from \"@/components/ui/password-input\"\nimport useAuth, { isLoggedIn } from \"@/hooks/useAuth\"\n\nconst formSchema = z\n  .object({\n    email: z.email(),\n    full_name: z.string().min(1, { message: \"Full Name is required\" }),\n    password: z\n      .string()\n      .min(1, { message: \"Password is required\" })\n      .min(8, { message: \"Password must be at least 8 characters\" }),\n    confirm_password: z\n      .string()\n      .min(1, { message: \"Password confirmation is required\" }),\n  })\n  .refine((data) => data.password === data.confirm_password, {\n    message: \"The passwords don't match\",\n    path: [\"confirm_password\"],\n  })\n\ntype FormData = z.infer<typeof formSchema>\n\nexport const Route = createFileRoute(\"/signup\")({\n  component: SignUp,\n  beforeLoad: async () => {\n    if (isLoggedIn()) {\n      throw redirect({\n        to: \"/\",\n      })\n    }\n  },\n  head: () => ({\n    meta: [\n      {\n        title: \"Sign Up - FastAPI Template\",\n      },\n    ],\n  }),\n})\n\nfunction SignUp() {\n  const { signUpMutation } = useAuth()\n  const form = useForm<FormData>({\n    resolver: zodResolver(formSchema),\n    mode: \"onBlur\",\n    criteriaMode: \"all\",\n    defaultValues: {\n      email: \"\",\n      full_name: \"\",\n      password: \"\",\n      confirm_password: \"\",\n    },\n  })\n\n  const onSubmit = (data: FormData) => {\n    if (signUpMutation.isPending) return\n\n    // exclude confirm_password from submission data\n    const { confirm_password: _confirm_password, ...submitData } = data\n    signUpMutation.mutate(submitData)\n  }\n\n  return (\n    <AuthLayout>\n      <Form {...form}>\n        <form\n          onSubmit={form.handleSubmit(onSubmit)}\n          className=\"flex flex-col gap-6\"\n        >\n          <div className=\"flex flex-col items-center gap-2 text-center\">\n            <h1 className=\"text-2xl font-bold\">Create an account</h1>\n          </div>\n\n          <div className=\"grid gap-4\">\n            <FormField\n              control={form.control}\n              name=\"full_name\"\n              render={({ field }) => (\n                <FormItem>\n                  <FormLabel>Full Name</FormLabel>\n                  <FormControl>\n                    <Input\n                      data-testid=\"full-name-input\"\n                      placeholder=\"User\"\n                      type=\"text\"\n                      {...field}\n                    />\n                  </FormControl>\n                  <FormMessage />\n                </FormItem>\n              )}\n            />\n\n            <FormField\n              control={form.control}\n              name=\"email\"\n              render={({ field }) => (\n                <FormItem>\n                  <FormLabel>Email</FormLabel>\n                  <FormControl>\n                    <Input\n                      data-testid=\"email-input\"\n                      placeholder=\"user@example.com\"\n                      type=\"email\"\n                      {...field}\n                    />\n                  </FormControl>\n                  <FormMessage />\n                </FormItem>\n              )}\n            />\n\n            <FormField\n              control={form.control}\n              name=\"password\"\n              render={({ field }) => (\n                <FormItem>\n                  <FormLabel>Password</FormLabel>\n                  <FormControl>\n                    <PasswordInput\n                      data-testid=\"password-input\"\n                      placeholder=\"Password\"\n                      {...field}\n                    />\n                  </FormControl>\n                  <FormMessage />\n                </FormItem>\n              )}\n            />\n\n            <FormField\n              control={form.control}\n              name=\"confirm_password\"\n              render={({ field }) => (\n                <FormItem>\n                  <FormLabel>Confirm Password</FormLabel>\n                  <FormControl>\n                    <PasswordInput\n                      data-testid=\"confirm-password-input\"\n                      placeholder=\"Confirm Password\"\n                      {...field}\n                    />\n                  </FormControl>\n                  <FormMessage />\n                </FormItem>\n              )}\n            />\n\n            <LoadingButton\n              type=\"submit\"\n              className=\"w-full\"\n              loading={signUpMutation.isPending}\n            >\n              Sign Up\n            </LoadingButton>\n          </div>\n\n          <div className=\"text-center text-sm\">\n            Already have an account?{\" \"}\n            <RouterLink to=\"/login\" className=\"underline underline-offset-4\">\n              Log in\n            </RouterLink>\n          </div>\n        </form>\n      </Form>\n    </AuthLayout>\n  )\n}\n\nexport default SignUp\n"
  },
  {
    "path": "frontend/src/utils.ts",
    "content": "import { AxiosError } from \"axios\"\nimport type { ApiError } from \"./client\"\n\nfunction extractErrorMessage(err: ApiError): string {\n  if (err instanceof AxiosError) {\n    return err.message\n  }\n\n  const errDetail = (err.body as any)?.detail\n  if (Array.isArray(errDetail) && errDetail.length > 0) {\n    return errDetail[0].msg\n  }\n  return errDetail || \"Something went wrong.\"\n}\n\nexport const handleError = function (\n  this: (msg: string) => void,\n  err: ApiError,\n) {\n  const errorMessage = extractErrorMessage(err)\n  this(errorMessage)\n}\n\nexport const getInitials = (name: string): string => {\n  return name\n    .split(\" \")\n    .slice(0, 2)\n    .map((word) => word[0])\n    .join(\"\")\n    .toUpperCase()\n}\n"
  },
  {
    "path": "frontend/src/vite-env.d.ts",
    "content": "/// <reference types=\"vite/client\" />\n\ninterface ImportMetaEnv {\n  readonly VITE_API_URL: string\n}\n\ninterface ImportMeta {\n  readonly env: ImportMetaEnv\n}\n"
  },
  {
    "path": "frontend/tests/admin.spec.ts",
    "content": "import { expect, test } from \"@playwright/test\"\nimport { firstSuperuser, firstSuperuserPassword } from \"./config.ts\"\nimport { createUser } from \"./utils/privateApi\"\nimport { randomEmail, randomPassword } from \"./utils/random\"\nimport { logInUser } from \"./utils/user\"\n\ntest(\"Admin page is accessible and shows correct title\", async ({ page }) => {\n  await page.goto(\"/admin\")\n  await expect(page.getByRole(\"heading\", { name: \"Users\" })).toBeVisible()\n  await expect(\n    page.getByText(\"Manage user accounts and permissions\"),\n  ).toBeVisible()\n})\n\ntest(\"Add User button is visible\", async ({ page }) => {\n  await page.goto(\"/admin\")\n  await expect(page.getByRole(\"button\", { name: \"Add User\" })).toBeVisible()\n})\n\ntest.describe(\"Admin user management\", () => {\n  test(\"Create a new user successfully\", async ({ page }) => {\n    await page.goto(\"/admin\")\n\n    const email = randomEmail()\n    const password = randomPassword()\n    const fullName = \"Test User Admin\"\n\n    await page.getByRole(\"button\", { name: \"Add User\" }).click()\n\n    await page.getByPlaceholder(\"Email\").fill(email)\n    await page.getByPlaceholder(\"Full name\").fill(fullName)\n    await page.getByPlaceholder(\"Password\").first().fill(password)\n    await page.getByPlaceholder(\"Password\").last().fill(password)\n\n    await page.getByRole(\"button\", { name: \"Save\" }).click()\n\n    await expect(page.getByText(\"User created successfully\")).toBeVisible()\n\n    await expect(page.getByRole(\"dialog\")).not.toBeVisible()\n\n    const userRow = page.getByRole(\"row\").filter({ hasText: email })\n    await expect(userRow).toBeVisible()\n  })\n\n  test(\"Create a superuser\", async ({ page }) => {\n    await page.goto(\"/admin\")\n\n    const email = randomEmail()\n    const password = randomPassword()\n\n    await page.getByRole(\"button\", { name: \"Add User\" }).click()\n\n    await page.getByPlaceholder(\"Email\").fill(email)\n    await page.getByPlaceholder(\"Password\").first().fill(password)\n    await page.getByPlaceholder(\"Password\").last().fill(password)\n    await page.getByLabel(\"Is superuser?\").check()\n    await page.getByLabel(\"Is active?\").check()\n\n    await page.getByRole(\"button\", { name: \"Save\" }).click()\n\n    await expect(page.getByText(\"User created successfully\")).toBeVisible()\n\n    await expect(page.getByRole(\"dialog\")).not.toBeVisible()\n\n    const userRow = page.getByRole(\"row\").filter({ hasText: email })\n    await expect(userRow.getByText(\"Superuser\")).toBeVisible()\n  })\n\n  test(\"Edit a user successfully\", async ({ page }) => {\n    await page.goto(\"/admin\")\n\n    const email = randomEmail()\n    const password = randomPassword()\n    const originalName = \"Original Name\"\n    const updatedName = \"Updated Name\"\n\n    await page.getByRole(\"button\", { name: \"Add User\" }).click()\n    await page.getByPlaceholder(\"Email\").fill(email)\n    await page.getByPlaceholder(\"Full name\").fill(originalName)\n    await page.getByPlaceholder(\"Password\").first().fill(password)\n    await page.getByPlaceholder(\"Password\").last().fill(password)\n    await page.getByRole(\"button\", { name: \"Save\" }).click()\n\n    await expect(page.getByText(\"User created successfully\")).toBeVisible()\n    await expect(page.getByRole(\"dialog\")).not.toBeVisible()\n\n    const userRow = page.getByRole(\"row\").filter({ hasText: email })\n    await userRow.getByRole(\"button\").click()\n\n    await page.getByRole(\"menuitem\", { name: \"Edit User\" }).click()\n\n    await page.getByPlaceholder(\"Full name\").fill(updatedName)\n    await page.getByRole(\"button\", { name: \"Save\" }).click()\n\n    await expect(page.getByText(\"User updated successfully\")).toBeVisible()\n    await expect(page.getByText(updatedName)).toBeVisible()\n  })\n\n  test(\"Delete a user successfully\", async ({ page }) => {\n    await page.goto(\"/admin\")\n\n    const email = randomEmail()\n    const password = randomPassword()\n\n    await page.getByRole(\"button\", { name: \"Add User\" }).click()\n    await page.getByPlaceholder(\"Email\").fill(email)\n    await page.getByPlaceholder(\"Password\").first().fill(password)\n    await page.getByPlaceholder(\"Password\").last().fill(password)\n    await page.getByRole(\"button\", { name: \"Save\" }).click()\n\n    await expect(page.getByText(\"User created successfully\")).toBeVisible()\n\n    await expect(page.getByRole(\"dialog\")).not.toBeVisible()\n\n    const userRow = page.getByRole(\"row\").filter({ hasText: email })\n    await userRow.getByRole(\"button\").click()\n\n    await page.getByRole(\"menuitem\", { name: \"Delete User\" }).click()\n\n    await page.getByRole(\"button\", { name: \"Delete\" }).click()\n\n    await expect(\n      page.getByText(\"The user was deleted successfully\"),\n    ).toBeVisible()\n\n    await expect(\n      page.getByRole(\"row\").filter({ hasText: email }),\n    ).not.toBeVisible()\n  })\n\n  test(\"Cancel user creation\", async ({ page }) => {\n    await page.goto(\"/admin\")\n\n    await page.getByRole(\"button\", { name: \"Add User\" }).click()\n    await page.getByPlaceholder(\"Email\").fill(\"test@example.com\")\n\n    await page.getByRole(\"button\", { name: \"Cancel\" }).click()\n\n    await expect(page.getByRole(\"dialog\")).not.toBeVisible()\n  })\n\n  test(\"Email is required and must be valid\", async ({ page }) => {\n    await page.goto(\"/admin\")\n\n    await page.getByRole(\"button\", { name: \"Add User\" }).click()\n\n    await page.getByPlaceholder(\"Email\").fill(\"invalid-email\")\n    await page.getByPlaceholder(\"Email\").blur()\n\n    await expect(page.getByText(\"Invalid email address\")).toBeVisible()\n  })\n\n  test(\"Password must be at least 8 characters\", async ({ page }) => {\n    await page.goto(\"/admin\")\n\n    await page.getByRole(\"button\", { name: \"Add User\" }).click()\n\n    await page.getByPlaceholder(\"Email\").fill(randomEmail())\n    await page.getByPlaceholder(\"Password\").first().fill(\"short\")\n    await page.getByPlaceholder(\"Password\").last().fill(\"short\")\n    await page.getByRole(\"button\", { name: \"Save\" }).click()\n\n    await expect(\n      page.getByText(\"Password must be at least 8 characters\"),\n    ).toBeVisible()\n  })\n\n  test(\"Passwords must match\", async ({ page }) => {\n    await page.goto(\"/admin\")\n\n    await page.getByRole(\"button\", { name: \"Add User\" }).click()\n\n    await page.getByPlaceholder(\"Email\").fill(randomEmail())\n    await page.getByPlaceholder(\"Password\").first().fill(randomPassword())\n    await page.getByPlaceholder(\"Password\").last().fill(\"different12345\")\n    await page.getByPlaceholder(\"Password\").last().blur()\n\n    await expect(page.getByText(\"The passwords don't match\")).toBeVisible()\n  })\n})\n\ntest.describe(\"Admin page access control\", () => {\n  test.use({ storageState: { cookies: [], origins: [] } })\n\n  test(\"Non-superuser cannot access admin page\", async ({ page }) => {\n    const email = randomEmail()\n    const password = randomPassword()\n\n    await createUser({ email, password })\n    await logInUser(page, email, password)\n\n    await page.goto(\"/admin\")\n\n    await expect(page.getByRole(\"heading\", { name: \"Users\" })).not.toBeVisible()\n    await expect(page).not.toHaveURL(/\\/admin/)\n  })\n\n  test(\"Superuser can access admin page\", async ({ page }) => {\n    await logInUser(page, firstSuperuser, firstSuperuserPassword)\n\n    await page.goto(\"/admin\")\n\n    await expect(page.getByRole(\"heading\", { name: \"Users\" })).toBeVisible()\n  })\n})\n"
  },
  {
    "path": "frontend/tests/auth.setup.ts",
    "content": "import { test as setup } from \"@playwright/test\"\nimport { firstSuperuser, firstSuperuserPassword } from \"./config.ts\"\n\nconst authFile = \"playwright/.auth/user.json\"\n\nsetup(\"authenticate\", async ({ page }) => {\n  await page.goto(\"/login\")\n  await page.getByTestId(\"email-input\").fill(firstSuperuser)\n  await page.getByTestId(\"password-input\").fill(firstSuperuserPassword)\n  await page.getByRole(\"button\", { name: \"Log In\" }).click()\n  await page.waitForURL(\"/\")\n  await page.context().storageState({ path: authFile })\n})\n"
  },
  {
    "path": "frontend/tests/config.ts",
    "content": "import path from \"node:path\"\nimport { fileURLToPath } from \"node:url\"\nimport dotenv from \"dotenv\"\n\nconst __filename = fileURLToPath(import.meta.url)\nconst __dirname = path.dirname(__filename)\n\ndotenv.config({ path: path.join(__dirname, \"../../.env\") })\n\nfunction getEnvVar(name: string): string {\n  const value = process.env[name]\n  if (!value) {\n    throw new Error(`Environment variable ${name} is undefined`)\n  }\n  return value\n}\n\nexport const firstSuperuser = getEnvVar(\"FIRST_SUPERUSER\")\nexport const firstSuperuserPassword = getEnvVar(\"FIRST_SUPERUSER_PASSWORD\")\n"
  },
  {
    "path": "frontend/tests/items.spec.ts",
    "content": "import { expect, test } from \"@playwright/test\"\nimport { createUser } from \"./utils/privateApi\"\nimport {\n  randomEmail,\n  randomItemDescription,\n  randomItemTitle,\n  randomPassword,\n} from \"./utils/random\"\nimport { logInUser } from \"./utils/user\"\n\ntest(\"Items page is accessible and shows correct title\", async ({ page }) => {\n  await page.goto(\"/items\")\n  await expect(page.getByRole(\"heading\", { name: \"Items\" })).toBeVisible()\n  await expect(page.getByText(\"Create and manage your items\")).toBeVisible()\n})\n\ntest(\"Add Item button is visible\", async ({ page }) => {\n  await page.goto(\"/items\")\n  await expect(page.getByRole(\"button\", { name: \"Add Item\" })).toBeVisible()\n})\n\ntest.describe(\"Items management\", () => {\n  test.use({ storageState: { cookies: [], origins: [] } })\n  let email: string\n  const password = randomPassword()\n\n  test.beforeAll(async () => {\n    email = randomEmail()\n    await createUser({ email, password })\n  })\n\n  test.beforeEach(async ({ page }) => {\n    await logInUser(page, email, password)\n    await page.goto(\"/items\")\n  })\n\n  test(\"Create a new item successfully\", async ({ page }) => {\n    const title = randomItemTitle()\n    const description = randomItemDescription()\n\n    await page.getByRole(\"button\", { name: \"Add Item\" }).click()\n    await page.getByLabel(\"Title\").fill(title)\n    await page.getByLabel(\"Description\").fill(description)\n    await page.getByRole(\"button\", { name: \"Save\" }).click()\n\n    await expect(page.getByText(\"Item created successfully\")).toBeVisible()\n    await expect(page.getByText(title)).toBeVisible()\n  })\n\n  test(\"Create item with only required fields\", async ({ page }) => {\n    const title = randomItemTitle()\n\n    await page.getByRole(\"button\", { name: \"Add Item\" }).click()\n    await page.getByLabel(\"Title\").fill(title)\n    await page.getByRole(\"button\", { name: \"Save\" }).click()\n\n    await expect(page.getByText(\"Item created successfully\")).toBeVisible()\n    await expect(page.getByText(title)).toBeVisible()\n  })\n\n  test(\"Cancel item creation\", async ({ page }) => {\n    await page.getByRole(\"button\", { name: \"Add Item\" }).click()\n    await page.getByLabel(\"Title\").fill(\"Test Item\")\n    await page.getByRole(\"button\", { name: \"Cancel\" }).click()\n\n    await expect(page.getByRole(\"dialog\")).not.toBeVisible()\n  })\n\n  test(\"Title is required\", async ({ page }) => {\n    await page.getByRole(\"button\", { name: \"Add Item\" }).click()\n    await page.getByLabel(\"Title\").fill(\"\")\n    await page.getByLabel(\"Title\").blur()\n\n    await expect(page.getByText(\"Title is required\")).toBeVisible()\n  })\n\n  test.describe(\"Edit and Delete\", () => {\n    let itemTitle: string\n\n    test.beforeEach(async ({ page }) => {\n      itemTitle = randomItemTitle()\n\n      await page.getByRole(\"button\", { name: \"Add Item\" }).click()\n      await page.getByLabel(\"Title\").fill(itemTitle)\n      await page.getByRole(\"button\", { name: \"Save\" }).click()\n      await expect(page.getByText(\"Item created successfully\")).toBeVisible()\n      await expect(page.getByRole(\"dialog\")).not.toBeVisible()\n    })\n\n    test(\"Edit an item successfully\", async ({ page }) => {\n      const itemRow = page.getByRole(\"row\").filter({ hasText: itemTitle })\n      await itemRow.getByRole(\"button\").last().click()\n      await page.getByRole(\"menuitem\", { name: \"Edit Item\" }).click()\n\n      const updatedTitle = randomItemTitle()\n      await page.getByLabel(\"Title\").fill(updatedTitle)\n      await page.getByRole(\"button\", { name: \"Save\" }).click()\n\n      await expect(page.getByText(\"Item updated successfully\")).toBeVisible()\n      await expect(page.getByText(updatedTitle)).toBeVisible()\n    })\n\n    test(\"Delete an item successfully\", async ({ page }) => {\n      const itemRow = page.getByRole(\"row\").filter({ hasText: itemTitle })\n      await itemRow.getByRole(\"button\").last().click()\n      await page.getByRole(\"menuitem\", { name: \"Delete Item\" }).click()\n\n      await page.getByRole(\"button\", { name: \"Delete\" }).click()\n\n      await expect(\n        page.getByText(\"The item was deleted successfully\"),\n      ).toBeVisible()\n      await expect(page.getByText(itemTitle)).not.toBeVisible()\n    })\n  })\n})\n\ntest.describe(\"Items empty state\", () => {\n  test.use({ storageState: { cookies: [], origins: [] } })\n\n  test(\"Shows empty state message when no items exist\", async ({ page }) => {\n    const email = randomEmail()\n    const password = randomPassword()\n    await createUser({ email, password })\n    await logInUser(page, email, password)\n\n    await page.goto(\"/items\")\n\n    await expect(page.getByText(\"You don't have any items yet\")).toBeVisible()\n    await expect(page.getByText(\"Add a new item to get started\")).toBeVisible()\n  })\n})\n"
  },
  {
    "path": "frontend/tests/login.spec.ts",
    "content": "import { expect, type Page, test } from \"@playwright/test\"\nimport { firstSuperuser, firstSuperuserPassword } from \"./config.ts\"\nimport { randomPassword } from \"./utils/random.ts\"\n\ntest.use({ storageState: { cookies: [], origins: [] } })\n\nconst fillForm = async (page: Page, email: string, password: string) => {\n  await page.getByTestId(\"email-input\").fill(email)\n  await page.getByTestId(\"password-input\").fill(password)\n}\n\nconst verifyInput = async (page: Page, testId: string) => {\n  const input = page.getByTestId(testId)\n  await expect(input).toBeVisible()\n  await expect(input).toHaveText(\"\")\n  await expect(input).toBeEditable()\n}\n\ntest(\"Inputs are visible, empty and editable\", async ({ page }) => {\n  await page.goto(\"/login\")\n\n  await verifyInput(page, \"email-input\")\n  await verifyInput(page, \"password-input\")\n})\n\ntest(\"Log In button is visible\", async ({ page }) => {\n  await page.goto(\"/login\")\n\n  await expect(page.getByRole(\"button\", { name: \"Log In\" })).toBeVisible()\n})\n\ntest(\"Forgot Password link is visible\", async ({ page }) => {\n  await page.goto(\"/login\")\n\n  await expect(\n    page.getByRole(\"link\", { name: \"Forgot your password?\" }),\n  ).toBeVisible()\n})\n\ntest(\"Log in with valid email and password \", async ({ page }) => {\n  await page.goto(\"/login\")\n\n  await fillForm(page, firstSuperuser, firstSuperuserPassword)\n  await page.getByRole(\"button\", { name: \"Log In\" }).click()\n\n  await page.waitForURL(\"/\")\n\n  await expect(\n    page.getByText(\"Welcome back, nice to see you again!\"),\n  ).toBeVisible()\n})\n\ntest(\"Log in with invalid email\", async ({ page }) => {\n  await page.goto(\"/login\")\n\n  await fillForm(page, \"invalidemail\", firstSuperuserPassword)\n  await page.getByRole(\"button\", { name: \"Log In\" }).click()\n\n  await expect(page.getByText(\"Invalid email address\")).toBeVisible()\n})\n\ntest(\"Log in with invalid password\", async ({ page }) => {\n  const password = randomPassword()\n\n  await page.goto(\"/login\")\n  await fillForm(page, firstSuperuser, password)\n  await page.getByRole(\"button\", { name: \"Log In\" }).click()\n\n  await expect(page.getByText(\"Incorrect email or password\")).toBeVisible()\n})\n\ntest(\"Successful log out\", async ({ page }) => {\n  await page.goto(\"/login\")\n\n  await fillForm(page, firstSuperuser, firstSuperuserPassword)\n  await page.getByRole(\"button\", { name: \"Log In\" }).click()\n\n  await page.waitForURL(\"/\")\n\n  await expect(\n    page.getByText(\"Welcome back, nice to see you again!\"),\n  ).toBeVisible()\n\n  await page.getByTestId(\"user-menu\").click()\n  await page.getByRole(\"menuitem\", { name: \"Log out\" }).click()\n  await page.waitForURL(\"/login\")\n})\n\ntest(\"Logged-out user cannot access protected routes\", async ({ page }) => {\n  await page.goto(\"/login\")\n\n  await fillForm(page, firstSuperuser, firstSuperuserPassword)\n  await page.getByRole(\"button\", { name: \"Log In\" }).click()\n\n  await page.waitForURL(\"/\")\n\n  await expect(\n    page.getByText(\"Welcome back, nice to see you again!\"),\n  ).toBeVisible()\n\n  await page.getByTestId(\"user-menu\").click()\n  await page.getByRole(\"menuitem\", { name: \"Log out\" }).click()\n  await page.waitForURL(\"/login\")\n\n  await page.goto(\"/settings\")\n  await page.waitForURL(\"/login\")\n})\n\ntest(\"Redirects to /login when token is wrong\", async ({ page }) => {\n  await page.goto(\"/settings\")\n  await page.evaluate(() => {\n    localStorage.setItem(\"access_token\", \"invalid_token\")\n  })\n  await page.goto(\"/settings\")\n  await page.waitForURL(\"/login\")\n  await expect(page).toHaveURL(\"/login\")\n})\n"
  },
  {
    "path": "frontend/tests/reset-password.spec.ts",
    "content": "import { expect, test } from \"@playwright/test\"\nimport { findLastEmail } from \"./utils/mailcatcher\"\nimport { randomEmail, randomPassword } from \"./utils/random\"\nimport { logInUser, signUpNewUser } from \"./utils/user\"\n\ntest.use({ storageState: { cookies: [], origins: [] } })\n\ntest(\"Password Recovery title is visible\", async ({ page }) => {\n  await page.goto(\"/recover-password\")\n\n  await expect(\n    page.getByRole(\"heading\", { name: \"Password Recovery\" }),\n  ).toBeVisible()\n})\n\ntest(\"Input is visible, empty and editable\", async ({ page }) => {\n  await page.goto(\"/recover-password\")\n\n  await expect(page.getByTestId(\"email-input\")).toBeVisible()\n  await expect(page.getByTestId(\"email-input\")).toHaveText(\"\")\n  await expect(page.getByTestId(\"email-input\")).toBeEditable()\n})\n\ntest(\"Continue button is visible\", async ({ page }) => {\n  await page.goto(\"/recover-password\")\n\n  await expect(page.getByRole(\"button\", { name: \"Continue\" })).toBeVisible()\n})\n\ntest(\"User can reset password successfully using the link\", async ({\n  page,\n  request,\n}) => {\n  const fullName = \"Test User\"\n  const email = randomEmail()\n  const password = randomPassword()\n  const newPassword = randomPassword()\n\n  // Sign up a new user\n  await signUpNewUser(page, fullName, email, password)\n\n  await page.goto(\"/recover-password\")\n  await page.getByTestId(\"email-input\").fill(email)\n\n  await page.getByRole(\"button\", { name: \"Continue\" }).click()\n\n  const emailData = await findLastEmail({\n    request,\n    filter: (e) => e.recipients.includes(`<${email}>`),\n    timeout: 5000,\n  })\n\n  await page.goto(\n    `${process.env.MAILCATCHER_HOST}/messages/${emailData.id}.html`,\n  )\n\n  const selector = 'a[href*=\"/reset-password?token=\"]'\n\n  let url = await page.getAttribute(selector, \"href\")\n\n  // TODO: update var instead of doing a replace\n  url = url!.replace(\"http://localhost/\", \"http://localhost:5173/\")\n\n  // Set the new password and confirm it\n  await page.goto(url)\n\n  await page.getByTestId(\"new-password-input\").fill(newPassword)\n  await page.getByTestId(\"confirm-password-input\").fill(newPassword)\n  await page.getByRole(\"button\", { name: \"Reset Password\" }).click()\n  await expect(page.getByText(\"Password updated successfully\")).toBeVisible()\n\n  // Check if the user is able to login with the new password\n  await logInUser(page, email, newPassword)\n})\n\ntest(\"Expired or invalid reset link\", async ({ page }) => {\n  const password = randomPassword()\n  const invalidUrl = \"/reset-password?token=invalidtoken\"\n\n  await page.goto(invalidUrl)\n\n  await page.getByTestId(\"new-password-input\").fill(password)\n  await page.getByTestId(\"confirm-password-input\").fill(password)\n  await page.getByRole(\"button\", { name: \"Reset Password\" }).click()\n\n  await expect(page.getByText(\"Invalid token\")).toBeVisible()\n})\n\ntest(\"Weak new password validation\", async ({ page, request }) => {\n  const fullName = \"Test User\"\n  const email = randomEmail()\n  const password = randomPassword()\n  const weakPassword = \"123\"\n\n  // Sign up a new user\n  await signUpNewUser(page, fullName, email, password)\n\n  await page.goto(\"/recover-password\")\n  await page.getByTestId(\"email-input\").fill(email)\n  await page.getByRole(\"button\", { name: \"Continue\" }).click()\n\n  const emailData = await findLastEmail({\n    request,\n    filter: (e) => e.recipients.includes(`<${email}>`),\n    timeout: 5000,\n  })\n\n  await page.goto(\n    `${process.env.MAILCATCHER_HOST}/messages/${emailData.id}.html`,\n  )\n\n  const selector = 'a[href*=\"/reset-password?token=\"]'\n  let url = await page.getAttribute(selector, \"href\")\n  url = url!.replace(\"http://localhost/\", \"http://localhost:5173/\")\n\n  // Set a weak new password\n  await page.goto(url)\n  await page.getByTestId(\"new-password-input\").fill(weakPassword)\n  await page.getByTestId(\"confirm-password-input\").fill(weakPassword)\n  await page.getByRole(\"button\", { name: \"Reset Password\" }).click()\n\n  await expect(\n    page.getByText(\"Password must be at least 8 characters\"),\n  ).toBeVisible()\n})\n"
  },
  {
    "path": "frontend/tests/sign-up.spec.ts",
    "content": "import { expect, type Page, test } from \"@playwright/test\"\n\nimport { randomEmail, randomPassword } from \"./utils/random\"\n\ntest.use({ storageState: { cookies: [], origins: [] } })\n\nconst fillForm = async (\n  page: Page,\n  full_name: string,\n  email: string,\n  password: string,\n  confirm_password: string,\n) => {\n  await page.getByTestId(\"full-name-input\").fill(full_name)\n  await page.getByTestId(\"email-input\").fill(email)\n  await page.getByTestId(\"password-input\").fill(password)\n  await page.getByTestId(\"confirm-password-input\").fill(confirm_password)\n}\n\nconst verifyInput = async (page: Page, testId: string) => {\n  const input = page.getByTestId(testId)\n  await expect(input).toBeVisible()\n  await expect(input).toHaveText(\"\")\n  await expect(input).toBeEditable()\n}\n\ntest(\"Inputs are visible, empty and editable\", async ({ page }) => {\n  await page.goto(\"/signup\")\n\n  await verifyInput(page, \"full-name-input\")\n  await verifyInput(page, \"email-input\")\n  await verifyInput(page, \"password-input\")\n  await verifyInput(page, \"confirm-password-input\")\n})\n\ntest(\"Sign Up button is visible\", async ({ page }) => {\n  await page.goto(\"/signup\")\n\n  await expect(page.getByRole(\"button\", { name: \"Sign Up\" })).toBeVisible()\n})\n\ntest(\"Log In link is visible\", async ({ page }) => {\n  await page.goto(\"/signup\")\n\n  await expect(page.getByRole(\"link\", { name: \"Log In\" })).toBeVisible()\n})\n\ntest(\"Sign up with valid name, email, and password\", async ({ page }) => {\n  const full_name = \"Test User\"\n  const email = randomEmail()\n  const password = randomPassword()\n\n  await page.goto(\"/signup\")\n  await fillForm(page, full_name, email, password, password)\n  await page.getByRole(\"button\", { name: \"Sign Up\" }).click()\n})\n\ntest(\"Sign up with invalid email\", async ({ page }) => {\n  await page.goto(\"/signup\")\n\n  await fillForm(\n    page,\n    \"Playwright Test\",\n    \"invalid-email\",\n    \"changethis\",\n    \"changethis\",\n  )\n  await page.getByRole(\"button\", { name: \"Sign Up\" }).click()\n\n  await expect(page.getByText(\"Invalid email address\")).toBeVisible()\n})\n\ntest(\"Sign up with existing email\", async ({ page }) => {\n  const fullName = \"Test User\"\n  const email = randomEmail()\n  const password = randomPassword()\n\n  await page.goto(\"/signup\")\n\n  await fillForm(page, fullName, email, password, password)\n  await page.getByRole(\"button\", { name: \"Sign Up\" }).click()\n\n  await page.goto(\"/signup\")\n\n  await fillForm(page, fullName, email, password, password)\n  await page.getByRole(\"button\", { name: \"Sign Up\" }).click()\n\n  await page\n    .getByText(\"The user with this email already exists in the system\")\n    .click()\n})\n\ntest(\"Sign up with weak password\", async ({ page }) => {\n  const fullName = \"Test User\"\n  const email = randomEmail()\n  const password = \"weak\"\n\n  await page.goto(\"/signup\")\n\n  await fillForm(page, fullName, email, password, password)\n  await page.getByRole(\"button\", { name: \"Sign Up\" }).click()\n\n  await expect(\n    page.getByText(\"Password must be at least 8 characters\"),\n  ).toBeVisible()\n})\n\ntest(\"Sign up with mismatched passwords\", async ({ page }) => {\n  const fullName = \"Test User\"\n  const email = randomEmail()\n  const password = randomPassword()\n  const password2 = randomPassword()\n\n  await page.goto(\"/signup\")\n\n  await fillForm(page, fullName, email, password, password2)\n  await page.getByRole(\"button\", { name: \"Sign Up\" }).click()\n\n  await expect(page.getByText(\"The passwords don't match\")).toBeVisible()\n})\n\ntest(\"Sign up with missing full name\", async ({ page }) => {\n  const fullName = \"\"\n  const email = randomEmail()\n  const password = randomPassword()\n\n  await page.goto(\"/signup\")\n\n  await fillForm(page, fullName, email, password, password)\n  await page.getByRole(\"button\", { name: \"Sign Up\" }).click()\n\n  await expect(page.getByText(\"Full Name is required\")).toBeVisible()\n})\n\ntest(\"Sign up with missing email\", async ({ page }) => {\n  const fullName = \"Test User\"\n  const email = \"\"\n  const password = randomPassword()\n\n  await page.goto(\"/signup\")\n\n  await fillForm(page, fullName, email, password, password)\n  await page.getByRole(\"button\", { name: \"Sign Up\" }).click()\n\n  await expect(page.getByText(\"Invalid email address\")).toBeVisible()\n})\n\ntest(\"Sign up with missing password\", async ({ page }) => {\n  const fullName = \"\"\n  const email = randomEmail()\n  const password = \"\"\n\n  await page.goto(\"/signup\")\n\n  await fillForm(page, fullName, email, password, password)\n  await page.getByRole(\"button\", { name: \"Sign Up\" }).click()\n\n  await expect(page.getByText(\"Password is required\")).toBeVisible()\n})\n"
  },
  {
    "path": "frontend/tests/user-settings.spec.ts",
    "content": "import { expect, test } from \"@playwright/test\"\nimport { firstSuperuser, firstSuperuserPassword } from \"./config.ts\"\nimport { createUser } from \"./utils/privateApi.ts\"\nimport { randomEmail, randomPassword } from \"./utils/random\"\nimport { logInUser, logOutUser } from \"./utils/user\"\n\nconst tabs = [\"My profile\", \"Password\", \"Danger zone\"]\n\ntest(\"My profile tab is active by default\", async ({ page }) => {\n  await page.goto(\"/settings\")\n  await expect(page.getByRole(\"tab\", { name: \"My profile\" })).toHaveAttribute(\n    \"aria-selected\",\n    \"true\",\n  )\n})\n\ntest(\"All tabs are visible\", async ({ page }) => {\n  await page.goto(\"/settings\")\n  for (const tab of tabs) {\n    await expect(page.getByRole(\"tab\", { name: tab })).toBeVisible()\n  }\n})\n\ntest.describe(\"Edit user profile\", () => {\n  test.use({ storageState: { cookies: [], origins: [] } })\n  let email: string\n  let password: string\n\n  test.beforeAll(async () => {\n    email = randomEmail()\n    password = randomPassword()\n    await createUser({ email, password })\n  })\n\n  test.beforeEach(async ({ page }) => {\n    await logInUser(page, email, password)\n    await page.goto(\"/settings\")\n    await page.getByRole(\"tab\", { name: \"My profile\" }).click()\n  })\n\n  test(\"Edit user name with a valid name\", async ({ page }) => {\n    const updatedName = \"Test User 2\"\n\n    await page.getByRole(\"button\", { name: \"Edit\" }).click()\n    await page.getByLabel(\"Full name\").fill(updatedName)\n    await page.getByRole(\"button\", { name: \"Save\" }).click()\n\n    await expect(page.getByText(\"User updated successfully\")).toBeVisible()\n    await expect(\n      page.locator(\"form\").getByText(updatedName, { exact: true }),\n    ).toBeVisible()\n  })\n\n  test(\"Edit user email with an invalid email shows error\", async ({\n    page,\n  }) => {\n    await page.getByRole(\"button\", { name: \"Edit\" }).click()\n    await page.getByLabel(\"Email\").fill(\"\")\n    await page.locator(\"body\").click()\n\n    await expect(page.getByText(\"Invalid email address\")).toBeVisible()\n  })\n})\n\ntest.describe(\"Edit user email\", () => {\n  test.use({ storageState: { cookies: [], origins: [] } })\n\n  test(\"Edit user email with a valid email\", async ({ page }) => {\n    const email = randomEmail()\n    const password = randomPassword()\n    const updatedEmail = randomEmail()\n\n    await createUser({ email, password })\n    await logInUser(page, email, password)\n    await page.goto(\"/settings\")\n    await page.getByRole(\"tab\", { name: \"My profile\" }).click()\n\n    await page.getByRole(\"button\", { name: \"Edit\" }).click()\n    await page.getByLabel(\"Email\").fill(updatedEmail)\n    await page.getByRole(\"button\", { name: \"Save\" }).click()\n\n    await expect(page.getByText(\"User updated successfully\")).toBeVisible()\n    await expect(\n      page.locator(\"form\").getByText(updatedEmail, { exact: true }),\n    ).toBeVisible()\n  })\n})\n\ntest.describe(\"Cancel edit actions\", () => {\n  test.use({ storageState: { cookies: [], origins: [] } })\n\n  test(\"Cancel edit action restores original name\", async ({ page }) => {\n    const email = randomEmail()\n    const password = randomPassword()\n    const user = await createUser({ email, password })\n\n    await logInUser(page, email, password)\n    await page.goto(\"/settings\")\n    await page.getByRole(\"tab\", { name: \"My profile\" }).click()\n    await page.getByRole(\"button\", { name: \"Edit\" }).click()\n    await page.getByLabel(\"Full name\").fill(\"Test User\")\n    await page.getByRole(\"button\", { name: \"Cancel\" }).first().click()\n\n    await expect(\n      page.locator(\"form\").getByText(user.full_name as string, { exact: true }),\n    ).toBeVisible()\n  })\n\n  test(\"Cancel edit action restores original email\", async ({ page }) => {\n    const email = randomEmail()\n    const password = randomPassword()\n    await createUser({ email, password })\n\n    await logInUser(page, email, password)\n    await page.goto(\"/settings\")\n    await page.getByRole(\"tab\", { name: \"My profile\" }).click()\n    await page.getByRole(\"button\", { name: \"Edit\" }).click()\n    await page.getByLabel(\"Email\").fill(randomEmail())\n    await page.getByRole(\"button\", { name: \"Cancel\" }).first().click()\n\n    await expect(\n      page.locator(\"form\").getByText(email, { exact: true }),\n    ).toBeVisible()\n  })\n})\n\ntest.describe(\"Change password\", () => {\n  test.use({ storageState: { cookies: [], origins: [] } })\n\n  test(\"Update password successfully\", async ({ page }) => {\n    const email = randomEmail()\n    const password = randomPassword()\n    const newPassword = randomPassword()\n\n    await createUser({ email, password })\n    await logInUser(page, email, password)\n\n    await page.goto(\"/settings\")\n    await page.getByRole(\"tab\", { name: \"Password\" }).click()\n    await page.getByTestId(\"current-password-input\").fill(password)\n    await page.getByTestId(\"new-password-input\").fill(newPassword)\n    await page.getByTestId(\"confirm-password-input\").fill(newPassword)\n    await page.getByRole(\"button\", { name: \"Update Password\" }).click()\n\n    await expect(page.getByText(\"Password updated successfully\")).toBeVisible()\n\n    await logOutUser(page)\n    await logInUser(page, email, newPassword)\n  })\n})\n\ntest.describe(\"Change password validation\", () => {\n  test.use({ storageState: { cookies: [], origins: [] } })\n  let email: string\n  let password: string\n\n  test.beforeAll(async () => {\n    email = randomEmail()\n    password = randomPassword()\n    await createUser({ email, password })\n  })\n\n  test.beforeEach(async ({ page }) => {\n    await logInUser(page, email, password)\n    await page.goto(\"/settings\")\n    await page.getByRole(\"tab\", { name: \"Password\" }).click()\n  })\n\n  test(\"Update password with weak passwords\", async ({ page }) => {\n    const weakPassword = \"weak\"\n\n    await page.getByTestId(\"current-password-input\").fill(password)\n    await page.getByTestId(\"new-password-input\").fill(weakPassword)\n    await page.getByTestId(\"confirm-password-input\").fill(weakPassword)\n    await page.getByRole(\"button\", { name: \"Update Password\" }).click()\n\n    await expect(\n      page.getByText(\"Password must be at least 8 characters\"),\n    ).toBeVisible()\n  })\n\n  test(\"New password and confirmation password do not match\", async ({\n    page,\n  }) => {\n    await page.getByTestId(\"current-password-input\").fill(password)\n    await page.getByTestId(\"new-password-input\").fill(randomPassword())\n    await page.getByTestId(\"confirm-password-input\").fill(randomPassword())\n    await page.getByRole(\"button\", { name: \"Update Password\" }).click()\n\n    await expect(page.getByText(\"The passwords don't match\")).toBeVisible()\n  })\n\n  test(\"Current password and new password are the same\", async ({ page }) => {\n    await page.getByTestId(\"current-password-input\").fill(password)\n    await page.getByTestId(\"new-password-input\").fill(password)\n    await page.getByTestId(\"confirm-password-input\").fill(password)\n    await page.getByRole(\"button\", { name: \"Update Password\" }).click()\n\n    await expect(\n      page.getByText(\"New password cannot be the same as the current one\"),\n    ).toBeVisible()\n  })\n})\n\ntest(\"Appearance button is visible in sidebar\", async ({ page }) => {\n  await page.goto(\"/settings\")\n  await expect(page.getByTestId(\"theme-button\")).toBeVisible()\n})\n\ntest(\"User can switch between theme modes\", async ({ page }) => {\n  await page.goto(\"/settings\")\n\n  await page.getByTestId(\"theme-button\").click()\n  await page.getByTestId(\"dark-mode\").click()\n  await expect(page.locator(\"html\")).toHaveClass(/dark/)\n\n  await expect(page.getByTestId(\"dark-mode\")).not.toBeVisible()\n\n  await page.getByTestId(\"theme-button\").click()\n  await page.getByTestId(\"light-mode\").click()\n  await expect(page.locator(\"html\")).toHaveClass(/light/)\n})\n\ntest(\"Selected mode is preserved across sessions\", async ({ page }) => {\n  await page.goto(\"/settings\")\n\n  await page.getByTestId(\"theme-button\").click()\n  if (\n    await page.evaluate(() =>\n      document.documentElement.classList.contains(\"dark\"),\n    )\n  ) {\n    await page.getByTestId(\"light-mode\").click()\n    await page.getByTestId(\"theme-button\").click()\n  }\n\n  const isLightMode = await page.evaluate(() =>\n    document.documentElement.classList.contains(\"light\"),\n  )\n  expect(isLightMode).toBe(true)\n\n  await page.getByTestId(\"theme-button\").click()\n  await page.getByTestId(\"dark-mode\").click()\n  let isDarkMode = await page.evaluate(() =>\n    document.documentElement.classList.contains(\"dark\"),\n  )\n  expect(isDarkMode).toBe(true)\n\n  await logOutUser(page)\n  await logInUser(page, firstSuperuser, firstSuperuserPassword)\n\n  isDarkMode = await page.evaluate(() =>\n    document.documentElement.classList.contains(\"dark\"),\n  )\n  expect(isDarkMode).toBe(true)\n})\n"
  },
  {
    "path": "frontend/tests/utils/mailcatcher.ts",
    "content": "import type { APIRequestContext } from \"@playwright/test\"\n\ntype Email = {\n  id: number\n  recipients: string[]\n  subject: string\n}\n\nasync function findEmail({\n  request,\n  filter,\n}: {\n  request: APIRequestContext\n  filter?: (email: Email) => boolean\n}) {\n  const response = await request.get(`${process.env.MAILCATCHER_HOST}/messages`)\n\n  let emails = await response.json()\n\n  if (filter) {\n    emails = emails.filter(filter)\n  }\n\n  const email = emails[emails.length - 1]\n\n  if (email) {\n    return email as Email\n  }\n\n  return null\n}\n\nexport function findLastEmail({\n  request,\n  filter,\n  timeout = 5000,\n}: {\n  request: APIRequestContext\n  filter?: (email: Email) => boolean\n  timeout?: number\n}) {\n  const timeoutPromise = new Promise<never>((_, reject) =>\n    setTimeout(\n      () => reject(new Error(\"Timeout while trying to get latest email\")),\n      timeout,\n    ),\n  )\n\n  const checkEmails = async () => {\n    while (true) {\n      const emailData = await findEmail({ request, filter })\n\n      if (emailData) {\n        return emailData\n      }\n      // Wait for 100ms before checking again\n      await new Promise((resolve) => setTimeout(resolve, 100))\n    }\n  }\n\n  return Promise.race([timeoutPromise, checkEmails()])\n}\n"
  },
  {
    "path": "frontend/tests/utils/privateApi.ts",
    "content": "// Note: the `PrivateService` is only available when generating the client\n// for local environments\nimport { OpenAPI, PrivateService } from \"../../src/client\"\n\nOpenAPI.BASE = `${process.env.VITE_API_URL}`\n\nexport const createUser = async ({\n  email,\n  password,\n}: {\n  email: string\n  password: string\n}) => {\n  return await PrivateService.createUser({\n    requestBody: {\n      email,\n      password,\n      is_verified: true,\n      full_name: \"Test User\",\n    },\n  })\n}\n"
  },
  {
    "path": "frontend/tests/utils/random.ts",
    "content": "export const randomEmail = () =>\n  `test_${Math.random().toString(36).substring(7)}@example.com`\n\nexport const randomTeamName = () =>\n  `Team ${Math.random().toString(36).substring(7)}`\n\nexport const randomPassword = () => `${Math.random().toString(36).substring(2)}`\n\nexport const slugify = (text: string) =>\n  text\n    .toLowerCase()\n    .replace(/\\s+/g, \"-\")\n    .replace(/[^\\w-]+/g, \"\")\n\nexport const randomItemTitle = () =>\n  `Item ${Math.random().toString(36).substring(7)}`\n\nexport const randomItemDescription = () =>\n  `Description ${Math.random().toString(36).substring(7)}`\n"
  },
  {
    "path": "frontend/tests/utils/user.ts",
    "content": "import { expect, type Page } from \"@playwright/test\"\n\nexport async function signUpNewUser(\n  page: Page,\n  name: string,\n  email: string,\n  password: string,\n) {\n  await page.goto(\"/signup\")\n\n  await page.getByTestId(\"full-name-input\").fill(name)\n  await page.getByTestId(\"email-input\").fill(email)\n  await page.getByTestId(\"password-input\").fill(password)\n  await page.getByTestId(\"confirm-password-input\").fill(password)\n  await page.getByRole(\"button\", { name: \"Sign Up\" }).click()\n  await page.goto(\"/login\")\n}\n\nexport async function logInUser(page: Page, email: string, password: string) {\n  await page.goto(\"/login\")\n\n  await page.getByTestId(\"email-input\").fill(email)\n  await page.getByTestId(\"password-input\").fill(password)\n  await page.getByRole(\"button\", { name: \"Log In\" }).click()\n  await page.waitForURL(\"/\")\n  await expect(\n    page.getByText(\"Welcome back, nice to see you again!\"),\n  ).toBeVisible()\n}\n\nexport async function logOutUser(page: Page) {\n  await page.getByTestId(\"user-menu\").click()\n  await page.getByRole(\"menuitem\", { name: \"Log out\" }).click()\n  await page.goto(\"/login\")\n}\n"
  },
  {
    "path": "frontend/tsconfig.build.json",
    "content": "{\n  \"extends\": \"./tsconfig.json\",\n  \"exclude\": [\"tests/**/*.ts\"]\n}\n"
  },
  {
    "path": "frontend/tsconfig.json",
    "content": "{\n  \"compilerOptions\": {\n    \"target\": \"ES2020\",\n    \"useDefineForClassFields\": true,\n    \"lib\": [\"ES2020\", \"DOM\", \"DOM.Iterable\"],\n    \"module\": \"ESNext\",\n    \"skipLibCheck\": true,\n    /* Bundler mode */\n    \"moduleResolution\": \"bundler\",\n    \"allowImportingTsExtensions\": true,\n    \"resolveJsonModule\": true,\n    \"isolatedModules\": true,\n    \"noEmit\": true,\n    \"jsx\": \"react-jsx\",\n    /* Linting */\n    \"strict\": true,\n    \"noUnusedLocals\": true,\n    \"noUnusedParameters\": true,\n    \"noFallthroughCasesInSwitch\": true,\n    \"baseUrl\": \".\",\n    \"paths\": {\n      \"@/*\": [\"./src/*\"]\n    }\n  },\n  \"include\": [\"src\", \"tests\", \"playwright.config.ts\"],\n  \"references\": [\n    {\n      \"path\": \"./tsconfig.node.json\"\n    }\n  ]\n}\n"
  },
  {
    "path": "frontend/tsconfig.node.json",
    "content": "{\n  \"compilerOptions\": {\n    \"composite\": true,\n    \"skipLibCheck\": true,\n    \"module\": \"ESNext\",\n    \"moduleResolution\": \"bundler\",\n    \"allowSyntheticDefaultImports\": true\n  },\n  \"include\": [\"vite.config.ts\"]\n}\n"
  },
  {
    "path": "frontend/vite.config.ts",
    "content": "import path from \"node:path\"\nimport tailwindcss from \"@tailwindcss/vite\"\nimport { tanstackRouter } from \"@tanstack/router-plugin/vite\"\nimport react from \"@vitejs/plugin-react-swc\"\nimport { defineConfig } from \"vite\"\n\n// https://vitejs.dev/config/\nexport default defineConfig({\n  resolve: {\n    alias: {\n      \"@\": path.resolve(__dirname, \"./src\"),\n    },\n  },\n  plugins: [\n    tanstackRouter({\n      target: \"react\",\n      autoCodeSplitting: true,\n    }),\n    react(),\n    tailwindcss(),\n  ],\n})\n"
  },
  {
    "path": "hooks/post_gen_project.py",
    "content": "from pathlib import Path\n\n\npath: Path\nfor path in Path(\".\").glob(\"**/*.sh\"):\n    data = path.read_bytes()\n    lf_data = data.replace(b\"\\r\\n\", b\"\\n\")\n    path.write_bytes(lf_data)\n"
  },
  {
    "path": "package.json",
    "content": "{\n  \"name\": \"fastapi-full-stack-template\",\n  \"private\": true,\n  \"workspaces\": [\n    \"frontend\"\n  ],\n  \"scripts\": {\n    \"dev\": \"bun run --filter frontend dev\",\n    \"lint\": \"bun run --filter frontend lint\",\n    \"test\": \"bun run --filter frontend test\",\n    \"test:ui\": \"bun run --filter frontend test:ui\"\n  }\n}\n"
  },
  {
    "path": "pyproject.toml",
    "content": "[tool.uv.workspace]\nmembers = [\"backend\"]\n"
  },
  {
    "path": "release-notes.md",
    "content": "# Release Notes\n\n## Latest Changes\n\n### Refactors\n\n* 🔧 Add FastAPI VS Code extension to recommended extensions. PR [#2206](https://github.com/fastapi/full-stack-fastapi-template/pull/2206) by [@tiangolo](https://github.com/tiangolo).\n* ♻️ Update meta titles. PR [#2179](https://github.com/fastapi/full-stack-fastapi-template/pull/2179) by [@alejsdev](https://github.com/alejsdev).\n\n### Upgrades\n\n* ⬆️ Upgrade Sentry and FastAPI. PR [#2181](https://github.com/fastapi/full-stack-fastapi-template/pull/2181) by [@patrick91](https://github.com/patrick91).\n\n### Docs\n\n* 📝 Add `CONTRIBUTING.md`. PR [#2159](https://github.com/fastapi/full-stack-fastapi-template/pull/2159) by [@alejsdev](https://github.com/alejsdev).\n\n### Internal\n\n* ⬆ Bump dorny/paths-filter from 3 to 4. PR [#2230](https://github.com/fastapi/full-stack-fastapi-template/pull/2230) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump pyjwt from 2.10.1 to 2.12.0. PR [#2231](https://github.com/fastapi/full-stack-fastapi-template/pull/2231) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump @types/node from 25.3.2 to 25.5.0. PR [#2233](https://github.com/fastapi/full-stack-fastapi-template/pull/2233) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump @tanstack/router-devtools from 1.159.10 to 1.166.7. PR [#2234](https://github.com/fastapi/full-stack-fastapi-template/pull/2234) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump tailwindcss from 4.2.0 to 4.2.1. PR [#2226](https://github.com/fastapi/full-stack-fastapi-template/pull/2226) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump actions/download-artifact from 7 to 8. PR [#2208](https://github.com/fastapi/full-stack-fastapi-template/pull/2208) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump actions/upload-artifact from 6 to 7. PR [#2207](https://github.com/fastapi/full-stack-fastapi-template/pull/2207) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump @tanstack/react-router from 1.157.3 to 1.163.3. PR [#2215](https://github.com/fastapi/full-stack-fastapi-template/pull/2215) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump @tanstack/react-router-devtools from 1.159.10 to 1.163.3. PR [#2212](https://github.com/fastapi/full-stack-fastapi-template/pull/2212) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump @tanstack/react-query from 5.90.20 to 5.90.21. PR [#2213](https://github.com/fastapi/full-stack-fastapi-template/pull/2213) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump @types/node from 25.1.0 to 25.3.2. PR [#2214](https://github.com/fastapi/full-stack-fastapi-template/pull/2214) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump tailwindcss from 4.1.18 to 4.2.0. PR [#2198](https://github.com/fastapi/full-stack-fastapi-template/pull/2198) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump axios from 1.13.4 to 1.13.5. PR [#2199](https://github.com/fastapi/full-stack-fastapi-template/pull/2199) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump @vitejs/plugin-react-swc from 4.2.2 to 4.2.3. PR [#2200](https://github.com/fastapi/full-stack-fastapi-template/pull/2200) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump dotenv from 17.2.3 to 17.3.1. PR [#2185](https://github.com/fastapi/full-stack-fastapi-template/pull/2185) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump @tanstack/router-devtools from 1.157.17 to 1.159.10. PR [#2186](https://github.com/fastapi/full-stack-fastapi-template/pull/2186) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump @tanstack/react-router-devtools from 1.157.17 to 1.159.10. PR [#2188](https://github.com/fastapi/full-stack-fastapi-template/pull/2188) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆️ Bump biome schema version from 2.3.12 to 2.3.14. PR [#2178](https://github.com/fastapi/full-stack-fastapi-template/pull/2178) by [@alejsdev](https://github.com/alejsdev).\n* ⬆ Bump @biomejs/biome from 2.3.12 to 2.3.14. PR [#2177](https://github.com/fastapi/full-stack-fastapi-template/pull/2177) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump lucide-react from 0.562.0 to 0.563.0. PR [#2176](https://github.com/fastapi/full-stack-fastapi-template/pull/2176) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump @tanstack/react-query from 5.90.19 to 5.90.20. PR [#2174](https://github.com/fastapi/full-stack-fastapi-template/pull/2174) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump playwright from v1.58.0-noble to v1.58.2-noble in /frontend. PR [#2175](https://github.com/fastapi/full-stack-fastapi-template/pull/2175) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* 👷 Run mypy by pre-commit. PR [#2169](https://github.com/fastapi/full-stack-fastapi-template/pull/2169) by [@YuriiMotov](https://github.com/YuriiMotov).\n* ⬆ Bump @tanstack/router-devtools from 1.153.2 to 1.157.17. PR [#2166](https://github.com/fastapi/full-stack-fastapi-template/pull/2166) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump @types/node from 25.0.10 to 25.1.0. PR [#2168](https://github.com/fastapi/full-stack-fastapi-template/pull/2168) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump axios from 1.13.2 to 1.13.4. PR [#2164](https://github.com/fastapi/full-stack-fastapi-template/pull/2164) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆️ Bump biome schema version to 2.3.12 in biome.json. PR [#2154](https://github.com/fastapi/full-stack-fastapi-template/pull/2154) by [@alejsdev](https://github.com/alejsdev).\n* ⬆ Bump @biomejs/biome from 2.3.11 to 2.3.12. PR [#2153](https://github.com/fastapi/full-stack-fastapi-template/pull/2153) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump playwright from v1.57.0-noble to v1.58.0-noble in /frontend. PR [#2150](https://github.com/fastapi/full-stack-fastapi-template/pull/2150) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump @tanstack/react-router from 1.153.2 to 1.156.0. PR [#2152](https://github.com/fastapi/full-stack-fastapi-template/pull/2152) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump zod from 4.3.5 to 4.3.6. PR [#2151](https://github.com/fastapi/full-stack-fastapi-template/pull/2151) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump @types/node from 25.0.9 to 25.0.10. PR [#2149](https://github.com/fastapi/full-stack-fastapi-template/pull/2149) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump @tanstack/react-router-devtools from 1.153.2 to 1.156.0. PR [#2147](https://github.com/fastapi/full-stack-fastapi-template/pull/2147) by [@dependabot[bot]](https://github.com/apps/dependabot).\n\n## 0.10.0\n\n### Features\n\n* ✅ Add items and admin tests, and refactor existing ones. PR [#2146](https://github.com/fastapi/full-stack-fastapi-template/pull/2146) by [@alejsdev](https://github.com/alejsdev).\n* ✨ Add created_at field to User and Item models and update endpoints. PR [#2144](https://github.com/fastapi/full-stack-fastapi-template/pull/2144) by [@alejsdev](https://github.com/alejsdev).\n* 🔧 Migrate from npm to Bun. PR [#2097](https://github.com/fastapi/full-stack-fastapi-template/pull/2097) by [@alejsdev](https://github.com/alejsdev).\n* 🔧 Set up node monorepo. PR [#2095](https://github.com/fastapi/full-stack-fastapi-template/pull/2095) by [@alejsdev](https://github.com/alejsdev).\n* 🧑‍💻 Implement uv workspaces. PR [#2090](https://github.com/fastapi/full-stack-fastapi-template/pull/2090) by [@alejsdev](https://github.com/alejsdev).\n* 🔧 Add recommended VS Code extensions. PR [#1386](https://github.com/fastapi/full-stack-fastapi-template/pull/1386) by [@tobiase](https://github.com/tobiase).\n* ✨ Use pwdlib with Argon2 by default, adding logic (and tests) to autoupdate old passwords using Bcrypt. PR [#2104](https://github.com/fastapi/full-stack-fastapi-template/pull/2104) by [@tiangolo](https://github.com/tiangolo).\n* 🔨 Generate frontend SDK on pre-commit, remove custom workflow. PR [#2111](https://github.com/fastapi/full-stack-fastapi-template/pull/2111) by [@tiangolo](https://github.com/tiangolo).\n\n### Fixes\n\n* 🐛 Add user authentication check in admin route to restrict access for non-superusers. PR [#2145](https://github.com/fastapi/full-stack-fastapi-template/pull/2145) by [@alejsdev](https://github.com/alejsdev).\n* 🐛 Handle non-existing user IDs in `read_user_by_id`. PR [#1396](https://github.com/fastapi/full-stack-fastapi-template/pull/1396) by [@saltie2193](https://github.com/saltie2193).\n\n### Refactors\n\n* 🔥 Remove debugpy from recommended extensions, it's included by the Python extension. PR [#2143](https://github.com/fastapi/full-stack-fastapi-template/pull/2143) by [@tiangolo](https://github.com/tiangolo).\n* 🔧 Update the frontend build context for prod with the new top level setup. PR [#2108](https://github.com/fastapi/full-stack-fastapi-template/pull/2108) by [@tiangolo](https://github.com/tiangolo).\n* 🚚 Rename Docker Compose files to new names, `compose.yml`. PR [#2106](https://github.com/fastapi/full-stack-fastapi-template/pull/2106) by [@tiangolo](https://github.com/tiangolo).\n* 🔒️ Ensure authentication takes constant time, to avoid enumeration attacks. PR [#2105](https://github.com/fastapi/full-stack-fastapi-template/pull/2105) by [@tiangolo](https://github.com/tiangolo).\n* ✅ Fix incorrect mocking in unit tests (issue #1780). PR [#1781](https://github.com/fastapi/full-stack-fastapi-template/pull/1781) by [@vicaya](https://github.com/vicaya).\n* 🐛Update `items.py` to return status code `403` in case of insufficient permissions. PR [#1543](https://github.com/fastapi/full-stack-fastapi-template/pull/1543) by [@jpizquierdo](https://github.com/jpizquierdo).\n* ✅ Use proper `is_active` field in `test_user.py`. PR [#1479](https://github.com/fastapi/full-stack-fastapi-template/pull/1479) by [@nauanbek](https://github.com/nauanbek).\n* ♻️ Simplify reset password logic by removing duplicate code. PR [#1440](https://github.com/fastapi/full-stack-fastapi-template/pull/1440) by [@youneshenniwrites](https://github.com/youneshenniwrites).\n\n### Upgrades\n\n* ⬆ Bump postgres from 17 to 18. PR [#1910](https://github.com/fastapi/full-stack-fastapi-template/pull/1910) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump traefik from 3.0 to 3.6. PR [#1973](https://github.com/fastapi/full-stack-fastapi-template/pull/1973) by [@dependabot[bot]](https://github.com/apps/dependabot).\n\n### Docs\n\n* 📝 Update deployment docs. PR [#2109](https://github.com/fastapi/full-stack-fastapi-template/pull/2109) by [@tiangolo](https://github.com/tiangolo).\n\n### Internal\n\n* 🎨 Format Python scripts tests. PR [#2112](https://github.com/fastapi/full-stack-fastapi-template/pull/2112) by [@tiangolo](https://github.com/tiangolo).\n* 🔨 Update generate-client.sh and docs. PR [#2110](https://github.com/fastapi/full-stack-fastapi-template/pull/2110) by [@tiangolo](https://github.com/tiangolo).\n* 🔥 Remove old unused scripts. PR [#2107](https://github.com/fastapi/full-stack-fastapi-template/pull/2107) by [@tiangolo](https://github.com/tiangolo).\n* 👷 Add `maybe-ai` for issue manager. PR [#2103](https://github.com/fastapi/full-stack-fastapi-template/pull/2103) by [@tiangolo](https://github.com/tiangolo).\n* ⬆️ Bump uv to 0.9.26 in Dockerfile. PR [#2102](https://github.com/fastapi/full-stack-fastapi-template/pull/2102) by [@alejsdev](https://github.com/alejsdev).\n* ⬆ Bump lucide-react from 0.556.0 to 0.562.0. PR [#2101](https://github.com/fastapi/full-stack-fastapi-template/pull/2101) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* 🔧 Update dependabot configuration for package ecosystems. PR [#2100](https://github.com/fastapi/full-stack-fastapi-template/pull/2100) by [@alejsdev](https://github.com/alejsdev).\n* 🔧 Update Biome schema version to 2.3.11. PR [#2099](https://github.com/fastapi/full-stack-fastapi-template/pull/2099) by [@alejsdev](https://github.com/alejsdev).\n* 🔧 Add tests scripts in `package.json`. PR [#2098](https://github.com/fastapi/full-stack-fastapi-template/pull/2098) by [@alejsdev](https://github.com/alejsdev).\n* 🎨 Apply pre-commit fixes. PR [#2055](https://github.com/fastapi/full-stack-fastapi-template/pull/2055) by [@GniLudio](https://github.com/GniLudio).\n* 👷 Update pre-commit workflow. PR [#2096](https://github.com/fastapi/full-stack-fastapi-template/pull/2096) by [@alejsdev](https://github.com/alejsdev).\n* 🔧 Update biome.json schema version. PR [#2092](https://github.com/fastapi/full-stack-fastapi-template/pull/2092) by [@alejsdev](https://github.com/alejsdev).\n* Revert \"🔧 Update pre-commit-config.yaml ruff format to use --check\". PR [#2091](https://github.com/fastapi/full-stack-fastapi-template/pull/2091) by [@alejsdev](https://github.com/alejsdev).\n* 🔧 Update pre-commit-config.yaml ruff format to use --check. PR [#2077](https://github.com/fastapi/full-stack-fastapi-template/pull/2077) by [@ryansydnor](https://github.com/ryansydnor).\n* ⬆ Bump actions/checkout from 5 to 6. PR [#2074](https://github.com/fastapi/full-stack-fastapi-template/pull/2074) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* 👷 Add pre-commit workflow. PR [#2056](https://github.com/fastapi/full-stack-fastapi-template/pull/2056) by [@YuriiMotov](https://github.com/YuriiMotov).\n* ⬆ Bump @tanstack/router-devtools from 1.140.0 to 1.142.8 in /frontend. PR [#2060](https://github.com/fastapi/full-stack-fastapi-template/pull/2060) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump @tanstack/react-router from 1.141.2 to 1.142.8 in /frontend. PR [#2062](https://github.com/fastapi/full-stack-fastapi-template/pull/2062) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump @biomejs/biome from 2.3.8 to 2.3.10 in /frontend. PR [#2061](https://github.com/fastapi/full-stack-fastapi-template/pull/2061) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump @tanstack/react-router-devtools from 1.139.12 to 1.142.8 in /frontend. PR [#2063](https://github.com/fastapi/full-stack-fastapi-template/pull/2063) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump zod from 4.1.13 to 4.2.1 in /frontend. PR [#2064](https://github.com/fastapi/full-stack-fastapi-template/pull/2064) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* 👷 Configure coverage, error on main tests, don't wait for Smokeshow. PR [#2054](https://github.com/fastapi/full-stack-fastapi-template/pull/2054) by [@YuriiMotov](https://github.com/YuriiMotov).\n* 👷 Run Smokeshow always, even on test failures. PR [#2053](https://github.com/fastapi/full-stack-fastapi-template/pull/2053) by [@YuriiMotov](https://github.com/YuriiMotov).\n* ⬆ Bump @tanstack/react-router from 1.140.0 to 1.141.2 in /frontend. PR [#2045](https://github.com/fastapi/full-stack-fastapi-template/pull/2045) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump actions/download-artifact from 6 to 7. PR [#2051](https://github.com/fastapi/full-stack-fastapi-template/pull/2051) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump actions/upload-artifact from 5 to 6. PR [#2050](https://github.com/fastapi/full-stack-fastapi-template/pull/2050) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump @types/node from 24.10.1 to 25.0.2 in /frontend. PR [#2048](https://github.com/fastapi/full-stack-fastapi-template/pull/2048) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump @tailwindcss/vite from 4.1.17 to 4.1.18 in /frontend. PR [#2049](https://github.com/fastapi/full-stack-fastapi-template/pull/2049) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump vite from 7.2.7 to 7.3.0 in /frontend. PR [#2047](https://github.com/fastapi/full-stack-fastapi-template/pull/2047) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump react-dom from 19.2.1 to 19.2.3 in /frontend. PR [#2046](https://github.com/fastapi/full-stack-fastapi-template/pull/2046) by [@dependabot[bot]](https://github.com/apps/dependabot).\n\n## 0.9.0\n\n### Features\n\n* ✨ Add meta title support to all pages. PR [#2039](https://github.com/fastapi/full-stack-fastapi-template/pull/2039) by [@alejsdev](https://github.com/alejsdev).\n* 🛂 Migrate frontend to Shadcn. PR [#2010](https://github.com/fastapi/full-stack-fastapi-template/pull/2010) by [@alejsdev](https://github.com/alejsdev).\n\n### Fixes\n\n* 🐛 Fix `EMAILS_FROM_NAME` type to be `str` instead of `EmailStr`. PR [#1940](https://github.com/fastapi/full-stack-fastapi-template/pull/1940) by [@martin0258](https://github.com/martin0258).\n* 🐛 Fix `parse_cors` function to be consistent for both empty string and empty list. PR [#1672](https://github.com/fastapi/full-stack-fastapi-template/pull/1672) by [@rolkotaki](https://github.com/rolkotaki).\n* 🐛 Close sidebar drawer on user selection. PR [#1515](https://github.com/fastapi/full-stack-fastapi-template/pull/1515) by [@dtellz](https://github.com/dtellz).\n* 🐛 Fix required password validation when editing user fields. PR [#1508](https://github.com/fastapi/full-stack-fastapi-template/pull/1508) by [@jpizquierdo](https://github.com/jpizquierdo).\n\n### Refactors\n\n* ♻️ Update password max length. PR [#1447](https://github.com/fastapi/full-stack-fastapi-template/pull/1447) by [@michaelAlvarino](https://github.com/michaelAlvarino).\n* 🚚 Move backend tests outside the `app` directory. PR [#1862](https://github.com/fastapi/full-stack-fastapi-template/pull/1862) by [@YuriiMotov](https://github.com/YuriiMotov).\n* ✨ Add ImportMetaEnv and ImportMeta interfaces for Vite environment variables. PR [#1860](https://github.com/fastapi/full-stack-fastapi-template/pull/1860) by [@alejsdev](https://github.com/alejsdev).\n* 🔧 Update `tsconfig.json` and fix errors. PR [#1859](https://github.com/fastapi/full-stack-fastapi-template/pull/1859) by [@alejsdev](https://github.com/alejsdev).\n* ♻️ Remove disabled attribute from Save button in ChangePassword component. PR [#1844](https://github.com/fastapi/full-stack-fastapi-template/pull/1844) by [@alejsdev](https://github.com/alejsdev).\n* 👷🏻‍♀️  Update CI for client generation. PR [#1573](https://github.com/fastapi/full-stack-fastapi-template/pull/1573) by [@alejsdev](https://github.com/alejsdev).\n* ♻️ Remove redundant field in inherited class. PR [#1520](https://github.com/fastapi/full-stack-fastapi-template/pull/1520) by [@tzway](https://github.com/tzway).\n* 🎨 Add minor UI tweaks in Skeletons and other components. PR [#1507](https://github.com/fastapi/full-stack-fastapi-template/pull/1507) by [@alejsdev](https://github.com/alejsdev).\n* 🎨 Add minor UI tweaks. PR [#1506](https://github.com/fastapi/full-stack-fastapi-template/pull/1506) by [@alejsdev](https://github.com/alejsdev).\n\n### Upgrades\n\n* ⬆ Bump @types/react from 19.1.12 to 19.1.13 in /frontend. PR [#1888](https://github.com/fastapi/full-stack-fastapi-template/pull/1888) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump @tanstack/router-plugin from 1.131.41 to 1.131.43 in /frontend. PR [#1887](https://github.com/fastapi/full-stack-fastapi-template/pull/1887) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump pydantic from 2.11.7 to 2.11.9 in /backend. PR [#1891](https://github.com/fastapi/full-stack-fastapi-template/pull/1891) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump @chakra-ui/react from 3.26.0 to 3.27.0 in /frontend. PR [#1890](https://github.com/fastapi/full-stack-fastapi-template/pull/1890) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump axios from 1.12.0 to 1.12.2 in /frontend. PR [#1889](https://github.com/fastapi/full-stack-fastapi-template/pull/1889) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump @types/node from 24.3.1 to 24.4.0 in /frontend. PR [#1886](https://github.com/fastapi/full-stack-fastapi-template/pull/1886) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump @tanstack/router-devtools from 1.131.41 to 1.131.42 in /frontend. PR [#1881](https://github.com/fastapi/full-stack-fastapi-template/pull/1881) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump @tanstack/router-plugin from 1.131.39 to 1.131.41 in /frontend. PR [#1879](https://github.com/fastapi/full-stack-fastapi-template/pull/1879) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump @tanstack/react-query-devtools from 5.87.3 to 5.87.4 in /frontend. PR [#1876](https://github.com/fastapi/full-stack-fastapi-template/pull/1876) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump axios from 1.11.0 to 1.12.0 in /frontend. PR [#1878](https://github.com/fastapi/full-stack-fastapi-template/pull/1878) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump @tanstack/router-devtools from 1.131.40 to 1.131.41 in /frontend. PR [#1877](https://github.com/fastapi/full-stack-fastapi-template/pull/1877) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump @tanstack/react-router from 1.131.40 to 1.131.41 in /frontend. PR [#1875](https://github.com/fastapi/full-stack-fastapi-template/pull/1875) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump @tanstack/router-devtools from 1.131.36 to 1.131.37 in /frontend. PR [#1871](https://github.com/fastapi/full-stack-fastapi-template/pull/1871) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump @tanstack/router-plugin from 1.131.36 to 1.131.37 in /frontend. PR [#1870](https://github.com/fastapi/full-stack-fastapi-template/pull/1870) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump @tanstack/react-query from 5.87.1 to 5.87.4 in /frontend. PR [#1868](https://github.com/fastapi/full-stack-fastapi-template/pull/1868) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump @biomejs/biome from 2.2.3 to 2.2.4 in /frontend. PR [#1869](https://github.com/fastapi/full-stack-fastapi-template/pull/1869) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump @tanstack/react-router from 1.131.36 to 1.131.37 in /frontend. PR [#1872](https://github.com/fastapi/full-stack-fastapi-template/pull/1872) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆️ Upgrade Biome to the latest version. PR [#1861](https://github.com/fastapi/full-stack-fastapi-template/pull/1861) by [@alejsdev](https://github.com/alejsdev).\n* ⬆️ Update TansTack Router dependencies. PR [#1853](https://github.com/fastapi/full-stack-fastapi-template/pull/1853) by [@alejsdev](https://github.com/alejsdev).\n* ⬆️ Bump @tanstack/react-query from 5.28.14 to 5.87.1. PR [#1852](https://github.com/fastapi/full-stack-fastapi-template/pull/1852) by [@alejsdev](https://github.com/alejsdev).\n* ⬆ Bump @chakra-ui/react from 3.8.0 to 3.26.0 in /frontend. PR [#1796](https://github.com/fastapi/full-stack-fastapi-template/pull/1796) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆️ Update @hey-api/openapi-ts dependency version and update dependabot config. PR [#1845](https://github.com/fastapi/full-stack-fastapi-template/pull/1845) by [@alejsdev](https://github.com/alejsdev).\n* ⬆️ Update Playwright. PR [#1793](https://github.com/fastapi/full-stack-fastapi-template/pull/1793) by [@alejsdev](https://github.com/alejsdev).\n* ⬆️ Upgrade React and related dependencies. PR [#1843](https://github.com/fastapi/full-stack-fastapi-template/pull/1843) by [@alejsdev](https://github.com/alejsdev).\n\n### Docs\n\n* 📝 Add Mailcatcher setup instructions for local email testing. PR [#2038](https://github.com/fastapi/full-stack-fastapi-template/pull/2038) by [@alejsdev](https://github.com/alejsdev).\n* 📝 Update `README` to include link for Vite. PR [#2037](https://github.com/fastapi/full-stack-fastapi-template/pull/2037) by [@alejsdev](https://github.com/alejsdev).\n* 📝 Fix outdated workflow badge. PR [#2028](https://github.com/fastapi/full-stack-fastapi-template/pull/2028) by [@AymanAlSuleihi](https://github.com/AymanAlSuleihi).\n* 📝 Update docs. PR [#2036](https://github.com/fastapi/full-stack-fastapi-template/pull/2036) by [@alejsdev](https://github.com/alejsdev).\n* ✏️ Fix small typo in `deployment.md`. PR [#1679](https://github.com/fastapi/full-stack-fastapi-template/pull/1679) by [@cassmtnr](https://github.com/cassmtnr).\n\n### Internal\n\n* 🔥 Remove unused dependencies. PR [#2035](https://github.com/fastapi/full-stack-fastapi-template/pull/2035) by [@alejsdev](https://github.com/alejsdev).\n* ⬆ Bump react-dom from 19.2.0 to 19.2.1 in /frontend. PR [#2032](https://github.com/fastapi/full-stack-fastapi-template/pull/2032) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump vite from 7.2.6 to 7.2.7 in /frontend. PR [#2033](https://github.com/fastapi/full-stack-fastapi-template/pull/2033) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump @tanstack/router-plugin from 1.139.12 to 1.140.0 in /frontend. PR [#2034](https://github.com/fastapi/full-stack-fastapi-template/pull/2034) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump lucide-react from 0.555.0 to 0.556.0 in /frontend. PR [#2031](https://github.com/fastapi/full-stack-fastapi-template/pull/2031) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* 🔧 Add Tailwind CSS directives support in biome config. PR [#2029](https://github.com/fastapi/full-stack-fastapi-template/pull/2029) by [@alejsdev](https://github.com/alejsdev).\n* ⬆ Bump react-hook-form from 7.66.1 to 7.67.0 in /frontend. PR [#2018](https://github.com/fastapi/full-stack-fastapi-template/pull/2018) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump @tanstack/react-query from 5.90.10 to 5.90.11 in /frontend. PR [#2019](https://github.com/fastapi/full-stack-fastapi-template/pull/2019) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump axios from 1.12.2 to 1.13.2 in /frontend. PR [#2020](https://github.com/fastapi/full-stack-fastapi-template/pull/2020) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump @tanstack/router-devtools from 1.139.3 to 1.139.12 in /frontend. PR [#2021](https://github.com/fastapi/full-stack-fastapi-template/pull/2021) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump playwright from v1.56.1-noble to v1.57.0-noble in /frontend. PR [#2016](https://github.com/fastapi/full-stack-fastapi-template/pull/2016) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆️ Update schema version in `biome.json`. PR [#2017](https://github.com/fastapi/full-stack-fastapi-template/pull/2017) by [@alejsdev](https://github.com/alejsdev).\n* ⬆ Bump vite from 7.2.2 to 7.2.6 in /frontend. PR [#2015](https://github.com/fastapi/full-stack-fastapi-template/pull/2015) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump @biomejs/biome from 2.3.7 to 2.3.8 in /frontend. PR [#2014](https://github.com/fastapi/full-stack-fastapi-template/pull/2014) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump @tanstack/react-query-devtools from 5.91.0 to 5.91.1 in /frontend. PR [#2013](https://github.com/fastapi/full-stack-fastapi-template/pull/2013) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump @tanstack/router-plugin from 1.133.15 to 1.139.12 in /frontend. PR [#2012](https://github.com/fastapi/full-stack-fastapi-template/pull/2012) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump form-data from 4.0.4 to 4.0.5 in /frontend. PR [#2011](https://github.com/fastapi/full-stack-fastapi-template/pull/2011) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump actions/checkout from 5 to 6. PR [#2007](https://github.com/fastapi/full-stack-fastapi-template/pull/2007) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump @types/react from 19.2.2 to 19.2.7 in /frontend. PR [#2003](https://github.com/fastapi/full-stack-fastapi-template/pull/2003) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump @tanstack/router-devtools from 1.131.42 to 1.139.3 in /frontend. PR [#2001](https://github.com/fastapi/full-stack-fastapi-template/pull/2001) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump typescript from 5.9.2 to 5.9.3 in /frontend. PR [#2002](https://github.com/fastapi/full-stack-fastapi-template/pull/2002) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump @types/react-dom from 19.2.2 to 19.2.3 in /frontend. PR [#2004](https://github.com/fastapi/full-stack-fastapi-template/pull/2004) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump @types/node from 24.10.0 to 24.10.1 in /frontend. PR [#2005](https://github.com/fastapi/full-stack-fastapi-template/pull/2005) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump pydantic-settings from 2.11.0 to 2.12.0 in /backend. PR [#2000](https://github.com/fastapi/full-stack-fastapi-template/pull/2000) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump alembic from 1.17.1 to 1.17.2 in /backend. PR [#1999](https://github.com/fastapi/full-stack-fastapi-template/pull/1999) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump @biomejs/biome from 2.2.4 to 2.3.7 in /frontend. PR [#1998](https://github.com/fastapi/full-stack-fastapi-template/pull/1998) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump react-hook-form from 7.66.0 to 7.66.1 in /frontend. PR [#1997](https://github.com/fastapi/full-stack-fastapi-template/pull/1997) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump @vitejs/plugin-react-swc from 4.2.1 to 4.2.2 in /frontend. PR [#1996](https://github.com/fastapi/full-stack-fastapi-template/pull/1996) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump @chakra-ui/react from 3.29.0 to 3.30.0 in /frontend. PR [#1995](https://github.com/fastapi/full-stack-fastapi-template/pull/1995) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump @tanstack/react-query-devtools from 5.90.2 to 5.91.0 in /frontend. PR [#1994](https://github.com/fastapi/full-stack-fastapi-template/pull/1994) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* 🔧 Add labels to Dependabot updates. PR [#1992](https://github.com/fastapi/full-stack-fastapi-template/pull/1992) by [@alejsdev](https://github.com/alejsdev).\n* ⬆ Bump dotenv from 17.2.2 to 17.2.3 in /frontend. PR [#1957](https://github.com/fastapi/full-stack-fastapi-template/pull/1957) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump @chakra-ui/react from 3.27.0 to 3.29.0 in /frontend. PR [#1974](https://github.com/fastapi/full-stack-fastapi-template/pull/1974) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump @types/react-dom from 19.2.1 to 19.2.2 in /frontend. PR [#1975](https://github.com/fastapi/full-stack-fastapi-template/pull/1975) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump @tanstack/react-query from 5.90.2 to 5.90.7 in /frontend. PR [#1976](https://github.com/fastapi/full-stack-fastapi-template/pull/1976) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump vite from 7.1.11 to 7.2.2 in /frontend. PR [#1977](https://github.com/fastapi/full-stack-fastapi-template/pull/1977) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump pydantic from 2.12.3 to 2.12.4 in /backend. PR [#1978](https://github.com/fastapi/full-stack-fastapi-template/pull/1978) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump js-yaml from 4.1.0 to 4.1.1 in /frontend. PR [#1983](https://github.com/fastapi/full-stack-fastapi-template/pull/1983) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump actions/checkout from 5 to 6. PR [#1988](https://github.com/fastapi/full-stack-fastapi-template/pull/1988) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* 👷 Upgrade `latest-changes` GitHub Action and pin `actions/checkout@v5`. PR [#2006](https://github.com/fastapi/full-stack-fastapi-template/pull/2006) by [@svlandeg](https://github.com/svlandeg).\n* ⬆ Bump @vitejs/plugin-react-swc from 4.1.0 to 4.2.0 in /frontend. PR [#1958](https://github.com/fastapi/full-stack-fastapi-template/pull/1958) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump actions/download-artifact from 5 to 6. PR [#1959](https://github.com/fastapi/full-stack-fastapi-template/pull/1959) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump @types/node from 24.5.2 to 24.9.1 in /frontend. PR [#1961](https://github.com/fastapi/full-stack-fastapi-template/pull/1961) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump actions/upload-artifact from 4 to 5. PR [#1962](https://github.com/fastapi/full-stack-fastapi-template/pull/1962) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump react-hook-form from 7.62.0 to 7.65.0 in /frontend. PR [#1964](https://github.com/fastapi/full-stack-fastapi-template/pull/1964) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump alembic from 1.17.0 to 1.17.1 in /backend. PR [#1970](https://github.com/fastapi/full-stack-fastapi-template/pull/1970) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* 🔧 Fix issue-manager config for reminder. PR [#1972](https://github.com/fastapi/full-stack-fastapi-template/pull/1972) by [@tiangolo](https://github.com/tiangolo).\n* ⬆ Bump @vitejs/plugin-react-swc from 4.0.1 to 4.1.0 in /frontend. PR [#1897](https://github.com/fastapi/full-stack-fastapi-template/pull/1897) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump playwright from v1.55.0-noble to v1.56.1-noble in /frontend. PR [#1943](https://github.com/fastapi/full-stack-fastapi-template/pull/1943) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* 🔧 Configure reminder for `waiting` label in `issue-manager`. PR [#1939](https://github.com/fastapi/full-stack-fastapi-template/pull/1939) by [@YuriiMotov](https://github.com/YuriiMotov).\n* ⬆ Bump vite from 7.1.9 to 7.1.11 in /frontend. PR [#1949](https://github.com/fastapi/full-stack-fastapi-template/pull/1949) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump pydantic from 2.11.10 to 2.12.3 in /backend. PR [#1947](https://github.com/fastapi/full-stack-fastapi-template/pull/1947) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump react-dom and @types/react-dom in /frontend. PR [#1934](https://github.com/fastapi/full-stack-fastapi-template/pull/1934) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump alembic from 1.16.5 to 1.17.0 in /backend. PR [#1935](https://github.com/fastapi/full-stack-fastapi-template/pull/1935) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump actions/setup-node from 5 to 6. PR [#1937](https://github.com/fastapi/full-stack-fastapi-template/pull/1937) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump @tanstack/router-plugin from 1.132.41 to 1.133.15 in /frontend. PR [#1946](https://github.com/fastapi/full-stack-fastapi-template/pull/1946) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump astral-sh/setup-uv from 6 to 7. PR [#1925](https://github.com/fastapi/full-stack-fastapi-template/pull/1925) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump vite from 7.1.7 to 7.1.9 in /frontend. PR [#1919](https://github.com/fastapi/full-stack-fastapi-template/pull/1919) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump @tanstack/router-plugin from 1.131.44 to 1.132.41 in /frontend. PR [#1920](https://github.com/fastapi/full-stack-fastapi-template/pull/1920) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump @tanstack/react-query-devtools from 5.87.4 to 5.90.2 in /frontend. PR [#1921](https://github.com/fastapi/full-stack-fastapi-template/pull/1921) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump pydantic from 2.11.9 to 2.11.10 in /backend. PR [#1922](https://github.com/fastapi/full-stack-fastapi-template/pull/1922) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump tiangolo/issue-manager from 0.5.1 to 0.6.0. PR [#1912](https://github.com/fastapi/full-stack-fastapi-template/pull/1912) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump @types/react from 19.1.13 to 19.1.15 in /frontend. PR [#1906](https://github.com/fastapi/full-stack-fastapi-template/pull/1906) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump pydantic-settings from 2.10.1 to 2.11.0 in /backend. PR [#1907](https://github.com/fastapi/full-stack-fastapi-template/pull/1907) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump @tanstack/react-query from 5.90.1 to 5.90.2 in /frontend. PR [#1905](https://github.com/fastapi/full-stack-fastapi-template/pull/1905) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump @types/node from 24.4.0 to 24.5.2 in /frontend. PR [#1903](https://github.com/fastapi/full-stack-fastapi-template/pull/1903) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump vite from 7.1.5 to 7.1.7 in /frontend. PR [#1893](https://github.com/fastapi/full-stack-fastapi-template/pull/1893) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump @tanstack/react-query from 5.87.4 to 5.90.1 in /frontend. PR [#1896](https://github.com/fastapi/full-stack-fastapi-template/pull/1896) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump @tanstack/react-router from 1.131.44 to 1.131.50 in /frontend. PR [#1894](https://github.com/fastapi/full-stack-fastapi-template/pull/1894) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* 🔧 Update dependabot intervals for uv and npm dependencies to weekly. PR [#1880](https://github.com/fastapi/full-stack-fastapi-template/pull/1880) by [@alejsdev](https://github.com/alejsdev).\n* ⬆ Bump pydantic from 2.9.2 to 2.11.7 in /backend. PR [#1864](https://github.com/fastapi/full-stack-fastapi-template/pull/1864) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* 🔧 Update coverage configuration and simplify test script. PR [#1867](https://github.com/fastapi/full-stack-fastapi-template/pull/1867) by [@alejsdev](https://github.com/alejsdev).\n* 🔧 Add T201 rule to ruff linting configuration to disallow print statements. PR [#1865](https://github.com/fastapi/full-stack-fastapi-template/pull/1865) by [@alejsdev](https://github.com/alejsdev).\n* ⬆ Bump @tanstack/react-query-devtools from 5.87.1 to 5.87.3 in /frontend. PR [#1863](https://github.com/fastapi/full-stack-fastapi-template/pull/1863) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump vite from 6.3.4 to 7.1.5 in /frontend. PR [#1857](https://github.com/fastapi/full-stack-fastapi-template/pull/1857) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump @types/node from 22.15.3 to 24.3.1 in /frontend. PR [#1854](https://github.com/fastapi/full-stack-fastapi-template/pull/1854) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump @vitejs/plugin-react-swc from 3.9.0 to 4.0.1 in /frontend. PR [#1856](https://github.com/fastapi/full-stack-fastapi-template/pull/1856) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump axios from 1.9.0 to 1.11.0 in /frontend. PR [#1855](https://github.com/fastapi/full-stack-fastapi-template/pull/1855) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump alembic from 1.15.2 to 1.16.5 in /backend. PR [#1847](https://github.com/fastapi/full-stack-fastapi-template/pull/1847) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump email-validator from 2.2.0 to 2.3.0 in /backend. PR [#1850](https://github.com/fastapi/full-stack-fastapi-template/pull/1850) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump pydantic-settings from 2.9.1 to 2.10.1 in /backend. PR [#1851](https://github.com/fastapi/full-stack-fastapi-template/pull/1851) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump react-error-boundary from 5.0.0 to 6.0.0 in /frontend. PR [#1849](https://github.com/fastapi/full-stack-fastapi-template/pull/1849) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump @tanstack/react-query-devtools from 5.74.9 to 5.87.1 in /frontend. PR [#1848](https://github.com/fastapi/full-stack-fastapi-template/pull/1848) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump dotenv from 16.4.5 to 17.2.2 in /frontend. PR [#1846](https://github.com/fastapi/full-stack-fastapi-template/pull/1846) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump node from 20 to 24 in /frontend. PR [#1621](https://github.com/fastapi/full-stack-fastapi-template/pull/1621) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump actions/labeler from 5 to 6. PR [#1839](https://github.com/fastapi/full-stack-fastapi-template/pull/1839) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump actions/setup-python from 5 to 6. PR [#1835](https://github.com/fastapi/full-stack-fastapi-template/pull/1835) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump actions/setup-node from 4 to 5. PR [#1836](https://github.com/fastapi/full-stack-fastapi-template/pull/1836) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* 👷 Detect and label merge conflicts on PRs automatically. PR [#1838](https://github.com/fastapi/full-stack-fastapi-template/pull/1838) by [@svlandeg](https://github.com/svlandeg).\n* 🔧 Add frontend linter pre-commit hook. PR [#1791](https://github.com/fastapi/full-stack-fastapi-template/pull/1791) by [@alexrockhill](https://github.com/alexrockhill).\n* ⬆ Bump form-data from 4.0.2 to 4.0.4 in /frontend. PR [#1725](https://github.com/fastapi/full-stack-fastapi-template/pull/1725) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump actions/checkout from 4 to 5. PR [#1768](https://github.com/fastapi/full-stack-fastapi-template/pull/1768) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump actions/download-artifact from 4 to 5. PR [#1754](https://github.com/fastapi/full-stack-fastapi-template/pull/1754) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump tiangolo/latest-changes from 0.3.2 to 0.4.0. PR [#1744](https://github.com/fastapi/full-stack-fastapi-template/pull/1744) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump bcrypt from 4.0.1 to 4.3.0 in /backend. PR [#1601](https://github.com/fastapi/full-stack-fastapi-template/pull/1601) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump react-error-boundary from 4.0.13 to 5.0.0 in /frontend. PR [#1602](https://github.com/fastapi/full-stack-fastapi-template/pull/1602) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump vite from 6.3.3 to 6.3.4 in /frontend. PR [#1608](https://github.com/fastapi/full-stack-fastapi-template/pull/1608) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump @playwright/test from 1.45.2 to 1.52.0 in /frontend. PR [#1586](https://github.com/fastapi/full-stack-fastapi-template/pull/1586) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump pydantic-settings from 2.5.2 to 2.9.1 in /backend. PR [#1589](https://github.com/fastapi/full-stack-fastapi-template/pull/1589) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump next-themes from 0.4.4 to 0.4.6 in /frontend. PR [#1598](https://github.com/fastapi/full-stack-fastapi-template/pull/1598) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump @types/node from 20.10.5 to 22.15.3 in /frontend. PR [#1599](https://github.com/fastapi/full-stack-fastapi-template/pull/1599) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump @tanstack/react-query-devtools from 5.28.14 to 5.74.9 in /frontend. PR [#1597](https://github.com/fastapi/full-stack-fastapi-template/pull/1597) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump sqlmodel from 0.0.22 to 0.0.24 in /backend. PR [#1596](https://github.com/fastapi/full-stack-fastapi-template/pull/1596) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump python-multipart from 0.0.10 to 0.0.20 in /backend. PR [#1595](https://github.com/fastapi/full-stack-fastapi-template/pull/1595) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump alembic from 1.13.2 to 1.15.2 in /backend. PR [#1594](https://github.com/fastapi/full-stack-fastapi-template/pull/1594) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump postgres from 12 to 17. PR [#1580](https://github.com/fastapi/full-stack-fastapi-template/pull/1580) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump axios from 1.8.2 to 1.9.0 in /frontend. PR [#1592](https://github.com/fastapi/full-stack-fastapi-template/pull/1592) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump react-icons from 5.4.0 to 5.5.0 in /frontend. PR [#1581](https://github.com/fastapi/full-stack-fastapi-template/pull/1581) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump jinja2 from 3.1.4 to 3.1.6 in /backend. PR [#1591](https://github.com/fastapi/full-stack-fastapi-template/pull/1591) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump pyjwt from 2.9.0 to 2.10.1 in /backend. PR [#1588](https://github.com/fastapi/full-stack-fastapi-template/pull/1588) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump httpx from 0.27.2 to 0.28.1 in /backend. PR [#1587](https://github.com/fastapi/full-stack-fastapi-template/pull/1587) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump form-data from 4.0.0 to 4.0.2 in /frontend. PR [#1578](https://github.com/fastapi/full-stack-fastapi-template/pull/1578) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump @biomejs/biome from 1.6.1 to 1.9.4 in /frontend. PR [#1582](https://github.com/fastapi/full-stack-fastapi-template/pull/1582) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆️ Update Dependabot configuration to target the backend directory for Python uv updates. PR [#1577](https://github.com/fastapi/full-stack-fastapi-template/pull/1577) by [@alejsdev](https://github.com/alejsdev).\n* 🔧 Update Dependabot config. PR [#1576](https://github.com/fastapi/full-stack-fastapi-template/pull/1576) by [@alejsdev](https://github.com/alejsdev).\n* Bump @babel/runtime from 7.23.9 to 7.27.0 in /frontend. PR [#1570](https://github.com/fastapi/full-stack-fastapi-template/pull/1570) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* Bump esbuild, @vitejs/plugin-react-swc and vite in /frontend. PR [#1571](https://github.com/fastapi/full-stack-fastapi-template/pull/1571) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* Bump axios from 1.7.4 to 1.8.2 in /frontend. PR [#1568](https://github.com/fastapi/full-stack-fastapi-template/pull/1568) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump astral-sh/setup-uv from 5 to 6. PR [#1566](https://github.com/fastapi/full-stack-fastapi-template/pull/1566) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* 🔧  Add npm and docker package ecosystems to Dependabot configuration. PR [#1535](https://github.com/fastapi/full-stack-fastapi-template/pull/1535) by [@alejsdev](https://github.com/alejsdev).\n\n## 0.8.0\n\n### Features\n\n* 🛂 Migrate to Chakra UI v3 . PR [#1496](https://github.com/fastapi/full-stack-fastapi-template/pull/1496) by [@alejsdev](https://github.com/alejsdev).\n* ✨ Add private, local only, API for usage in E2E tests. PR [#1429](https://github.com/fastapi/full-stack-fastapi-template/pull/1429) by [@patrick91](https://github.com/patrick91).\n* ✨ Migrate to latest openapi-ts. PR [#1430](https://github.com/fastapi/full-stack-fastapi-template/pull/1430) by [@patrick91](https://github.com/patrick91).\n\n### Fixes\n\n* 🧑‍🔧 Replace correct value for 'htmlFor'. PR [#1456](https://github.com/fastapi/full-stack-fastapi-template/pull/1456) by [@wesenbergg](https://github.com/wesenbergg).\n\n### Refactors\n\n* ♻️ Redirect the user to `login` if we get 401/403. PR [#1501](https://github.com/fastapi/full-stack-fastapi-template/pull/1501) by [@alejsdev](https://github.com/alejsdev).\n* 🐛 Refactor reset password test to create normal user instead of using super user. PR [#1499](https://github.com/fastapi/full-stack-fastapi-template/pull/1499) by [@alejsdev](https://github.com/alejsdev).\n* ♻️ Replace email types from `str` to `EmailStr` in `config.py`. PR [#1492](https://github.com/fastapi/full-stack-fastapi-template/pull/1492) by [@jpizquierdo](https://github.com/jpizquierdo).\n* 🔧 Remove unused context from router creation. PR [#1498](https://github.com/fastapi/full-stack-fastapi-template/pull/1498) by [@alejsdev](https://github.com/alejsdev).\n* ♻️ Remove redundant item deletion code leveraging cascade delete. PR [#1481](https://github.com/fastapi/full-stack-fastapi-template/pull/1481) by [@nauanbek](https://github.com/nauanbek).\n* ✏️ Fix a couple of spelling mistakes. PR [#1485](https://github.com/fastapi/full-stack-fastapi-template/pull/1485) by [@rjmunro](https://github.com/rjmunro).\n* 🎨 Move `prefix` and `tags` to routers. PR [#1439](https://github.com/fastapi/full-stack-fastapi-template/pull/1439) by [@patrick91](https://github.com/patrick91).\n* ♻️ Remove modify id script in favor of openapi-ts config. PR [#1434](https://github.com/fastapi/full-stack-fastapi-template/pull/1434) by [@patrick91](https://github.com/patrick91).\n* 👷 Improve Playwright CI speed: sharding (parallel runs), run in Docker to use cache, use env vars. PR [#1405](https://github.com/fastapi/full-stack-fastapi-template/pull/1405) by [@tiangolo](https://github.com/tiangolo).\n* ♻️ Add PaginationFooter component. PR [#1381](https://github.com/fastapi/full-stack-fastapi-template/pull/1381) by [@saltie2193](https://github.com/saltie2193).\n* ♻️ Refactored code to use encryption algorithm name from settings for consistency. PR [#1160](https://github.com/fastapi/full-stack-fastapi-template/pull/1160) by [@sameeramin](https://github.com/sameeramin).\n* 🔊 Enable logging for email utils by default. PR [#1374](https://github.com/fastapi/full-stack-fastapi-template/pull/1374) by [@ihmily](https://github.com/ihmily).\n* 🔧 Add `ENV PYTHONUNBUFFERED=1` to log output directly to Docker. PR [#1378](https://github.com/fastapi/full-stack-fastapi-template/pull/1378) by [@tiangolo](https://github.com/tiangolo).\n* 💡 Remove unnecessary comment. PR [#1260](https://github.com/fastapi/full-stack-fastapi-template/pull/1260) by [@sebhani](https://github.com/sebhani).\n\n### Upgrades\n\n* ⬆️ Update Dockerfile to use uv version 0.5.11. PR [#1454](https://github.com/fastapi/full-stack-fastapi-template/pull/1454) by [@alejsdev](https://github.com/alejsdev).\n\n### Docs\n\n* 📝 Removing deprecated manual client SDK step. PR [#1494](https://github.com/fastapi/full-stack-fastapi-template/pull/1494) by [@chandy](https://github.com/chandy).\n* 📝 Update Frontend README.md. PR [#1462](https://github.com/fastapi/full-stack-fastapi-template/pull/1462) by [@getmarkus](https://github.com/getmarkus).\n* 📝 Update `frontend/README.md` to also remove Playwright when removing Frontend. PR [#1452](https://github.com/fastapi/full-stack-fastapi-template/pull/1452) by [@youben11](https://github.com/youben11).\n* 📝 Update `deployment.md`, instructions to install GitHub Runner in non-root VMs. PR [#1412](https://github.com/fastapi/full-stack-fastapi-template/pull/1412) by [@tiangolo](https://github.com/tiangolo).\n* 📝 Add MailCatcher to `development.md`. PR [#1387](https://github.com/fastapi/full-stack-fastapi-template/pull/1387) by [@tobiase](https://github.com/tobiase).\n\n### Internal\n\n* 🔧 Configure path alias for cleaner imports. PR [#1497](https://github.com/fastapi/full-stack-fastapi-template/pull/1497) by [@alejsdev](https://github.com/alejsdev).\n* Bump vite from 5.0.13 to 5.4.14 in /frontend. PR [#1469](https://github.com/fastapi/full-stack-fastapi-template/pull/1469) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump astral-sh/setup-uv from 4 to 5. PR [#1453](https://github.com/fastapi/full-stack-fastapi-template/pull/1453) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump astral-sh/setup-uv from 3 to 4. PR [#1433](https://github.com/fastapi/full-stack-fastapi-template/pull/1433) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump tiangolo/latest-changes from 0.3.1 to 0.3.2. PR [#1418](https://github.com/fastapi/full-stack-fastapi-template/pull/1418) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* 👷 Update issue manager workflow. PR [#1398](https://github.com/fastapi/full-stack-fastapi-template/pull/1398) by [@alejsdev](https://github.com/alejsdev).\n* 👷 Fix smokeshow, checkout files on CI. PR [#1395](https://github.com/fastapi/full-stack-fastapi-template/pull/1395) by [@tiangolo](https://github.com/tiangolo).\n* 👷 Update `labeler.yml`. PR [#1388](https://github.com/fastapi/full-stack-fastapi-template/pull/1388) by [@tiangolo](https://github.com/tiangolo).\n* 🔧 Add .auth playwright folder to `.gitignore`. PR [#1383](https://github.com/fastapi/full-stack-fastapi-template/pull/1383) by [@justin-p](https://github.com/justin-p).\n* ⬆️ Bump rollup from 4.6.1 to 4.22.5 in /frontend. PR [#1379](https://github.com/fastapi/full-stack-fastapi-template/pull/1379) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump astral-sh/setup-uv from 2 to 3. PR [#1364](https://github.com/fastapi/full-stack-fastapi-template/pull/1364) by [@dependabot[bot]](https://github.com/apps/dependabot).\n*  👷 Update pre-commit end-of-file-fixer hook to exclude email-templates. PR [#1296](https://github.com/fastapi/full-stack-fastapi-template/pull/1296) by [@goabonga](https://github.com/goabonga).\n* ⬆ Bump tiangolo/issue-manager from 0.5.0 to 0.5.1. PR [#1332](https://github.com/fastapi/full-stack-fastapi-template/pull/1332) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* 🔧 Run task by the same Python environment used to run Copier. PR [#1157](https://github.com/fastapi/full-stack-fastapi-template/pull/1157) by [@waketzheng](https://github.com/waketzheng).\n* 👷 Tweak generate client to error out if there are errors. PR [#1377](https://github.com/fastapi/full-stack-fastapi-template/pull/1377) by [@tiangolo](https://github.com/tiangolo).\n* 👷 Generate and commit client only on same repo PRs, on forks, show the error. PR [#1376](https://github.com/fastapi/full-stack-fastapi-template/pull/1376) by [@tiangolo](https://github.com/tiangolo).\n\n## 0.7.1\n\n### Highlights\n\n* Migrate from Poetry to [`uv`](https://github.com/astral-sh/uv).\n* Simplifications and improvements for Docker Compose files, Traefik Dockerfiles.\n* Make the API use its own domain `api.example.com` and the frontend use `dashboard.example.com`. This would make it easier to deploy them separately if you needed that.\n* The backend and frontend on Docker Compose now listen on the same port as the local development servers, this way you can stop the Docker Compose services and run the local development servers without changing the frontend configuration.\n\n### Features\n\n* 🩺 Add DB healthcheck. PR [#1342](https://github.com/fastapi/full-stack-fastapi-template/pull/1342) by [@tiangolo](https://github.com/tiangolo).\n\n### Refactors\n\n* ♻️ Update settings to use top level `.env` file. PR [#1359](https://github.com/fastapi/full-stack-fastapi-template/pull/1359) by [@tiangolo](https://github.com/tiangolo).\n* ⬆️ Migrate from Poetry to uv. PR [#1356](https://github.com/fastapi/full-stack-fastapi-template/pull/1356) by [@tiangolo](https://github.com/tiangolo).\n* 🔥 Remove logic for development dependencies and Jupyter, it was never documented, and I no longer use that trick. PR [#1355](https://github.com/fastapi/full-stack-fastapi-template/pull/1355) by [@tiangolo](https://github.com/tiangolo).\n* ♻️ Use Docker Compose `watch`. PR [#1354](https://github.com/fastapi/full-stack-fastapi-template/pull/1354) by [@tiangolo](https://github.com/tiangolo).\n* 🔧 Use plain base official Python Docker image. PR [#1351](https://github.com/fastapi/full-stack-fastapi-template/pull/1351) by [@tiangolo](https://github.com/tiangolo).\n* 🚚 Move location of scripts to simplify file structure. PR [#1352](https://github.com/fastapi/full-stack-fastapi-template/pull/1352) by [@tiangolo](https://github.com/tiangolo).\n* ♻️ Refactor prestart (migrations), move that to its own container. PR [#1350](https://github.com/fastapi/full-stack-fastapi-template/pull/1350) by [@tiangolo](https://github.com/tiangolo).\n* ♻️ Include `FRONTEND_HOST` in CORS origins by default. PR [#1348](https://github.com/fastapi/full-stack-fastapi-template/pull/1348) by [@tiangolo](https://github.com/tiangolo).\n* ♻️ Simplify domains with `api.example.com` for API and `dashboard.example.com` for frontend, improve local development with `localhost`. PR [#1344](https://github.com/fastapi/full-stack-fastapi-template/pull/1344) by [@tiangolo](https://github.com/tiangolo).\n* 🔥 Simplify Traefik, remove www-redirects that add complexity. PR [#1343](https://github.com/fastapi/full-stack-fastapi-template/pull/1343) by [@tiangolo](https://github.com/tiangolo).\n* 🔥 Enable support for Arm Docker images in Mac, remove old patch. PR [#1341](https://github.com/fastapi/full-stack-fastapi-template/pull/1341) by [@tiangolo](https://github.com/tiangolo).\n* ♻️ Remove duplicate information in the ItemCreate model. PR [#1287](https://github.com/fastapi/full-stack-fastapi-template/pull/1287) by [@jjaakko](https://github.com/jjaakko).\n\n### Upgrades\n\n* ⬆️ Upgrade FastAPI. PR [#1349](https://github.com/fastapi/full-stack-fastapi-template/pull/1349) by [@tiangolo](https://github.com/tiangolo).\n\n### Docs\n\n* 💡 Add comments to Dockerfile with uv references. PR [#1357](https://github.com/fastapi/full-stack-fastapi-template/pull/1357) by [@tiangolo](https://github.com/tiangolo).\n* 📝 Add Email Templates to `backend/README.md`. PR [#1311](https://github.com/fastapi/full-stack-fastapi-template/pull/1311) by [@alejsdev](https://github.com/alejsdev).\n\n### Internal\n\n* 👷 Do not sync labels as it overrides manually added labels. PR [#1307](https://github.com/fastapi/full-stack-fastapi-template/pull/1307) by [@tiangolo](https://github.com/tiangolo).\n* 👷 Use uv cache on GitHub Actions. PR [#1366](https://github.com/fastapi/full-stack-fastapi-template/pull/1366) by [@tiangolo](https://github.com/tiangolo).\n* 👷 Update GitHub Actions format. PR [#1363](https://github.com/fastapi/full-stack-fastapi-template/pull/1363) by [@tiangolo](https://github.com/tiangolo).\n* 👷 Use `uv` for Python env to generate client. PR [#1362](https://github.com/fastapi/full-stack-fastapi-template/pull/1362) by [@tiangolo](https://github.com/tiangolo).\n* 👷 Run tests from Python environment (with `uv`), not from Docker container. PR [#1361](https://github.com/fastapi/full-stack-fastapi-template/pull/1361) by [@tiangolo](https://github.com/tiangolo).\n* 🔨 Update `generate-client.sh` script, make it fail on errors, fix generation. PR [#1360](https://github.com/fastapi/full-stack-fastapi-template/pull/1360) by [@tiangolo](https://github.com/tiangolo).\n* 👷 Add GitHub Actions workflow to lint backend apart from tests. PR [#1358](https://github.com/fastapi/full-stack-fastapi-template/pull/1358) by [@tiangolo](https://github.com/tiangolo).\n* 👷 Improve playwright CI job. PR [#1335](https://github.com/fastapi/full-stack-fastapi-template/pull/1335) by [@patrick91](https://github.com/patrick91).\n* 👷 Update `issue-manager.yml`. PR [#1329](https://github.com/fastapi/full-stack-fastapi-template/pull/1329) by [@tiangolo](https://github.com/tiangolo).\n* 💚 Set `include-hidden-files` to `True` when using the `upload-artifact` GH action. PR [#1327](https://github.com/fastapi/full-stack-fastapi-template/pull/1327) by [@svlandeg](https://github.com/svlandeg).\n* 👷🏻 Auto-generate frontend client . PR [#1320](https://github.com/fastapi/full-stack-fastapi-template/pull/1320) by [@alejsdev](https://github.com/alejsdev).\n* 🐛 Fix in `.github/labeler.yml`. PR [#1322](https://github.com/fastapi/full-stack-fastapi-template/pull/1322) by [@alejsdev](https://github.com/alejsdev).\n* 👷 Update `.github/labeler.yml`. PR [#1321](https://github.com/fastapi/full-stack-fastapi-template/pull/1321) by [@alejsdev](https://github.com/alejsdev).\n* 👷 Update `latest-changes` GitHub Action. PR [#1315](https://github.com/fastapi/full-stack-fastapi-template/pull/1315) by [@tiangolo](https://github.com/tiangolo).\n* 👷 Update configs for labeler. PR [#1308](https://github.com/fastapi/full-stack-fastapi-template/pull/1308) by [@tiangolo](https://github.com/tiangolo).\n* 👷 Update GitHub Action labeler to add only one label. PR [#1304](https://github.com/fastapi/full-stack-fastapi-template/pull/1304) by [@tiangolo](https://github.com/tiangolo).\n* ⬆️ Bump axios from 1.6.2 to 1.7.4 in /frontend. PR [#1301](https://github.com/fastapi/full-stack-fastapi-template/pull/1301) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* 👷 Update GitHub Action labeler dependencies. PR [#1302](https://github.com/fastapi/full-stack-fastapi-template/pull/1302) by [@tiangolo](https://github.com/tiangolo).\n* 👷 Update GitHub Action labeler permissions. PR [#1300](https://github.com/fastapi/full-stack-fastapi-template/pull/1300) by [@tiangolo](https://github.com/tiangolo).\n* 👷 Add GitHub Action label-checker. PR [#1299](https://github.com/fastapi/full-stack-fastapi-template/pull/1299) by [@tiangolo](https://github.com/tiangolo).\n* 👷 Add GitHub Action labeler. PR [#1298](https://github.com/fastapi/full-stack-fastapi-template/pull/1298) by [@tiangolo](https://github.com/tiangolo).\n* 👷 Add GitHub Action add-to-project. PR [#1297](https://github.com/fastapi/full-stack-fastapi-template/pull/1297) by [@tiangolo](https://github.com/tiangolo).\n* 👷 Update issue-manager. PR [#1288](https://github.com/fastapi/full-stack-fastapi-template/pull/1288) by [@tiangolo](https://github.com/tiangolo).\n\n## 0.7.0\n\nLots of new things! 🎁\n\n* E2E tests with Playwright.\n* Mailcatcher configuration, to develop and test email handling.\n* Pagination.\n* UUIDs for database keys.\n* New user sign up.\n* Support for deploying to multiple environments (staging, prod).\n* Many refactors and improvements.\n* Several dependency upgrades.\n\n### Features\n\n* ✨ Add User Settings e2e tests. PR [#1271](https://github.com/tiangolo/full-stack-fastapi-template/pull/1271) by [@alejsdev](https://github.com/alejsdev).\n* ✨ Add Reset Password e2e tests. PR [#1270](https://github.com/tiangolo/full-stack-fastapi-template/pull/1270) by [@alejsdev](https://github.com/alejsdev).\n* ✨ Add Sign Up e2e tests. PR [#1268](https://github.com/tiangolo/full-stack-fastapi-template/pull/1268) by [@alejsdev](https://github.com/alejsdev).\n* ✨ Add Sign Up and make `OPEN_USER_REGISTRATION=True` by default. PR [#1265](https://github.com/tiangolo/full-stack-fastapi-template/pull/1265) by [@alejsdev](https://github.com/alejsdev).\n* ✨ Add Login e2e tests. PR [#1264](https://github.com/tiangolo/full-stack-fastapi-template/pull/1264) by [@alejsdev](https://github.com/alejsdev).\n* ✨ Add initial setup for frontend / end-to-end tests with Playwright. PR [#1261](https://github.com/tiangolo/full-stack-fastapi-template/pull/1261) by [@alejsdev](https://github.com/alejsdev).\n* ✨ Add mailcatcher configuration. PR [#1244](https://github.com/tiangolo/full-stack-fastapi-template/pull/1244) by [@patrick91](https://github.com/patrick91).\n* ✨ Introduce pagination in items. PR [#1239](https://github.com/tiangolo/full-stack-fastapi-template/pull/1239) by [@patrick91](https://github.com/patrick91).\n* 🗃️ Add max_length validation for database models and input data. PR [#1233](https://github.com/tiangolo/full-stack-fastapi-template/pull/1233) by [@estebanx64](https://github.com/estebanx64).\n* ✨ Add TanStack React Query devtools in dev build. PR [#1217](https://github.com/tiangolo/full-stack-fastapi-template/pull/1217) by [@tomerb](https://github.com/tomerb).\n* ✨ Add support for deploying multiple environments (staging, production) to the same server. PR [#1128](https://github.com/tiangolo/full-stack-fastapi-template/pull/1128) by [@tiangolo](https://github.com/tiangolo).\n* 👷 Update CI GitHub Actions to allow running in private repos. PR [#1125](https://github.com/tiangolo/full-stack-fastapi-template/pull/1125) by [@tiangolo](https://github.com/tiangolo).\n\n### Fixes\n\n* 🐛 Fix welcome page to show logged-in user. PR [#1218](https://github.com/tiangolo/full-stack-fastapi-template/pull/1218) by [@tomerb](https://github.com/tomerb).\n* 🐛 Fix local Traefik proxy network config to fix Gateway Timeouts. PR [#1184](https://github.com/tiangolo/full-stack-fastapi-template/pull/1184) by [@JoelGotsch](https://github.com/JoelGotsch).\n* ♻️ Fix tests when first superuser password is changed in .env. PR [#1165](https://github.com/tiangolo/full-stack-fastapi-template/pull/1165) by [@billzhong](https://github.com/billzhong).\n* 🐛 Fix bug when resetting password. PR [#1171](https://github.com/tiangolo/full-stack-fastapi-template/pull/1171) by [@alejsdev](https://github.com/alejsdev).\n* 🐛 Fix 403 when the frontend has a directory without an index.html. PR [#1094](https://github.com/tiangolo/full-stack-fastapi-template/pull/1094) by [@tiangolo](https://github.com/tiangolo).\n\n### Refactors\n\n* 🚨 Fix Docker build warning. PR [#1283](https://github.com/tiangolo/full-stack-fastapi-template/pull/1283) by [@erip](https://github.com/erip).\n* ♻️ Regenerate client to use UUID instead of id integers and update frontend. PR [#1281](https://github.com/tiangolo/full-stack-fastapi-template/pull/1281) by [@rehanabdul](https://github.com/rehanabdul).\n* ♻️ Tweaks in frontend. PR [#1273](https://github.com/tiangolo/full-stack-fastapi-template/pull/1273) by [@alejsdev](https://github.com/alejsdev).\n* ♻️ Add random password util and refactor tests. PR [#1277](https://github.com/tiangolo/full-stack-fastapi-template/pull/1277) by [@alejsdev](https://github.com/alejsdev).\n* ♻️ Refactor models to use cascade delete relationships . PR [#1276](https://github.com/tiangolo/full-stack-fastapi-template/pull/1276) by [@alejsdev](https://github.com/alejsdev).\n* 🔥 Remove `USERS_OPEN_REGISTRATION` config, make registration enabled by default. PR [#1274](https://github.com/tiangolo/full-stack-fastapi-template/pull/1274) by [@alejsdev](https://github.com/alejsdev).\n* 🔧 Reuse database url from config in alembic setup. PR [#1229](https://github.com/tiangolo/full-stack-fastapi-template/pull/1229) by [@patrick91](https://github.com/patrick91).\n* 🔧 Update Playwright config and tests to use env variables. PR [#1266](https://github.com/tiangolo/full-stack-fastapi-template/pull/1266) by [@alejsdev](https://github.com/alejsdev).\n* ♻️ Edit refactor db models to use UUID's instead of integer ID's. PR [#1259](https://github.com/tiangolo/full-stack-fastapi-template/pull/1259) by [@estebanx64](https://github.com/estebanx64).\n* ♻️ Update form inputs width. PR [#1263](https://github.com/tiangolo/full-stack-fastapi-template/pull/1263) by [@alejsdev](https://github.com/alejsdev).\n* ♻️ Replace deprecated utcnow() with now(timezone.utc) in utils module. PR [#1247](https://github.com/tiangolo/full-stack-fastapi-template/pull/1247) by [@jalvarezz13](https://github.com/jalvarezz13).\n* 🎨 Format frontend. PR [#1262](https://github.com/tiangolo/full-stack-fastapi-template/pull/1262) by [@alejsdev](https://github.com/alejsdev).\n* ♻️ Abstraction of specific AddModal component out of the Navbar. PR [#1246](https://github.com/tiangolo/full-stack-fastapi-template/pull/1246) by [@ajbloureiro](https://github.com/ajbloureiro).\n* ♻️ Update `login.tsx` to prevent error if username or password are empty. PR [#1257](https://github.com/tiangolo/full-stack-fastapi-template/pull/1257) by [@jmondaud](https://github.com/jmondaud).\n* ♻️ Refactor recover password. PR [#1242](https://github.com/tiangolo/full-stack-fastapi-template/pull/1242) by [@alejsdev](https://github.com/alejsdev).\n* 🎨 Format and lint . PR [#1243](https://github.com/tiangolo/full-stack-fastapi-template/pull/1243) by [@alejsdev](https://github.com/alejsdev).\n* 🎨 Run biome after OpenAPI client generation. PR [#1226](https://github.com/tiangolo/full-stack-fastapi-template/pull/1226) by [@tomerb](https://github.com/tomerb).\n* ♻️ Update DeleteConfirmation component to use new service. PR [#1224](https://github.com/tiangolo/full-stack-fastapi-template/pull/1224) by [@alejsdev](https://github.com/alejsdev).\n* ♻️ Update client services. PR [#1223](https://github.com/tiangolo/full-stack-fastapi-template/pull/1223) by [@alejsdev](https://github.com/alejsdev).\n* ⚒️ Add minor frontend tweaks. PR [#1210](https://github.com/tiangolo/full-stack-fastapi-template/pull/1210) by [@alejsdev](https://github.com/alejsdev).\n* 🚚 Move assets to public folder. PR [#1206](https://github.com/tiangolo/full-stack-fastapi-template/pull/1206) by [@alejsdev](https://github.com/alejsdev).\n* ♻️ Refactor redirect labels to simplify removing the frontend. PR [#1208](https://github.com/tiangolo/full-stack-fastapi-template/pull/1208) by [@tiangolo](https://github.com/tiangolo).\n* 🔒️ Refactor migrate from python-jose to PyJWT. PR [#1203](https://github.com/tiangolo/full-stack-fastapi-template/pull/1203) by [@estebanx64](https://github.com/estebanx64).\n* 🔥 Remove duplicated code. PR [#1185](https://github.com/tiangolo/full-stack-fastapi-template/pull/1185) by [@alejsdev](https://github.com/alejsdev).\n* ♻️ Add delete_user_me endpoint and corresponding test cases. PR [#1179](https://github.com/tiangolo/full-stack-fastapi-template/pull/1179) by [@alejsdev](https://github.com/alejsdev).\n* ✅ Update test to add verification database records. PR [#1178](https://github.com/tiangolo/full-stack-fastapi-template/pull/1178) by [@estebanx64](https://github.com/estebanx64).\n* 🚸 Use `useSuspenseQuery` to fetch members and show skeleton. PR [#1174](https://github.com/tiangolo/full-stack-fastapi-template/pull/1174) by [@patrick91](https://github.com/patrick91).\n* 🎨 Format Utils. PR [#1173](https://github.com/tiangolo/full-stack-fastapi-template/pull/1173) by [@alejsdev](https://github.com/alejsdev).\n* ✨ Use suspense for items page. PR [#1167](https://github.com/tiangolo/full-stack-fastapi-template/pull/1167) by [@patrick91](https://github.com/patrick91).\n* 🚸 Mark login field as required. PR [#1166](https://github.com/tiangolo/full-stack-fastapi-template/pull/1166) by [@patrick91](https://github.com/patrick91).\n* 🚸 Improve login. PR [#1163](https://github.com/tiangolo/full-stack-fastapi-template/pull/1163) by [@patrick91](https://github.com/patrick91).\n* 🥅 Handle AxiosErrors in Login page. PR [#1162](https://github.com/tiangolo/full-stack-fastapi-template/pull/1162) by [@patrick91](https://github.com/patrick91).\n* 🎨 Format frontend. PR [#1161](https://github.com/tiangolo/full-stack-fastapi-template/pull/1161) by [@alejsdev](https://github.com/alejsdev).\n* ♻️ Regenerate frontend client. PR [#1156](https://github.com/tiangolo/full-stack-fastapi-template/pull/1156) by [@alejsdev](https://github.com/alejsdev).\n* ♻️ Refactor rename ModelsOut to ModelsPublic. PR [#1154](https://github.com/tiangolo/full-stack-fastapi-template/pull/1154) by [@estebanx64](https://github.com/estebanx64).\n* ♻️ Migrate frontend client generation from `openapi-typescript-codegen` to `@hey-api/openapi-ts`. PR [#1151](https://github.com/tiangolo/full-stack-fastapi-template/pull/1151) by [@alejsdev](https://github.com/alejsdev).\n* 🔥 Remove unused exports and update dependencies. PR [#1146](https://github.com/tiangolo/full-stack-fastapi-template/pull/1146) by [@alejsdev](https://github.com/alejsdev).\n* 🔧 Update sentry dns initialization following the environment settings. PR [#1145](https://github.com/tiangolo/full-stack-fastapi-template/pull/1145) by [@estebanx64](https://github.com/estebanx64).\n* ♻️ Refactor and tweaks, rename `UserCreateOpen` to `UserRegister` and others. PR [#1143](https://github.com/tiangolo/full-stack-fastapi-template/pull/1143) by [@alejsdev](https://github.com/alejsdev).\n* 🎨 Format imports. PR [#1140](https://github.com/tiangolo/full-stack-fastapi-template/pull/1140) by [@alejsdev](https://github.com/alejsdev).\n* ♻️ Refactor and remove `React.FC`. PR [#1139](https://github.com/tiangolo/full-stack-fastapi-template/pull/1139) by [@alejsdev](https://github.com/alejsdev).\n* ♻️ Add email pattern and refactor in frontend. PR [#1138](https://github.com/tiangolo/full-stack-fastapi-template/pull/1138) by [@alejsdev](https://github.com/alejsdev).\n* 🥅 Set up Sentry for FastAPI applications. PR [#1136](https://github.com/tiangolo/full-stack-fastapi-template/pull/1136) by [@estebanx64](https://github.com/estebanx64).\n* 🔥 Remove deprecated Docker Compose version key. PR [#1129](https://github.com/tiangolo/full-stack-fastapi-template/pull/1129) by [@tiangolo](https://github.com/tiangolo).\n* 🎨 Format with Biome . PR [#1097](https://github.com/tiangolo/full-stack-fastapi-template/pull/1097) by [@alejsdev](https://github.com/alejsdev).\n* 🎨 Update quote style in biome formatter. PR [#1095](https://github.com/tiangolo/full-stack-fastapi-template/pull/1095) by [@alejsdev](https://github.com/alejsdev).\n* ♻️ Replace ESLint and Prettier with Biome to format and lint frontend. PR [#719](https://github.com/tiangolo/full-stack-fastapi-template/pull/719) by [@santigandolfo](https://github.com/santigandolfo).\n* 🎨 Replace buttons styling for variants for consistency. PR [#722](https://github.com/tiangolo/full-stack-fastapi-template/pull/722) by [@alejsdev](https://github.com/alejsdev).\n* 🛠️ Improve `modify-openapi-operationids.js`. PR [#720](https://github.com/tiangolo/full-stack-fastapi-template/pull/720) by [@alejsdev](https://github.com/alejsdev).\n* ♻️ Replace pytest-mock with unittest.mock and remove pytest-cov. PR [#717](https://github.com/tiangolo/full-stack-fastapi-template/pull/717) by [@estebanx64](https://github.com/estebanx64).\n* 🛠️ Minor changes in frontend. PR [#715](https://github.com/tiangolo/full-stack-fastapi-template/pull/715) by [@alejsdev](https://github.com/alejsdev).\n* ♻ Update Docker image to prevent errors in M1 Macs. PR [#710](https://github.com/tiangolo/full-stack-fastapi-template/pull/710) by [@dudil](https://github.com/dudil).\n* ✏ Fix typo in variable names in `backend/app/api/routes/items.py` and `backend/app/api/routes/users.py`. PR [#711](https://github.com/tiangolo/full-stack-fastapi-template/pull/711) by [@disrupted](https://github.com/disrupted).\n\n### Upgrades\n\n* ⬆️ Update SQLModel to version `>=0.0.21`. PR [#1275](https://github.com/tiangolo/full-stack-fastapi-template/pull/1275) by [@alejsdev](https://github.com/alejsdev).\n* ⬆️ Upgrade Traefik. PR [#1241](https://github.com/tiangolo/full-stack-fastapi-template/pull/1241) by [@tiangolo](https://github.com/tiangolo).\n* ⬆️ Bump requests from 2.31.0 to 2.32.0 in /backend. PR [#1211](https://github.com/tiangolo/full-stack-fastapi-template/pull/1211) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆️ Bump jinja2 from 3.1.3 to 3.1.4 in /backend. PR [#1196](https://github.com/tiangolo/full-stack-fastapi-template/pull/1196) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* Bump gunicorn from 21.2.0 to 22.0.0 in /backend. PR [#1176](https://github.com/tiangolo/full-stack-fastapi-template/pull/1176) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* Bump idna from 3.6 to 3.7 in /backend. PR [#1168](https://github.com/tiangolo/full-stack-fastapi-template/pull/1168) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* 🆙 Update React Query to TanStack Query. PR [#1153](https://github.com/tiangolo/full-stack-fastapi-template/pull/1153) by [@patrick91](https://github.com/patrick91).\n* Bump vite from 5.0.12 to 5.0.13 in /frontend. PR [#1149](https://github.com/tiangolo/full-stack-fastapi-template/pull/1149) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* Bump follow-redirects from 1.15.5 to 1.15.6 in /frontend. PR [#734](https://github.com/tiangolo/full-stack-fastapi-template/pull/734) by [@dependabot[bot]](https://github.com/apps/dependabot).\n\n### Docs\n\n* 📝 Update links from tiangolo repo to fastapi org repo. PR [#1285](https://github.com/fastapi/full-stack-fastapi-template/pull/1285) by [@tiangolo](https://github.com/tiangolo).\n* 📝 Add End-to-End Testing with Playwright to frontend `README.md`. PR [#1279](https://github.com/tiangolo/full-stack-fastapi-template/pull/1279) by [@alejsdev](https://github.com/alejsdev).\n* 📝 Update release-notes.md. PR [#1220](https://github.com/tiangolo/full-stack-fastapi-template/pull/1220) by [@alejsdev](https://github.com/alejsdev).\n* ✏️ Update `README.md`. PR [#1205](https://github.com/tiangolo/full-stack-fastapi-template/pull/1205) by [@Craz1k0ek](https://github.com/Craz1k0ek).\n* ✏️ Fix Adminer URL in `deployment.md`. PR [#1194](https://github.com/tiangolo/full-stack-fastapi-template/pull/1194) by [@PhilippWu](https://github.com/PhilippWu).\n* 📝 Add `Enabling Open User Registration` to backend docs. PR [#1191](https://github.com/tiangolo/full-stack-fastapi-template/pull/1191) by [@alejsdev](https://github.com/alejsdev).\n* 📝 Update release-notes.md. PR [#1164](https://github.com/tiangolo/full-stack-fastapi-template/pull/1164) by [@alejsdev](https://github.com/alejsdev).\n* 📝 Update `README.md`. PR [#716](https://github.com/tiangolo/full-stack-fastapi-template/pull/716) by [@alejsdev](https://github.com/alejsdev).\n* 📝 Update instructions to clone for a private repo, including updates. PR [#1127](https://github.com/tiangolo/full-stack-fastapi-template/pull/1127) by [@tiangolo](https://github.com/tiangolo).\n* 📝 Add docs about CI keys, LATEST_CHANGES and SMOKESHOW_AUTH_KEY. PR [#1126](https://github.com/tiangolo/full-stack-fastapi-template/pull/1126) by [@tiangolo](https://github.com/tiangolo).\n* ✏️ Fix file path in `backend/README.md` when not wanting to use migrations. PR [#1116](https://github.com/tiangolo/full-stack-fastapi-template/pull/1116) by [@leonlowitzki](https://github.com/leonlowitzki).\n* 📝 Add documentation for pre-commit and code linting. PR [#718](https://github.com/tiangolo/full-stack-fastapi-template/pull/718) by [@estebanx64](https://github.com/estebanx64).\n* 📝 Fix localhost URLs in `development.md`. PR [#1099](https://github.com/tiangolo/full-stack-fastapi-template/pull/1099) by [@efonte](https://github.com/efonte).\n* ✏ Update header titles for consistency. PR [#708](https://github.com/tiangolo/full-stack-fastapi-template/pull/708) by [@codesmith-emmy](https://github.com/codesmith-emmy).\n* 📝 Update `README.md`, dark mode screenshot position. PR [#706](https://github.com/tiangolo/full-stack-fastapi-template/pull/706) by [@alejsdev](https://github.com/alejsdev).\n\n### Internal\n\n* 🔧 Update deploy workflows to exclude the main repository. PR [#1284](https://github.com/tiangolo/full-stack-fastapi-template/pull/1284) by [@alejsdev](https://github.com/alejsdev).\n* 👷 Update issue-manager.yml GitHub Action permissions. PR [#1278](https://github.com/tiangolo/full-stack-fastapi-template/pull/1278) by [@tiangolo](https://github.com/tiangolo).\n* ⬆️ Bump setuptools from 69.1.1 to 70.0.0 in /backend. PR [#1255](https://github.com/tiangolo/full-stack-fastapi-template/pull/1255) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆️ Bump certifi from 2024.2.2 to 2024.7.4 in /backend. PR [#1250](https://github.com/tiangolo/full-stack-fastapi-template/pull/1250) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆️ Bump urllib3 from 2.2.1 to 2.2.2 in /backend. PR [#1235](https://github.com/tiangolo/full-stack-fastapi-template/pull/1235) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* 🔧 Ignore `src/routeTree.gen.ts` in biome. PR [#1175](https://github.com/tiangolo/full-stack-fastapi-template/pull/1175) by [@patrick91](https://github.com/patrick91).\n* 👷 Update Smokeshow download artifact GitHub Action. PR [#1198](https://github.com/tiangolo/full-stack-fastapi-template/pull/1198) by [@tiangolo](https://github.com/tiangolo).\n* 🔧 Update Node.js version in `.nvmrc`. PR [#1192](https://github.com/tiangolo/full-stack-fastapi-template/pull/1192) by [@alejsdev](https://github.com/alejsdev).\n* 🔥 Remove ESLint and Prettier from pre-commit config. PR [#1096](https://github.com/tiangolo/full-stack-fastapi-template/pull/1096) by [@alejsdev](https://github.com/alejsdev).\n* 🔧 Update mypy config to ignore .venv directories. PR [#1155](https://github.com/tiangolo/full-stack-fastapi-template/pull/1155) by [@tiangolo](https://github.com/tiangolo).\n* 🚨 Enable `ARG001` to prevent unused arguments. PR [#1152](https://github.com/tiangolo/full-stack-fastapi-template/pull/1152) by [@patrick91](https://github.com/patrick91).\n* 🔥 Remove isort configuration, since we use Ruff now. PR [#1144](https://github.com/tiangolo/full-stack-fastapi-template/pull/1144) by [@patrick91](https://github.com/patrick91).\n* 🔧 Update pre-commit config to exclude generated client folder. PR [#1150](https://github.com/tiangolo/full-stack-fastapi-template/pull/1150) by [@alejsdev](https://github.com/alejsdev).\n* 🔧 Change `.nvmrc` format. PR [#1148](https://github.com/tiangolo/full-stack-fastapi-template/pull/1148) by [@patrick91](https://github.com/patrick91).\n* 🎨 Ignore alembic from ruff lint and format. PR [#1131](https://github.com/tiangolo/full-stack-fastapi-template/pull/1131) by [@estebanx64](https://github.com/estebanx64).\n* 🔧 Add GitHub templates for discussions and issues, and security policy. PR [#1105](https://github.com/tiangolo/full-stack-fastapi-template/pull/1105) by [@alejsdev](https://github.com/alejsdev).\n* ⬆ Bump dawidd6/action-download-artifact from 3.1.2 to 3.1.4. PR [#1103](https://github.com/tiangolo/full-stack-fastapi-template/pull/1103) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* 🔧 Add Biome to pre-commit config. PR [#1098](https://github.com/tiangolo/full-stack-fastapi-template/pull/1098) by [@alejsdev](https://github.com/alejsdev).\n* 🔥 Delete leftover celery file. PR [#727](https://github.com/tiangolo/full-stack-fastapi-template/pull/727) by [@dr-neptune](https://github.com/dr-neptune).\n* ⚙️ Update pre-commit config with Prettier and ESLint. PR [#714](https://github.com/tiangolo/full-stack-fastapi-template/pull/714) by [@alejsdev](https://github.com/alejsdev).\n\n## 0.6.0\n\nLatest FastAPI, Pydantic, SQLModel 🚀\n\nBrand new frontend with React, TS, Vite, Chakra UI, TanStack Query/Router, generated client/SDK 🎨\n\nCI/CD - GitHub Actions 🤖\n\nTest cov > 90% ✅\n\n### Features\n\n* ✨ Adopt SQLModel, create models, start using it. PR [#559](https://github.com/tiangolo/full-stack-fastapi-template/pull/559) by [@tiangolo](https://github.com/tiangolo).\n* ✨ Upgrade items router with new SQLModel models, simplified logic, and new FastAPI Annotated dependencies. PR [#560](https://github.com/tiangolo/full-stack-fastapi-template/pull/560) by [@tiangolo](https://github.com/tiangolo).\n* ✨ Migrate from pgAdmin to Adminer. PR [#692](https://github.com/tiangolo/full-stack-fastapi-template/pull/692) by [@tiangolo](https://github.com/tiangolo).\n* ✨ Add support for setting `POSTGRES_PORT`. PR [#333](https://github.com/tiangolo/full-stack-fastapi-template/pull/333) by [@uepoch](https://github.com/uepoch).\n* ⬆ Upgrade Flower version and command. PR [#447](https://github.com/tiangolo/full-stack-fastapi-template/pull/447) by [@maurob](https://github.com/maurob).\n* 🎨 Improve styles. PR [#673](https://github.com/tiangolo/full-stack-fastapi-template/pull/673) by [@alejsdev](https://github.com/alejsdev).\n* 🎨 Update theme. PR [#666](https://github.com/tiangolo/full-stack-fastapi-template/pull/666) by [@alejsdev](https://github.com/alejsdev).\n* 👷 Add continuous deployment and refactors needed for it. PR [#667](https://github.com/tiangolo/full-stack-fastapi-template/pull/667) by [@tiangolo](https://github.com/tiangolo).\n* ✨ Create endpoint to show password recovery email content and update email template. PR [#664](https://github.com/tiangolo/full-stack-fastapi-template/pull/664) by [@alejsdev](https://github.com/alejsdev).\n* 🎨 Format with Prettier. PR [#646](https://github.com/tiangolo/full-stack-fastapi-template/pull/646) by [@alejsdev](https://github.com/alejsdev).\n* ✅ Add tests to raise coverage to at least 90% and fix recover password logic. PR [#632](https://github.com/tiangolo/full-stack-fastapi-template/pull/632) by [@estebanx64](https://github.com/estebanx64).\n* ⚙️ Add Prettier and ESLint config with pre-commit. PR [#640](https://github.com/tiangolo/full-stack-fastapi-template/pull/640) by [@alejsdev](https://github.com/alejsdev).\n* 👷 Add coverage with Smokeshow to CI and badge. PR [#638](https://github.com/tiangolo/full-stack-fastapi-template/pull/638) by [@estebanx64](https://github.com/estebanx64).\n* ✨ Migrate to TanStack Query (React Query) and TanStack Router. PR [#637](https://github.com/tiangolo/full-stack-fastapi-template/pull/637) by [@alejsdev](https://github.com/alejsdev).\n* ✅ Add setup and teardown database for tests. PR [#626](https://github.com/tiangolo/full-stack-fastapi-template/pull/626) by [@estebanx64](https://github.com/estebanx64).\n* ✨ Update new-frontend client. PR [#625](https://github.com/tiangolo/full-stack-fastapi-template/pull/625) by [@alejsdev](https://github.com/alejsdev).\n* ✨ Add password reset functionality. PR [#624](https://github.com/tiangolo/full-stack-fastapi-template/pull/624) by [@alejsdev](https://github.com/alejsdev).\n* ✨ Add private/public routing. PR [#621](https://github.com/tiangolo/full-stack-fastapi-template/pull/621) by [@alejsdev](https://github.com/alejsdev).\n* 🔧 Add VS Code debug configs. PR [#620](https://github.com/tiangolo/full-stack-fastapi-template/pull/620) by [@tiangolo](https://github.com/tiangolo).\n* ✨ Add `Not Found` page. PR [#595](https://github.com/tiangolo/full-stack-fastapi-template/pull/595) by [@alejsdev](https://github.com/alejsdev).\n* ✨ Add new pages, components, panels, modals, and theme; refactor and improvements in existing components. PR [#593](https://github.com/tiangolo/full-stack-fastapi-template/pull/593) by [@alejsdev](https://github.com/alejsdev).\n* ✨ Support delete own account and other tweaks. PR [#614](https://github.com/tiangolo/full-stack-fastapi-template/pull/614) by [@alejsdev](https://github.com/alejsdev).\n* ✨ Restructure folders, allow editing of users/items, and implement other refactors and improvements. PR [#603](https://github.com/tiangolo/full-stack-fastapi-template/pull/603) by [@alejsdev](https://github.com/alejsdev).\n* ✨ Add Copier, migrate from Cookiecutter, in a way that supports using the project as is, forking or cloning it. PR [#612](https://github.com/tiangolo/full-stack-fastapi-template/pull/612) by [@tiangolo](https://github.com/tiangolo).\n* ➕ Replace black, isort, flake8, autoflake with ruff and upgrade mypy. PR [#610](https://github.com/tiangolo/full-stack-fastapi-template/pull/610) by [@tiangolo](https://github.com/tiangolo).\n* ♻ Refactor items and services endpoints to return count and data, and add CI tests. PR [#599](https://github.com/tiangolo/full-stack-fastapi-template/pull/599) by [@estebanx64](https://github.com/estebanx64).\n* ✨ Add support for updating items and upgrade SQLModel to 0.0.16 (which supports model object updates). PR [#601](https://github.com/tiangolo/full-stack-fastapi-template/pull/601) by [@tiangolo](https://github.com/tiangolo).\n* ✨ Add dark mode to new-frontend and conditional sidebar items. PR [#600](https://github.com/tiangolo/full-stack-fastapi-template/pull/600) by [@alejsdev](https://github.com/alejsdev).\n* ✨ Migrate to RouterProvider and other refactors . PR [#598](https://github.com/tiangolo/full-stack-fastapi-template/pull/598) by [@alejsdev](https://github.com/alejsdev).\n* ✨ Add delete_user; refactor delete_item. PR [#594](https://github.com/tiangolo/full-stack-fastapi-template/pull/594) by [@alejsdev](https://github.com/alejsdev).\n* ✨ Add state store to new frontend. PR [#592](https://github.com/tiangolo/full-stack-fastapi-template/pull/592) by [@alejsdev](https://github.com/alejsdev).\n* ✨ Add form validation to Admin, Items and Login. PR [#616](https://github.com/tiangolo/full-stack-fastapi-template/pull/616) by [@alejsdev](https://github.com/alejsdev).\n* ✨ Add Sidebar to new frontend. PR [#587](https://github.com/tiangolo/full-stack-fastapi-template/pull/587) by [@alejsdev](https://github.com/alejsdev).\n* ✨ Add Login to new frontend. PR [#585](https://github.com/tiangolo/full-stack-fastapi-template/pull/585) by [@alejsdev](https://github.com/alejsdev).\n* ✨ Include schemas in generated frontend client. PR [#584](https://github.com/tiangolo/full-stack-fastapi-template/pull/584) by [@alejsdev](https://github.com/alejsdev).\n* ✨ Regenerate frontend client with recent changes. PR [#575](https://github.com/tiangolo/full-stack-fastapi-template/pull/575) by [@alejsdev](https://github.com/alejsdev).\n* ♻️ Refactor API in `utils.py`. PR [#573](https://github.com/tiangolo/full-stack-fastapi-template/pull/573) by [@alejsdev](https://github.com/alejsdev).\n* ✨ Update code for login API. PR [#571](https://github.com/tiangolo/full-stack-fastapi-template/pull/571) by [@tiangolo](https://github.com/tiangolo).\n* ✨ Add client in frontend and client generation. PR [#569](https://github.com/tiangolo/full-stack-fastapi-template/pull/569) by [@alejsdev](https://github.com/alejsdev).\n* 🐳 Set up Docker config for new-frontend. PR [#564](https://github.com/tiangolo/full-stack-fastapi-template/pull/564) by [@alejsdev](https://github.com/alejsdev).\n* ✨ Set up new frontend with Vite, TypeScript and React. PR [#563](https://github.com/tiangolo/full-stack-fastapi-template/pull/563) by [@alejsdev](https://github.com/alejsdev).\n* 📌 Add NodeJS version management and instructions. PR [#551](https://github.com/tiangolo/full-stack-fastapi-template/pull/551) by [@alejsdev](https://github.com/alejsdev).\n* Add consistent errors for env vars not set. PR [#200](https://github.com/tiangolo/full-stack-fastapi-template/pull/200).\n* Upgrade Traefik to version 2, keeping in sync with DockerSwarm.rocks. PR [#199](https://github.com/tiangolo/full-stack-fastapi-template/pull/199).\n* Run tests with `TestClient`. PR [#160](https://github.com/tiangolo/full-stack-fastapi-template/pull/160).\n\n### Fixes\n\n* 🐛 Fix copier to handle string vars with spaces in quotes. PR [#631](https://github.com/tiangolo/full-stack-fastapi-template/pull/631) by [@estebanx64](https://github.com/estebanx64).\n* 🐛 Fix allowing a user to update the email to the same email they already have. PR [#696](https://github.com/tiangolo/full-stack-fastapi-template/pull/696) by [@alejsdev](https://github.com/alejsdev).\n* 🐛 Set up Sentry only when used. PR [#671](https://github.com/tiangolo/full-stack-fastapi-template/pull/671) by [@tiangolo](https://github.com/tiangolo).\n* 🔥 Remove unnecessary validation. PR [#662](https://github.com/tiangolo/full-stack-fastapi-template/pull/662) by [@alejsdev](https://github.com/alejsdev).\n* 🐛 Fix bug when editing own user. PR [#651](https://github.com/tiangolo/full-stack-fastapi-template/pull/651) by [@alejsdev](https://github.com/alejsdev).\n* 🐛  Add `onClose` to `SidebarItems`. PR [#589](https://github.com/tiangolo/full-stack-fastapi-template/pull/589) by [@alejsdev](https://github.com/alejsdev).\n* 🐛 Fix positional argument bug in `init_db.py`. PR [#562](https://github.com/tiangolo/full-stack-fastapi-template/pull/562) by [@alejsdev](https://github.com/alejsdev).\n* 📌 Fix flower Docker image, pin version. PR [#396](https://github.com/tiangolo/full-stack-fastapi-template/pull/396) by [@sanggusti](https://github.com/sanggusti).\n* 🐛 Fix Celery worker command. PR [#443](https://github.com/tiangolo/full-stack-fastapi-template/pull/443) by [@bechtold](https://github.com/bechtold).\n* 🐛 Fix Poetry installation in Dockerfile and upgrade Python version and packages to fix Docker build. PR [#480](https://github.com/tiangolo/full-stack-fastapi-template/pull/480) by [@little7Li](https://github.com/little7Li).\n\n### Refactors\n\n* 🔧 Add missing dotenv variables. PR [#554](https://github.com/tiangolo/full-stack-fastapi-template/pull/554) by [@tiangolo](https://github.com/tiangolo).\n* ⏪ Revert \"⚙️ Add Prettier and ESLint config with pre-commit\". PR [#644](https://github.com/tiangolo/full-stack-fastapi-template/pull/644) by [@alejsdev](https://github.com/alejsdev).\n* 🙈 Add .prettierignore and include client folder. PR [#648](https://github.com/tiangolo/full-stack-fastapi-template/pull/648) by [@alejsdev](https://github.com/alejsdev).\n* 🏷️ Add mypy to the GitHub Action for tests and fixed types in the whole project. PR [#655](https://github.com/tiangolo/full-stack-fastapi-template/pull/655) by [@estebanx64](https://github.com/estebanx64).\n* 🔒️ Ensure the default values of \"changethis\" are not deployed. PR [#698](https://github.com/tiangolo/full-stack-fastapi-template/pull/698) by [@tiangolo](https://github.com/tiangolo).\n* ◀ Revert \"📸 Rename Dashboard to Home and update screenshots\". PR [#697](https://github.com/tiangolo/full-stack-fastapi-template/pull/697) by [@alejsdev](https://github.com/alejsdev).\n* 📸 Rename Dashboard to Home and update screenshots. PR [#693](https://github.com/tiangolo/full-stack-fastapi-template/pull/693) by [@alejsdev](https://github.com/alejsdev).\n* 🐛 Fixed items count when retrieving data for all items by user. PR [#695](https://github.com/tiangolo/full-stack-fastapi-template/pull/695) by [@estebanx64](https://github.com/estebanx64).\n* 🔥 Remove Celery and Flower, they are currently not used nor recommended. PR [#694](https://github.com/tiangolo/full-stack-fastapi-template/pull/694) by [@tiangolo](https://github.com/tiangolo).\n* ✅ Add test for deleting user without privileges. PR [#690](https://github.com/tiangolo/full-stack-fastapi-template/pull/690) by [@alejsdev](https://github.com/alejsdev).\n* ♻️ Refactor user update. PR [#689](https://github.com/tiangolo/full-stack-fastapi-template/pull/689) by [@alejsdev](https://github.com/alejsdev).\n* 📌 Add Poetry lock to git. PR [#685](https://github.com/tiangolo/full-stack-fastapi-template/pull/685) by [@tiangolo](https://github.com/tiangolo).\n* 🎨 Adjust color and spacing. PR [#684](https://github.com/tiangolo/full-stack-fastapi-template/pull/684) by [@alejsdev](https://github.com/alejsdev).\n* 👷 Avoid creating unnecessary *.pyc files with PYTHONDONTWRITEBYTECODE=1. PR [#677](https://github.com/tiangolo/full-stack-fastapi-template/pull/677) by [@estebanx64](https://github.com/estebanx64).\n* 🔧 Add `SMTP_SSL` option for older SMTP servers. PR [#365](https://github.com/tiangolo/full-stack-fastapi-template/pull/365) by [@Metrea](https://github.com/Metrea).\n* ♻️ Refactor logic to allow running pytest tests locally. PR [#683](https://github.com/tiangolo/full-stack-fastapi-template/pull/683) by [@tiangolo](https://github.com/tiangolo).\n* ♻ Update error messages. PR [#417](https://github.com/tiangolo/full-stack-fastapi-template/pull/417) by [@qu3vipon](https://github.com/qu3vipon).\n* 🔧 Add a default Flower password. PR [#682](https://github.com/tiangolo/full-stack-fastapi-template/pull/682) by [@tiangolo](https://github.com/tiangolo).\n* 🔧 Update VS Code debug config. PR [#676](https://github.com/tiangolo/full-stack-fastapi-template/pull/676) by [@tiangolo](https://github.com/tiangolo).\n* ♻️ Refactor code structure for tests. PR [#674](https://github.com/tiangolo/full-stack-fastapi-template/pull/674) by [@tiangolo](https://github.com/tiangolo).\n* 🔧 Set TanStack Router devtools only in dev mode. PR [#668](https://github.com/tiangolo/full-stack-fastapi-template/pull/668) by [@alejsdev](https://github.com/alejsdev).\n* ♻️ Refactor email logic to allow re-using util functions for testing and development. PR [#663](https://github.com/tiangolo/full-stack-fastapi-template/pull/663) by [@tiangolo](https://github.com/tiangolo).\n* 💬 Improve Delete Account description and confirmation. PR [#661](https://github.com/tiangolo/full-stack-fastapi-template/pull/661) by [@alejsdev](https://github.com/alejsdev).\n* ♻️ Refactor email templates. PR [#659](https://github.com/tiangolo/full-stack-fastapi-template/pull/659) by [@alejsdev](https://github.com/alejsdev).\n* 📝 Update deployment files and docs. PR [#660](https://github.com/tiangolo/full-stack-fastapi-template/pull/660) by [@tiangolo](https://github.com/tiangolo).\n* 🔥 Remove unused schemas. PR [#656](https://github.com/tiangolo/full-stack-fastapi-template/pull/656) by [@alejsdev](https://github.com/alejsdev).\n* 🔥 Remove old frontend. PR [#649](https://github.com/tiangolo/full-stack-fastapi-template/pull/649) by [@tiangolo](https://github.com/tiangolo).\n* ♻ Move project source files to top level from src, update Sentry dependency. PR [#630](https://github.com/tiangolo/full-stack-fastapi-template/pull/630) by [@estebanx64](https://github.com/estebanx64).\n* ♻ Refactor Python folder tree. PR [#629](https://github.com/tiangolo/full-stack-fastapi-template/pull/629) by [@estebanx64](https://github.com/estebanx64).\n* ♻️ Refactor old CRUD utils and tests. PR [#622](https://github.com/tiangolo/full-stack-fastapi-template/pull/622) by [@alejsdev](https://github.com/alejsdev).\n* 🔧 Update .env to allow local debug for the backend. PR [#618](https://github.com/tiangolo/full-stack-fastapi-template/pull/618) by [@tiangolo](https://github.com/tiangolo).\n* ♻️ Refactor and update CORS, remove trailing slash from new Pydantic v2. PR [#617](https://github.com/tiangolo/full-stack-fastapi-template/pull/617) by [@tiangolo](https://github.com/tiangolo).\n* 🎨 Format files with pre-commit and Ruff. PR [#611](https://github.com/tiangolo/full-stack-fastapi-template/pull/611) by [@tiangolo](https://github.com/tiangolo).\n* 🚚 Refactor and simplify backend file structure. PR [#609](https://github.com/tiangolo/full-stack-fastapi-template/pull/609) by [@tiangolo](https://github.com/tiangolo).\n* 🔥 Clean up old files no longer relevant. PR [#608](https://github.com/tiangolo/full-stack-fastapi-template/pull/608) by [@tiangolo](https://github.com/tiangolo).\n* ♻ Re-structure Docker Compose files, discard Docker Swarm specific logic. PR [#607](https://github.com/tiangolo/full-stack-fastapi-template/pull/607) by [@tiangolo](https://github.com/tiangolo).\n* ♻️ Refactor update endpoints and regenerate client for new-frontend. PR [#602](https://github.com/tiangolo/full-stack-fastapi-template/pull/602) by [@alejsdev](https://github.com/alejsdev).\n* ✨ Add Layout to App. PR [#588](https://github.com/tiangolo/full-stack-fastapi-template/pull/588) by [@alejsdev](https://github.com/alejsdev).\n* ♻️ Re-enable user update path operations for frontend client generation. PR [#574](https://github.com/tiangolo/full-stack-fastapi-template/pull/574) by [@alejsdev](https://github.com/alejsdev).\n* ♻️ Remove type ignores and add `response_model`. PR [#572](https://github.com/tiangolo/full-stack-fastapi-template/pull/572) by [@alejsdev](https://github.com/alejsdev).\n* ♻️ Refactor Users API and dependencies. PR [#561](https://github.com/tiangolo/full-stack-fastapi-template/pull/561) by [@alejsdev](https://github.com/alejsdev).\n* ♻️ Refactor frontend Docker build setup, use plain NodeJS, use custom Nginx config, fix build for old Vue. PR [#555](https://github.com/tiangolo/full-stack-fastapi-template/pull/555) by [@tiangolo](https://github.com/tiangolo).\n* ♻️ Refactor project generation, discard cookiecutter, use plain git/clone/fork. PR [#553](https://github.com/tiangolo/full-stack-fastapi-template/pull/553) by [@tiangolo](https://github.com/tiangolo).\n* Refactor backend:\n    * Simplify configs for tools and format to better support editor integration.\n    * Add mypy configurations and plugins.\n    * Add types to all the codebase.\n    * Update types for SQLAlchemy models with plugin.\n    * Update and refactor CRUD utils.\n    * Refactor DB sessions to use dependencies with `yield`.\n    * Refactor dependencies, security, CRUD, models, schemas, etc. To simplify code and improve autocompletion.\n    * Change from PyJWT to Python-JOSE as it supports additional use cases.\n    * Fix JWT tokens using user email/ID as the subject in `sub`.\n    * PR [#158](https://github.com/tiangolo/full-stack-fastapi-template/pull/158).\n* Simplify `docker-compose.*.yml` files, refactor deployment to reduce config files. PR [#153](https://github.com/tiangolo/full-stack-fastapi-template/pull/153).\n* Simplify env var files, merge to a single `.env` file. PR [#151](https://github.com/tiangolo/full-stack-fastapi-template/pull/151).\n\n### Upgrades\n\n* 📌 Upgrade Poetry lock dependencies. PR [#702](https://github.com/tiangolo/full-stack-fastapi-template/pull/702) by [@tiangolo](https://github.com/tiangolo).\n* ⬆️ Upgrade Python version and dependencies. PR [#558](https://github.com/tiangolo/full-stack-fastapi-template/pull/558) by [@tiangolo](https://github.com/tiangolo).\n* ⬆ Bump tiangolo/issue-manager from 0.2.0 to 0.5.0. PR [#591](https://github.com/tiangolo/full-stack-fastapi-template/pull/591) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* Bump follow-redirects from 1.15.3 to 1.15.5 in /frontend. PR [#654](https://github.com/tiangolo/full-stack-fastapi-template/pull/654) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* Bump vite from 5.0.4 to 5.0.12 in /frontend. PR [#653](https://github.com/tiangolo/full-stack-fastapi-template/pull/653) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* Bump fastapi from 0.104.1 to 0.109.1 in /backend. PR [#687](https://github.com/tiangolo/full-stack-fastapi-template/pull/687) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* Bump python-multipart from 0.0.6 to 0.0.7 in /backend. PR [#686](https://github.com/tiangolo/full-stack-fastapi-template/pull/686) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Add `uvicorn[standard]` to include `watchgod` and `uvloop`. PR [#438](https://github.com/tiangolo/full-stack-fastapi-template/pull/438) by [@alonme](https://github.com/alonme).\n* ⬆ Upgrade code to support pydantic V2. PR [#615](https://github.com/tiangolo/full-stack-fastapi-template/pull/615) by [@estebanx64](https://github.com/estebanx64).\n\n### Docs\n\n* 🦇 Add dark mode to `README.md`. PR [#703](https://github.com/tiangolo/full-stack-fastapi-template/pull/703) by [@alejsdev](https://github.com/alejsdev).\n* 🍱 Update GitHub image. PR [#701](https://github.com/tiangolo/full-stack-fastapi-template/pull/701) by [@tiangolo](https://github.com/tiangolo).\n* 🍱 Add GitHub image. PR [#700](https://github.com/tiangolo/full-stack-fastapi-template/pull/700) by [@tiangolo](https://github.com/tiangolo).\n* 🚚 Rename project to Full Stack FastAPI Template. PR [#699](https://github.com/tiangolo/full-stack-fastapi-template/pull/699) by [@tiangolo](https://github.com/tiangolo).\n* 📝 Update `README.md`. PR [#691](https://github.com/tiangolo/full-stack-fastapi-template/pull/691) by [@alejsdev](https://github.com/alejsdev).\n* ✏ Fix typo in `development.md`. PR [#309](https://github.com/tiangolo/full-stack-fastapi-template/pull/309) by [@graue70](https://github.com/graue70).\n* 📝 Add docs for wildcard domains. PR [#681](https://github.com/tiangolo/full-stack-fastapi-template/pull/681) by [@tiangolo](https://github.com/tiangolo).\n* 📝 Add the required GitHub Actions secrets to docs. PR [#679](https://github.com/tiangolo/full-stack-fastapi-template/pull/679) by [@tiangolo](https://github.com/tiangolo).\n* 📝 Update `README.md` and `deployment.md`. PR [#678](https://github.com/tiangolo/full-stack-fastapi-template/pull/678) by [@alejsdev](https://github.com/alejsdev).\n* 📝 Update frontend `README.md`. PR [#675](https://github.com/tiangolo/full-stack-fastapi-template/pull/675) by [@alejsdev](https://github.com/alejsdev).\n* 📝 Update deployment docs to use a different directory for traefik-public. PR [#670](https://github.com/tiangolo/full-stack-fastapi-template/pull/670) by [@tiangolo](https://github.com/tiangolo).\n* 📸 Add new screenshots . PR [#657](https://github.com/tiangolo/full-stack-fastapi-template/pull/657) by [@alejsdev](https://github.com/alejsdev).\n* 📝 Refactor README into separate README.md files for backend, frontend, deployment, development. PR [#639](https://github.com/tiangolo/full-stack-fastapi-template/pull/639) by [@tiangolo](https://github.com/tiangolo).\n* 📝 Update README. PR [#628](https://github.com/tiangolo/full-stack-fastapi-template/pull/628) by [@tiangolo](https://github.com/tiangolo).\n* 👷 Update GitHub Action latest-changes and move release notes to independent file. PR [#619](https://github.com/tiangolo/full-stack-fastapi-template/pull/619) by [@tiangolo](https://github.com/tiangolo).\n* 📝 Update internal README and referred files. PR [#613](https://github.com/tiangolo/full-stack-fastapi-template/pull/613) by [@tiangolo](https://github.com/tiangolo).\n* 📝 Update README with in construction notice. PR [#552](https://github.com/tiangolo/full-stack-fastapi-template/pull/552) by [@tiangolo](https://github.com/tiangolo).\n* Add docs about reporting test coverage in HTML. PR [#161](https://github.com/tiangolo/full-stack-fastapi-template/pull/161).\n* Add docs about removing the frontend, for an API-only app. PR [#156](https://github.com/tiangolo/full-stack-fastapi-template/pull/156).\n\n### Internal\n\n* 👷 Add Lint to GitHub Actions outside of tests. PR [#688](https://github.com/tiangolo/full-stack-fastapi-template/pull/688) by [@tiangolo](https://github.com/tiangolo).\n* ⬆ Bump dawidd6/action-download-artifact from 2.28.0 to 3.1.2. PR [#643](https://github.com/tiangolo/full-stack-fastapi-template/pull/643) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump actions/upload-artifact from 3 to 4. PR [#642](https://github.com/tiangolo/full-stack-fastapi-template/pull/642) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* ⬆ Bump actions/setup-python from 4 to 5. PR [#641](https://github.com/tiangolo/full-stack-fastapi-template/pull/641) by [@dependabot[bot]](https://github.com/apps/dependabot).\n* 👷 Tweak test GitHub Action names. PR [#672](https://github.com/tiangolo/full-stack-fastapi-template/pull/672) by [@tiangolo](https://github.com/tiangolo).\n* 🔧 Add `.gitattributes` file to ensure LF endings for `.sh` files. PR [#658](https://github.com/tiangolo/full-stack-fastapi-template/pull/658) by [@estebanx64](https://github.com/estebanx64).\n* 🚚 Move new-frontend to frontend. PR [#652](https://github.com/tiangolo/full-stack-fastapi-template/pull/652) by [@alejsdev](https://github.com/alejsdev).\n* 🔧 Add script for ESLint. PR [#650](https://github.com/tiangolo/full-stack-fastapi-template/pull/650) by [@alejsdev](https://github.com/alejsdev).\n* ⚙️ Add Prettier config. PR [#647](https://github.com/tiangolo/full-stack-fastapi-template/pull/647) by [@alejsdev](https://github.com/alejsdev).\n* 🔧 Update pre-commit config. PR [#645](https://github.com/tiangolo/full-stack-fastapi-template/pull/645) by [@alejsdev](https://github.com/alejsdev).\n* 👷 Add dependabot. PR [#547](https://github.com/tiangolo/full-stack-fastapi-template/pull/547) by [@tiangolo](https://github.com/tiangolo).\n* 👷 Fix latest-changes GitHub Action token, strike 2. PR [#546](https://github.com/tiangolo/full-stack-fastapi-template/pull/546) by [@tiangolo](https://github.com/tiangolo).\n* 👷 Fix latest-changes GitHub Action token config. PR [#545](https://github.com/tiangolo/full-stack-fastapi-template/pull/545) by [@tiangolo](https://github.com/tiangolo).\n* 👷 Add latest-changes GitHub Action. PR [#544](https://github.com/tiangolo/full-stack-fastapi-template/pull/544) by [@tiangolo](https://github.com/tiangolo).\n* Update issue-manager. PR [#211](https://github.com/tiangolo/full-stack-fastapi-template/pull/211).\n* Add [GitHub Sponsors](https://github.com/sponsors/tiangolo) button. PR [#201](https://github.com/tiangolo/full-stack-fastapi-template/pull/201).\n* Simplify scripts and development, update docs and configs. PR [#155](https://github.com/tiangolo/full-stack-fastapi-template/pull/155).\n\n## 0.5.0\n\n* Make the Traefik public network a fixed default of `traefik-public` as done in DockerSwarm.rocks, to simplify development and iteration of the project generator. PR [#150](https://github.com/tiangolo/full-stack-fastapi-template/pull/150).\n* Update to PostgreSQL 12. PR [#148](https://github.com/tiangolo/full-stack-fastapi-template/pull/148). by [@RCheese](https://github.com/RCheese).\n* Use Poetry for package management. Initial PR [#144](https://github.com/tiangolo/full-stack-fastapi-template/pull/144) by [@RCheese](https://github.com/RCheese).\n* Fix Windows line endings for shell scripts after project generation with Cookiecutter hooks. PR [#149](https://github.com/tiangolo/full-stack-fastapi-template/pull/149).\n* Upgrade Vue CLI to version 4. PR [#120](https://github.com/tiangolo/full-stack-fastapi-template/pull/120) by [@br3ndonland](https://github.com/br3ndonland).\n* Remove duplicate `login` tag. PR [#135](https://github.com/tiangolo/full-stack-fastapi-template/pull/135) by [@Nonameentered](https://github.com/Nonameentered).\n* Fix showing email in dashboard when there's no user's full name. PR [#129](https://github.com/tiangolo/full-stack-fastapi-template/pull/129) by [@rlonka](https://github.com/rlonka).\n* Format code with Black and Flake8. PR [#121](https://github.com/tiangolo/full-stack-fastapi-template/pull/121) by [@br3ndonland](https://github.com/br3ndonland).\n* Simplify SQLAlchemy Base class. PR [#117](https://github.com/tiangolo/full-stack-fastapi-template/pull/117) by [@airibarne](https://github.com/airibarne).\n* Update CRUD utils for users, handling password hashing. PR [#106](https://github.com/tiangolo/full-stack-fastapi-template/pull/106) by [@mocsar](https://github.com/mocsar).\n* Use `.` instead of `source` for interoperability. PR [#98](https://github.com/tiangolo/full-stack-fastapi-template/pull/98) by [@gucharbon](https://github.com/gucharbon).\n* Use Pydantic's `BaseSettings` for settings/configs and env vars. PR [#87](https://github.com/tiangolo/full-stack-fastapi-template/pull/87) by [@StephenBrown2](https://github.com/StephenBrown2).\n* Remove `package-lock.json` to let everyone lock their own versions (depending on OS, etc).\n* Simplify Traefik service labels PR [#139](https://github.com/tiangolo/full-stack-fastapi-template/pull/139).\n* Add email validation. PR [#40](https://github.com/tiangolo/full-stack-fastapi-template/pull/40) by [@kedod](https://github.com/kedod).\n* Fix typo in README. PR [#83](https://github.com/tiangolo/full-stack-fastapi-template/pull/83) by [@ashears](https://github.com/ashears).\n* Fix typo in README. PR [#80](https://github.com/tiangolo/full-stack-fastapi-template/pull/80) by [@abjoker](https://github.com/abjoker).\n* Fix function name `read_item` and response code. PR [#74](https://github.com/tiangolo/full-stack-fastapi-template/pull/74) by [@jcaguirre89](https://github.com/jcaguirre89).\n* Fix typo in comment. PR [#70](https://github.com/tiangolo/full-stack-fastapi-template/pull/70) by [@daniel-butler](https://github.com/daniel-butler).\n* Fix Flower Docker configuration. PR [#37](https://github.com/tiangolo/full-stack-fastapi-template/pull/37) by [@dmontagu](https://github.com/dmontagu).\n* Add new CRUD utils based on DB and Pydantic models. Initial PR [#23](https://github.com/tiangolo/full-stack-fastapi-template/pull/23) by [@ebreton](https://github.com/ebreton).\n* Add normal user testing Pytest fixture. PR [#20](https://github.com/tiangolo/full-stack-fastapi-template/pull/20) by [@ebreton](https://github.com/ebreton).\n\n## 0.4.0\n\n* Fix security on resetting a password. Receive token as body, not query. PR [#34](https://github.com/tiangolo/full-stack-fastapi-template/pull/34).\n\n* Fix security on resetting a password. Receive it as body, not query. PR [#33](https://github.com/tiangolo/full-stack-fastapi-template/pull/33) by [@dmontagu](https://github.com/dmontagu).\n\n* Fix SQLAlchemy class lookup on initialization. PR [#29](https://github.com/tiangolo/full-stack-fastapi-template/pull/29) by [@ebreton](https://github.com/ebreton).\n\n* Fix SQLAlchemy operation errors on database restart. PR [#32](https://github.com/tiangolo/full-stack-fastapi-template/pull/32) by [@ebreton](https://github.com/ebreton).\n\n* Fix locations of scripts in generated README. PR [#19](https://github.com/tiangolo/full-stack-fastapi-template/pull/19) by [@ebreton](https://github.com/ebreton).\n\n* Forward arguments from script to `pytest` inside container. PR [#17](https://github.com/tiangolo/full-stack-fastapi-template/pull/17) by [@ebreton](https://github.com/ebreton).\n\n* Update development scripts.\n\n* Read Alembic configs from env vars. PR <a href=\"https://github.com/tiangolo/full-stack-fastapi-template/pull/9\" target=\"_blank\">#9</a> by <a href=\"https://github.com/ebreton\" target=\"_blank\">@ebreton</a>.\n\n* Create DB Item objects from all Pydantic model's fields.\n\n* Update Jupyter Lab installation and util script/environment variable for local development.\n\n## 0.3.0\n\n* PR <a href=\"https://github.com/tiangolo/full-stack-fastapi-template/pull/14\" target=\"_blank\">#14</a>:\n    * Update CRUD utils to use types better.\n    * Simplify Pydantic model names, from `UserInCreate` to `UserCreate`, etc.\n    * Upgrade packages.\n    * Add new generic \"Items\" models, crud utils, endpoints, and tests. To facilitate re-using them to create new functionality. As they are simple and generic (not like Users), it's easier to copy-paste and adapt them to each use case.\n    * Update endpoints/*path operations* to simplify code and use new utilities, prefix and tags in `include_router`.\n    * Update testing utils.\n    * Update linting rules, relax vulture to reduce false positives.\n    * Update migrations to include new Items.\n    * Update project README.md with tips about how to start with backend.\n\n* Upgrade Python to 3.7 as Celery is now compatible too. PR <a href=\"https://github.com/tiangolo/full-stack-fastapi-template/pull/10\" target=\"_blank\">#10</a> by <a href=\"https://github.com/ebreton\" target=\"_blank\">@ebreton</a>.\n\n## 0.2.2\n\n* Fix frontend hijacking /docs in development. Using latest https://github.com/tiangolo/node-frontend with custom Nginx configs in frontend. <a href=\"https://github.com/tiangolo/full-stack-fastapi-template/pull/6\" target=\"_blank\">PR #6</a>.\n\n## 0.2.1\n\n* Fix documentation for *path operation* to get user by ID. <a href=\"https://github.com/tiangolo/full-stack-fastapi-template/pull/4\" target=\"_blank\">PR #4</a> by <a href=\"https://github.com/mpclarkson\" target=\"_blank\">@mpclarkson</a> in FastAPI.\n\n* Set `/start-reload.sh` as a command override for development by default.\n\n* Update generated README.\n\n## 0.2.0\n\n**<a href=\"https://github.com/tiangolo/full-stack-fastapi-template/pull/2\" target=\"_blank\">PR #2</a>**:\n\n* Simplify and update backend `Dockerfile`s.\n* Refactor and simplify backend code, improve naming, imports, modules and \"namespaces\".\n* Improve and simplify Vuex integration with TypeScript accessors.\n* Standardize frontend components layout, buttons order, etc.\n* Add local development scripts (to develop this project generator itself).\n* Add logs to startup modules to detect errors early.\n* Improve FastAPI dependency utilities, to simplify and reduce code (to require a superuser).\n\n## 0.1.2\n\n* Fix path operation to update self-user, set parameters as body payload.\n\n## 0.1.1\n\nSeveral bug fixes since initial publication, including:\n\n* Order of path operations for users.\n* Frontend sending login data in the correct format.\n* Add https://localhost variants to CORS.\n"
  },
  {
    "path": "scripts/generate-client.sh",
    "content": "#! /usr/bin/env bash\n\nset -e\nset -x\n\ncd backend\nuv run python -c \"import app.main; import json; print(json.dumps(app.main.app.openapi()))\" > ../openapi.json\ncd ..\nmv openapi.json frontend/\nbun run --filter frontend generate-client\nbun run lint\n"
  },
  {
    "path": "scripts/test-local.sh",
    "content": "#! /usr/bin/env bash\n\n# Exit in case of error\nset -e\n\ndocker-compose down -v --remove-orphans # Remove possibly previous broken stacks left hanging after an error\n\nif [ $(uname -s) = \"Linux\" ]; then\n    echo \"Remove __pycache__ files\"\n    sudo find . -type d -name __pycache__ -exec rm -r {} \\+\nfi\n\ndocker-compose build\ndocker-compose up -d\ndocker-compose exec -T backend bash scripts/tests-start.sh \"$@\"\n"
  },
  {
    "path": "scripts/test.sh",
    "content": "#! /usr/bin/env sh\n\n# Exit in case of error\nset -e\nset -x\n\ndocker compose build\ndocker compose down -v --remove-orphans # Remove possibly previous broken stacks left hanging after an error\ndocker compose up -d\ndocker compose exec -T backend bash scripts/tests-start.sh \"$@\"\ndocker compose down -v --remove-orphans\n"
  }
]