Sailbot Notes is a webapp that allows users to take notes, and search, filter, and tag them.
I created this app becuase I was curious about a few new technologies. On the backend, I wanted to try out Tom Christie's Starlette, which is awesome. On the frontend, I was curious about Turbolinks and Stimulus. These libraries were used to build Hey's email app, which notably doesn't use a client-rendered JavaScript framework such as React. I have some observations about these technologies which I've told myself I'll write a blog post about someday. In the meantime, here's how to setup the project.
docker-compose up
That's it. Go to a web browser and open localhost:8000
.
Sailbot Notes has two components that need to be setup: a Mongo database and the application container.
- Go to Lightsail and create an instance with Ubuntu 20.04. Copy the contents of mongo-cloud-init into the launch script field. This script installs and configures MongoDB. WARNING: This script is fine for this demo, but it's not up to par for use in production.
- After the instance is ready, SSH into it and make sure that
mongo
was installed and is up by runningsystemctl status mongod
. - Note the internal ip of your instance.
- Go to Lightsail and create a container service. Skip setting up your first deployment.
- While your service is spinning up, build your container locally by running:
docker build . -t linksaver
- Upload your image to Lightsail:
aws lightsail push-container-image --service-name <the name you gave> --label linksaver --image linksaver
- Back on the Lightsail console, create a deployment with the following values.
- Set an environment variable whose key is
DB_CONNECTION
and whose value ismongodb://admin:admin@<private ip of your mongo instance>:27017/?authSource=admin
. - Open port
8000
with a protocol ofHTTP
.
- Set an environment variable whose key is
- After your deployment is complete, go to your service's public URL and create an account for yourself.