Commit Graph

155 Commits

Author SHA1 Message Date
Joe Ardent 14c36397d1 fuckin' with shit 2023-09-21 16:58:41 -07:00
Joe Ardent cc14c30fcf delete watchquest benchmark bin 2023-07-29 12:29:40 -07:00
Joe Ardent 71fae193be minor tidy 2023-07-29 12:27:12 -07:00
Joe Ardent b8481dc106 finish the migration to julids 2023-07-28 16:15:27 -07:00
Joe Ardent 7aefedf993 Use Julids for DbId.
First phase just does a typedef of "DbId = Julid", and confirms the plugin will load into
sqlite. All tests pass. Next phase removes client-side generation of IDs.
2023-07-26 17:10:52 -07:00
Joe Ardent c824a2b07a update to sqlx 0.7, using personal fork of axum-login 2023-07-26 12:46:53 -07:00
Joe Ardent 359a732a84 Fix the tests.
The test server had to be created in an async context or Hyper wouldn't run.
2023-07-21 15:15:47 -07:00
Joe Ardent 48308aa169 make db acquire sync; tests fail but app runs correctly 2023-07-18 17:37:24 -07:00
Joe Ardent a9e3bcbfc3 close db connections on shutdown 2023-07-10 11:15:24 -07:00
Joe Ardent 3532f3daf7 remove dbg output for login 2023-07-08 22:06:50 -07:00
Joe Ardent 840fba6e92 more inappropriation 2023-07-08 22:00:26 -07:00
Joe Ardent 4ea285abb5 no witches in src or db 2023-07-08 21:21:12 -07:00
Joe Ardent 0e016552ab Clean up the import code.
Make things as batch-y as possible; add timers; tweak the db.
2023-07-08 13:16:05 -07:00
Joe Ardent 49d405fd10 Best results yet, just use (user, watch) for quest ID. 2023-07-06 13:56:55 -07:00
Joe Ardent 4c44aa12b0 Now takes only 6 seconds, instead of 3600. Ready for final tests. 2023-07-06 12:24:25 -07:00
Joe Ardent 4f0540a903 super duper slowly adds watchquests 2023-07-06 08:48:42 -07:00
Joe Ardent 87fe035971 refactored omega code, same results as before 2023-07-05 16:26:20 -07:00
Joe Ardent 5e4f5c07d8 Update db config to production-friendly.
Four seconds to insert 10k records, with a prod-safe config. Stick with this design.
2023-07-04 16:24:28 -07:00
Joe Ardent f58106ee36 checkpoint; logins broken somehow, maybe just from remote host 2023-07-04 12:22:17 -07:00
Joe Ardent e93e43786f inserts 10k rows in 6 seconds 2023-07-04 11:30:42 -07:00
Joe Ardent 825db88039 imports 10k random movies 2023-07-03 15:20:19 -07:00
Joe Ardent 83da336a3f Make it easier to add watches from a CLI tool. 2023-07-02 15:16:47 -07:00
Joe Ardent 04549fd7a5 change showkind repr to i8 2023-07-01 16:20:48 -07:00
Joe Ardent 4896223b83 add a bunch of stuff for adding and seeing watches 2023-07-01 15:42:01 -07:00
Joe Ardent 1f8e642612 add `created_at()` on IDs 2023-06-29 16:27:21 -07:00
Joe Ardent fc2d575e18 clean up serde code during blog post writing 2023-06-28 09:51:15 -07:00
Joe Ardent 84d70336d3 rename some templates, lean in to big-endian IDs 2023-06-22 14:10:18 -07:00
Joe Ardent 4211ead59e tidy the db_ids a bit 2023-06-22 10:01:04 -07:00
Joe Ardent 656e6dceed add working ULID-based IDs for primary keys 2023-06-21 16:30:13 -07:00
Joe Ardent be96100237 mostly done, but logins aren't working 2023-06-20 16:32:36 -07:00
Joe Ardent 8e54c6f99a more template renaming and tidying 2023-06-20 12:14:18 -07:00
Joe Ardent 987d0937c9 rename handler 2023-06-20 09:38:48 -07:00
Joe Ardent cea9af1112 add working 'add new watch' handler 2023-06-19 16:54:28 -07:00
Joe Ardent 78b77dbd30 more "search" fleshing out 2023-06-18 12:04:09 -07:00
Joe Ardent 0fbcfb9c8c remove useless route 2023-06-18 12:04:09 -07:00
Joe Ardent 7c42b6316a flesh out get_watch() 2023-06-15 16:19:07 -07:00
Joe Ardent 48a1233534 Use graphemes for input length checks instead of number of bytes. 2023-06-15 13:13:12 -07:00
Joe Ardent 1540153b67 add search results page 2023-06-14 22:11:43 -07:00
Joe Ardent 5f02fb265a move macro import to lib.rs 2023-06-14 22:05:50 -07:00
Joe Ardent 0d03ce3d12 add a couple more tests for optional user 2023-06-14 16:00:28 -07:00
Joe Ardent f456e07559 make derive not do a trait 2023-06-13 22:08:28 -07:00
Joe Ardent 695f450c64 Use proc macro for optional optional user. 2023-06-13 15:56:15 -07:00
Joe Ardent e310e547f6 shit is fucked up, probably abandoning 2023-06-13 12:34:54 -07:00
Joe Ardent 9ac4810d80 Add demo of query params for searching watches. 2023-06-10 15:32:50 -07:00
Joe Ardent 8b1eef17f7 Simplify form input handling.
The form input values were coming to the handlers already-urldecoded, so no need to re-decode them.
2023-06-10 15:30:36 -07:00
Joe Ardent c94890b9f0 checkpoint 2023-06-10 11:32:40 -07:00
Joe Ardent dc3f90228f Merge WIP material from "watches" branch. 2023-06-09 15:03:52 -07:00
Joe Ardent dd9a32dfd7 minor mod and visibility re-org 2023-06-09 15:01:16 -07:00
Joe Ardent c44c89005c add working endpoints for getting your watches 2023-06-08 15:45:34 -07:00
Joe Ardent 1e9d97bd19 tweak endpoints 2023-06-08 09:17:11 -07:00
Joe Ardent 9505266ef9 minor re-org and rename of main page template struct. 2023-06-08 09:16:38 -07:00
Joe Ardent 55c75110d0 add comment about using ULIDs maybe 2023-06-06 14:59:00 -07:00
Joe Ardent 898e8d381e tweak the db model for watches, add handler skeletons 2023-06-06 14:08:49 -07:00
Joe Ardent 1a4ffaa99d adds Watches struct 2023-06-05 16:51:27 -07:00
Joe Ardent edaf9e50f3 remove unreachable error code 2023-06-04 15:37:08 -07:00
Joe Ardent 9292454dd3 Add test for duplicate username. 2023-06-03 16:10:48 -07:00
Joe Ardent 8d040ad368 Finish signup tests. 2023-06-03 15:45:19 -07:00
Joe Ardent 38a6cdeb84 backport test utils improvments to login tests 2023-06-03 13:58:37 -07:00
Joe Ardent 09a07f2c57 more test skeletons 2023-06-03 12:36:18 -07:00
Joe Ardent bad698cc19 add skeleton for signup tests 2023-06-03 10:42:23 -07:00
Joe Ardent 0f0d7f488f Add more test utils. 2023-06-03 10:11:07 -07:00
Joe Ardent 81d35e1661 Fix broken test and move helpers to test util module. 2023-06-02 17:32:48 -07:00
Joe Ardent 30169733a0 More login testing, added reference user factory fn. 2023-06-02 17:01:59 -07:00
Joe Ardent 569b19e837 Minor tweaks. 2023-06-02 14:15:13 -07:00
Joe Ardent 659bc0d008 Add tests for login/logout endpoints.
Changes in the test DB setup are there to support persistent in-memory DBs for testing.
2023-06-02 14:12:29 -07:00
Joe Ardent 81adffe7f0 fix migration test with hack
Without sleeping after migration, the tests fail, so...
2023-06-01 12:24:43 -07:00
Joe Ardent b691e6ee8d add automatic migration on startup 2023-05-31 21:47:59 -07:00
Joe Ardent 453a126b95 Add generic handlers tests, remove broken doctests for session store. 2023-05-31 15:58:03 -07:00
Joe Ardent 352a85eaef Move router creation to lib to allow easier testing. 2023-05-31 13:15:33 -07:00
Joe Ardent 8c666c3f78 only update last_seen every 12 hours 2023-05-31 12:43:57 -07:00
Joe Ardent 57a6b69ec3 tidy up db stuff 2023-05-30 18:44:25 -07:00
Joe Ardent 6425dd4016 Add middleware to update `last_seen`. 2023-05-30 14:51:52 -07:00
Joe Ardent 5dcd726df1 move all db stuff to db mod. 2023-05-29 17:17:23 -07:00
Joe Ardent d2613b0ef9 End-to-end web-based signup, login, and logout flows work. 2023-05-29 14:25:50 -07:00
Joe Ardent 5de4b9994c stub out logout 2023-05-29 11:13:12 -07:00
Joe Ardent dbff72330e Adds working login route. 2023-05-28 17:55:16 -07:00
Joe Ardent 559e277d9e fix deps 2023-05-28 17:06:09 -07:00
Joe Ardent 0f0a7583cd Move login stuff to own module. 2023-05-28 13:44:50 -07:00
Joe Ardent e5d66769dc rename modules for users 2023-05-28 13:31:45 -07:00
Joe Ardent 41a7abbe13 go back to uuids for users 2023-05-28 12:58:26 -07:00
Joe Ardent b1fd57c486 checkpoint working skeleton for login 2023-05-28 12:20:55 -07:00
Joe Ardent 60862a5d6a minor tidy 2023-05-24 17:08:40 -07:00
Joe Ardent 0d6c9932d6 Add SqliteSessionStore module.
Stolen with very minor mods from https://github.com/jbr/async-sqlx-session
2023-05-24 16:39:13 -07:00
Joe Ardent 8237715066 simplify uuid/db handling 2023-05-22 17:18:13 -07:00
Joe Ardent f50abaa4a6 re-org some handlers, handle '/'. 2023-05-22 16:57:08 -07:00
Joe Ardent 06d7b4a514 Fixed redirect on success, removed DbUser struct. 2023-05-22 15:08:14 -07:00
Joe Ardent b7eb56e0e7 redirects weirdly 2023-05-19 17:17:24 -07:00
Joe Ardent ebfc759fa6 Add redirect response to signup success. 2023-05-19 15:13:49 -07:00
Joe Ardent fee7fff3df better signup pages 2023-05-18 15:49:33 -07:00
Joe Ardent 79ecd74500 more cleanup 2023-05-18 12:24:43 -07:00
Joe Ardent 46232b4254 minor cleanup 2023-05-18 12:15:37 -07:00
Joe Ardent 091ddbf48a Working user signup, looks ugly.
Still no login or sessions, though.
2023-05-18 10:05:29 -07:00
Joe Ardent 94f1b35c03 adding html templates 2023-05-17 13:40:06 -07:00
Joe Ardent f12b524457 filling out templates for account creation 2023-05-17 10:09:00 -07:00
Joe Ardent d9c56aaf1e rename error 2023-05-16 16:24:24 -07:00
Joe Ardent 93deaff565 add username validation (length only) 2023-05-16 12:24:53 -07:00
Joe Ardent da5eefa73a add check for uniqueness violation in account creation 2023-05-16 11:55:32 -07:00
Joe Ardent 95762f341b checkpoint fucking with errors 2023-05-14 20:33:36 -07:00
Joe Ardent d87ade7980 add user structs 2023-05-12 15:36:19 -07:00
Joe Ardent 0223242473 move user stuff to module 2023-05-12 14:24:57 -07:00