I hope to use this skeleton as a foundation to integrate user authentication in SvelteKit web app.
Screencast project presentation (audio in french)
Repository starting point issue (in French): https://github.com/stephane-klein/backlog/issues/209
This skeleton is build over sveltekit-ssr-skeleton
.
Features:
INVITATION_REQUIRED=1
variable env)Opinions:
impersonate_user_id
is stored in auth.sessions
table (this can be challenged)Components and libraries:
Tooling:
The 2023-09-21
, until commit fb78f6d
, I spent 15 hours and 28 minutes on this project.
This time was measured with a chronometer, which is deep work.
I consider that a "normal" working day corresponds to a maximum of 4 hours of deep work.
This work would correspond to the following price:
$ python
Python 3.11.5 (main, Aug 28 2023, 00:00:00) [GCC 13.2.1 20230728 (Red Hat 13.2.1-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import math
>>> french_developer_on_a_permanent_contract = math.ceil(15.5/4) * 437
>>> french_developer_on_a_permanent_contract
1748
>>> freelance = math.ceil(15.5/4) * 600
>>> freelance
2400
>>>
$ asdf install
$ pnpm install
Start database engine:
$ ./scripts/init.sh
$ ./scripts/fixtures.sh
Start web server:
$ pnpm run dev
Go to http://localhost:5173/
[email protected]
password: secret1
[email protected]
password: secret2
[email protected]
password: secret3
Create new user with:
$ pnpm run user create [email protected] --username=john-doe4 --password=password --firstname=John --lastname=Doe
You can access to Maildev on http://localhost:1080
$ pnpm run migrate:watch
Apply migration in migrations/current.sql
and commit:
$ pnpm run migrate:commit
$ pnpm run migrate-test:watch
$ pnpm run -s tests
PASS tests/auth.js
✓ Create a user (39 ms)
Test Suites: 1 passed, 1 total
Tests: 1 passed, 1 total
Snapshots: 0 total
Time: 0.255 s, estimated 1 s
Ran all test suites.
Launch Prettier check:
$ pnpm run prettier-check
Apply Prettier fix example:
$ pnpm run prettier src/app.html
$ pnpm run eslint