{"id":21997392,"url":"https://github.com/stephane-klein/sveltekit-user-auth-skeleton","last_synced_at":"2026-04-18T04:31:44.858Z","repository":{"id":166865275,"uuid":"642405236","full_name":"stephane-klein/sveltekit-user-auth-skeleton","owner":"stephane-klein","description":"Skeleton as a foundation to integrate user authentication in SvelteKit web app","archived":false,"fork":false,"pushed_at":"2023-09-21T10:59:16.000Z","size":460,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-23T04:44:26.639Z","etag":null,"topics":["authentication","docker","postgresql","skeleton","svelte","sveltekit"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stephane-klein.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-05-18T13:46:48.000Z","updated_at":"2023-09-03T20:20:42.000Z","dependencies_parsed_at":"2024-11-29T22:16:11.445Z","dependency_job_id":"66aac3f1-02d8-4177-9c2a-409b41602d52","html_url":"https://github.com/stephane-klein/sveltekit-user-auth-skeleton","commit_stats":null,"previous_names":["stephane-klein/poc-sveltekit-user-auth-skeleton"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/stephane-klein/sveltekit-user-auth-skeleton","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stephane-klein%2Fsveltekit-user-auth-skeleton","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stephane-klein%2Fsveltekit-user-auth-skeleton/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stephane-klein%2Fsveltekit-user-auth-skeleton/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stephane-klein%2Fsveltekit-user-auth-skeleton/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stephane-klein","download_url":"https://codeload.github.com/stephane-klein/sveltekit-user-auth-skeleton/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stephane-klein%2Fsveltekit-user-auth-skeleton/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31956819,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T00:39:45.007Z","status":"online","status_checked_at":"2026-04-18T02:00:07.018Z","response_time":103,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["authentication","docker","postgresql","skeleton","svelte","sveltekit"],"created_at":"2024-11-29T22:16:06.391Z","updated_at":"2026-04-18T04:31:44.841Z","avatar_url":"https://github.com/stephane-klein.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SvelteKit SSR user auth skeleton\n\nI hope to use this skeleton as a foundation to integrate user authentication in SvelteKit web app.\n\n[Screencast project presentation](https://youtu.be/l8x9daevJBQ) (audio in french)\n\nRepository starting point issue (in French): https://github.com/stephane-klein/backlog/issues/209\n\nThis skeleton is build over [`sveltekit-ssr-skeleton`](https://github.com/stephane-klein/sveltekit-ssr-skeleton).\n\nFeatures:\n\n- User login\n- User signup\n- User signup by invitation (enabled by `INVITATION_REQUIRED=1` variable env)\n- User password reset support\n- User impersonate support for staff user\n\nOpinions:\n\n- No ORM pattern\n- `impersonate_user_id` is stored in `auth.sessions` table (this can be challenged)\n- I'm trying to move towards [Radical Simplicity](https://www.radicalsimpli.city/)\n- [Don’t Build A General Purpose API To Power Your Own Front End](https://max.engineer/server-informed-ui)\n\nComponents and libraries:\n\n- ✅ [SSR](https://kit.svelte.dev/docs/page-options#ssr) [SvelteKit](https://github.com/sveltejs/kit) with [Hydration](https://kit.svelte.dev/docs/glossary#hydration)\n- ✅ PostgreSQL database server\n- ✅ [Postgres.js](https://github.com/porsager/postgres) - PostgreSQL client for Node.js\n- ✅ Migration powered by [graphile-migrate](https://github.com/graphile/migrate)\n- ✅ Token generated with [jsonwebtoken](https://github.com/auth0/node-jsonwebtoken)\n\nTooling:\n\n- ✅ [asdf](https://asdf-vm.com/)\n- ✅ [NodeJS](https://nodejs.org/en/)\n- ✅ [pnpm](https://pnpm.io/)\n- ✅ [Jest](https://jestjs.io/) for unittest\n\n## Development time and costs\n\nThe `2023-09-21`, until commit [`fb78f6d`](https://github.com/stephane-klein/sveltekit-user-auth-skeleton/commit/fb78f6d4598697d6325d6b642d27ead57ef8d5dc), I spent 15 hours and 28 minutes on this project.\u003cbr /\u003e\nThis time was measured with a chronometer, which is deep work.\u003cbr /\u003e\nI consider that a \"normal\" working day corresponds to a maximum of 4 hours of deep work.\n\nThis work would correspond to the following price:\n\n- For a French developer on a permanent contract at 65 K€ gross per year: 1748 € (total cost paid by the employer)\n- For a freelance developer at 600 € per day: 2400 € (total cost invoiced by the freelance)\n\n\u003cdetails\u003e\n  \u003csummary\u003eSee details\u003c/summary\u003e\n\n```sh\n$ python\nPython 3.11.5 (main, Aug 28 2023, 00:00:00) [GCC 13.2.1 20230728 (Red Hat 13.2.1-1)] on linux\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n\u003e\u003e\u003e import math\n\u003e\u003e\u003e french_developer_on_a_permanent_contract = math.ceil(15.5/4) * 437\n\u003e\u003e\u003e french_developer_on_a_permanent_contract\n1748\n\u003e\u003e\u003e freelance = math.ceil(15.5/4) * 600\n\u003e\u003e\u003e freelance\n2400\n\u003e\u003e\u003e\n```\n\n\u003c/details\u003e\n\n## Getting started\n\n```sh\n$ asdf install\n```\n\n```sh\n$ pnpm install\n```\n\nStart database engine:\n\n```sh\n$ ./scripts/init.sh\n$ ./scripts/fixtures.sh\n```\n\nStart web server:\n\n```sh\n$ pnpm run dev\n```\n\nGo to http://localhost:5173/\n\n## Valid logins\n\n- email: `john.doe1@example.com`\n  password: `secret1`\n- email: `john.doe2@example.com`\n  password: `secret2`\n- email: `john.doe3@example.com`\n  password: `secret3`\n\nCreate new user with:\n\n```\n$ pnpm run user create --email=john.doe4@example.com --username=john-doe4 --password=password --firstname=John --lastname=Doe\n```\n\n## Maildev\n\nYou can access to Maildev on http://localhost:1080\n\n## Database migration\n\n```\n$ pnpm run migrate:watch\n```\n\nApply migration in `migrations/current.sql` and commit:\n\n```\n$ pnpm run migrate:commit\n```\n\n## Execute Unittest\n\n```\n$ pnpm run migrate-test:watch\n```\n\n```sh\n$ pnpm run -s tests\n PASS  tests/auth.js\n  ✓ Create a user (39 ms)\n\nTest Suites: 1 passed, 1 total\nTests:       1 passed, 1 total\nSnapshots:   0 total\nTime:        0.255 s, estimated 1 s\nRan all test suites.\n```\n\n## Prettier\n\nLaunch Prettier check:\n\n```sh\n$ pnpm run prettier-check\n```\n\nApply Prettier fix example:\n\n```sh\n$ pnpm run prettier src/app.html\n```\n\n## ESlint\n\n```sh\n$ pnpm run eslint\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstephane-klein%2Fsveltekit-user-auth-skeleton","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstephane-klein%2Fsveltekit-user-auth-skeleton","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstephane-klein%2Fsveltekit-user-auth-skeleton/lists"}