Server Projects
I want to build up my backend server knowledge. My last big server project was rewriting the login system at Khan Academy in Go. But my last solo-server stuff was writing Ruby on Rails backends. I want to catch up to building things now. I’ve been thinking about what I want to do and I think my projects are like this:
- Is sleeping?
- A single webpage that responds no. Or maybe responds no except if it’s after 1am?
- This probably could be a static site but I want a 1-page server as a starter-project
- Contact form
- I need a contact form. I think this should be 3 routes
- A form
- The POST for sending messages
- The thank you
- I need a contact form. I think this should be 3 routes
- Gratitude
- A form based website for sharing gratitude for open source projects
- This might need login
- Lion Clicker
- This is what I’m building up to!
Javascript Server tooling
I’m finding the backend scene for JS backends overwhelming and frustrating. Everything seems to need a dynamic react frontend which also means an API. I miss websites that were rendered on the server and served to the client.
I’m looking at using:
- Koa - successor to express
- Redwood JS - rails-ish for javascript (but going through a big rewrite?)
Minimal servers:
- Express
- Hapi
- Fastify: https://github.com/fastify/fastify
- Koa
Is Lion Sleeping?
I made a tiny tiny server powered website to check if my stuffed Lion is sleeping. It’s deployed on lion.computer
at is-sleeping.lion.computer/.
I used nestjsas the server and handlebarsfor the template. It uses Pico CSS for the base style. I really like pico css for a quickstart for making something that looks pretty good.
There is a 1 in 5 chance that lion is having a sleeping. This is, obviously, important information to document.
Some annoyances:
- Nest has some very enterprise-y, very pattern-y ideas about organizing things. I’m looking at you Factory functions, Modules, and Services
- There is reloading of code once nest starts up. Want to make a change to the code? quit and restart the server
- Nest isn’t aware of templates by default and it’s up to you to figure it out
- The examples from the nest docs don’t work. Or rather they don’t work with typescript. Blahhhhhh
Some learnings:
- I think dokku somehow knows to do
yarn build
and then when it’s time to run the server it’s looking foryarn start
End of day
Today was a combination of sugar high from releasing something that I cared about and worked on, the Optimist and feeling the falling-feeling that today is (probably) my last day in NYC for my batch (I might try to come back the last week of my batch in December). I’m so glad people are enjoying the zine and I feel shy about receiving the praise/compliments that come along with it.
Notebook page for today: https://notes.nicole.computer/daily/2024-11-22
Worked on Today
The next thing I’m working on is going to require a server. So I spent my day thinking about servers and checking out Javascript servers. If you have success/strong feeling about Javascript on the server side- I want to know. I’m looking for something that works well with typescript, has hot-module replacement (so I don’t have to restart the server time), works well with templating, and has some opinions on databases/routing.
Today I tried out nestJSand made a tiny web server to check if my stuffed Lion (who is appropriately named Lion) is sleeping. Mostly Lion is not sleeping, he is doing important business-lion things. But there’s a (1 in 5) chance he is. That random chance is computed on the server and then templated into handlebars.
Anyway, if you want to check here’s the server: https://is-sleeping.lion.computer/
Tomorrow
Tomorrow I fly home to Colorado. I probably won’t do too much but my next step project is to write a contact form using JS on the server side. I’m really not interested in React as my frontend (or Vue). I just want templates. So I’ll be figuring that out.
I’m also looking forward to spending time in Nature of Code and working on the assignments from missing semester around data wrangling.