devpad #3 - Tech Stack Issues

Published

I've run into some issues getting the server-side rendering to work with a seperate backend & frontend application. For the authentication workflow I followed a tutorial using Lucia which handles all the state handling for the oauth flow & github callback urls automatically. However, since I want the Astro project to be rendered server side, I need somehow to store the session on the astro server. However, I also need the session stored on the back-end project. I'm sure there is a way to get the session to be handled in both servers, but after giving it some time & a lot of thinking, there really doesn't need to be 2 seperate servers for this application. While the API will be large, and this was part of the reason I wanted to keep the API and front-end seperate, astro does come with it's own api/ path. I think it just makes logistical sense to keep the project stack as simple as possible. While I would've loved to use a seperate API project as this keeps testing, typing & database operations isolated, the extra complexity of this session handling I don't think is worth it at the moment, especially since I want to move forward quickly with this project.

Summary

Previously my project was going to split the front-end (Astro server-side rendering), and back-end (Typescript Express w/ Drizzle ORM). Now, I'm going to convert my database management into the front-end project, probably bringing the front-end sub-folder to the project root, and begin re-implementing authentication workflow in the Astro api/ route. Hopefully, this will simplify further development and keep things simple for quicker and more agile development.