Flashcards App
Design deliberations for https://github.com/dchege711/study_buddy/ .
Dated Mar 27, 2024; last modified on Wed, 27 Mar 2024
Design deliberations for https://github.com/dchege711/study_buddy/ .
Random Link ¯\_(ツ)_/¯ | ||
Apr 19, 2024 | » | Client/Server Interface
4 min; updated Apr 19, 2024
How to handle redirects without setting window.location.href? Right now, there’s a pattern of doing: sendHTTPRequest("POST", "/login/", {}) .then((_) => { window.location.href = "/"; }) .catch((err) => { console.error(err); }); Isn’t this something that the server can do? In response, why not issue a redirect? Screenshot of the redirect chain from /login. The POST request gets a 303 (See Other) redirect to /home. The browser then makes a GET request to /home, which results in a 304 (Not Modified).... |
Apr 18, 2024 | » | Use of Local Storage
3 min; updated Apr 18, 2024
Back when I wrote this, the motivation for using localStorage was to reduce the trips to the server so that the app is usable offline. However, with two data stores (localStorage and the server), the former has a possibility of going stale. What usage is correct and how can we avoid stale data? localStorage['session_info'] getAccountInfo: () => AuthenticateUser | null fetches the session_info entry and JSON.parses it into an AuthenticateUser. This is a possible failure point because the parsed JSON cannot be trusted to be a valid AuthenticateUser instance.... |
Apr 18, 2024 | » | Using Web Components
(2 items)
Wiki Page; App Layout; |
Mar 27, 2024 | » | Hosting the Flashcards App
3 min; updated Mar 27, 2024
Current State: SaaS The app is hosted at render.com on Render’s free tier that gives us these free web services: Custom domains Managed TLS certificates Pull request reviews Log streams Rollbacks up to the two most recent previous deploys. … with these limitations: Spins down after 15min of no inbound traffic. Spinning up on the next request causes a noticeable delay for a couple seconds.... |