DEV Community

Arman Tarkhanian
Arman Tarkhanian

Posted on

2023-09-22: Login and registration

Another week another dollar.

We obviously determined localtunnel to not be a long-term solution because the tunneling only works as long as the process is running, which can terminate by itself for whatever reason.

In that case, our first task was to actually get our DNS to work. Our boss had had a testing subdomain already set up for the server, but it was getting overridden by the Cloudflare worker by mistake so we removed that.

Then we had to set up the nginx again for that subdomain, and it started redirecting to the server instead of the worker. However, we ran into Cloudflare issues with various different 500 errors.

The first one we had to deal with was SSL stuff. A lot of that stuff, our boss had to configure himself since he was the admin. After fiddling around with it for a day (via nginx, Cloudflare, etc.), we finally got that working, and the error message changed to a 502 Bad Gateway, which meant it was now the server's problem rather than SSL.

After tinkering around with ports and origin points on both with nginx and FastAPI, it finally got working again. It had something to do with how FastAPI needs to actually be running (duh), and that it receives regular HTTP from nginx rather than HTTPS.

After that, we started working on making the backend and frontend actually interact in a way that we want for the user signup and login.

Getting the endpoints correct was simple enough, but we ran into issues pretty quickly with "unprocessable entities" which required us to modify both ends inputs and outputs. Eventually we got it working to do both signups and logins, but the moment we enabled CORS again, we were stuck.

After a day and a half of debugging this, we figured that it was again a combination of nginx and FastAPI stripping off the CORS headers when sending back to the frontend, which got it throwing errors.

Once we had FastAPI manually add them back in and make sure nginx was also not stripping them off in the first place, it started working again. Once that was good to go, we brainstormed some test cases and user stories for the registration and logins and JWTs to make sure everything is working as expected.

Come Friday, we demoed our work to our COO and he was pleased with the progress. Our frontend developer also showed off new designs for the website with more information.

Otherwise, I think that's all I have to report this week. Until next time, cheers.

Top comments (0)