I hope to use this skeleton as a foundation to integrate user authentication, with workspace/groupspace support in SvelteKit web app.
Status : I think it's stable, but it hasn't been tested in production.
Screencast project presentation (audio in french)
This project is a spin-off of sveltekit-user-auth-skeleton
.
Repository starting point issue (in French): https://github.com/stephane-klein/sveltekit-user-auth-skeleton/issues/7
In a real project, the tables main.resource_a
and main.resource_b
should be replaced by products
, issues
,
customers
, invoices
… entities.
Features:
POLICY
query plans have been reviewed to ensure that the best indexes are used (I'm not claiming that everything is perfect at the moment, but this is one of the main objectives of this project)Next tasks on the roadmap:
Opinions:
impersonate_user_id
is stored in auth.sessions
table (this can be challenged)Components and libraries:
Tooling:
The 2023-09-21
, until commit 3db763a
, I spent 56 hours and 20 mintes on this project (The time spent on sveltekit-user-auth-skeleton
project has been included in this time (15 hours and 28 minutes)).
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
>>> import math
>>> french_developer_on_a_permanent_contract = math.ceil(56.5/4) * 437
>>> french_developer_on_a_permanent_contract
1748
>>> freelance = math.ceil(56.5/4) * 600
>>> freelance
2400
>>>
$ asdf install
$ pnpm install
Start database engine:
$ ./scripts/init.sh
$ ./load-fixtures.js
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