Eru Ilúvatar, the supreme, delegated the shaping of the world
This project defines the foundations of various critical technologies at Ethereal Elegance Aromatics. This mostly utilizes OpenTofu, but also other supporting technologies and capabilities to provide optimal user experiences on our site.
*Sorted alphabetically
- Cloudflare
- Direnv
- GitHub Actions
- GPG
- Nix
- NodeJS
- OpenTofu
- S3
- SOPS
- Taskfile
- TypeScript
- Yarn
A free and open source fork of Terraform. This is used for defining and maintaining various infrastructure for the application. This includes aspects of the stack such as Cloudflare DNS and Neon databases.
The declarative and functional package manager and language: Nix. This is a minimal flake that provided just the development layer tier, though Nix can be utilized for bundling and deploying packages to NixOS environments too.
A useful development tool for augmenting your shell for projects, allowing you to load environment variables and tools transparently by simply changing into a project directory. This, along with the builtin support for Nix with use flake
, allows anyone with direnv
and nix
to immediately enter a shell with the exact versions of tools for the project.
It's NodeJS! The famous single-threaded event-loop JavaScript runtime powered by the V8 engine.
Have you ever been like "what the heck is this variable? what can I do with it? what will be there? what might be there?" Well you may have wanted to have some better typing. TypeScript takes the largely unbounded ECMAScript and makes it significantly more tenable to understand and work with as projects expand (or don't). It doesn't alter the runtime at all but exists at the compilation layer- providing static type safety only, but more safe than JS alone.
A Node package manager. You could swap this out for pnpm, npm, etc. It has good out-of-the-box support for workspaces which I often find useful.
This template provides recommendations and settings for the Nix Env Selector extension which utilizes the shell.nix
file to provide an identical environment for the VS Code editor as the direnv
shell would. This parity ensures you aren't references different versions of binaries due to variance in your code
process's $PATH
and the shell's.
Everything lives under packages/
for now. This supports a basic monorepo structure where individual npm packages can exist through the project with Yarn's workspaces support.
You can get started with the OpenTofu stack with the shared S3 state in Cloudflare R2.
There are two major requirements:
⚠️ Make sure you're inside theinfrastructure/${project}
directory for all the commands, e.g.infrastructure/torinreine
⚠️ Make sure you have the necessary environment variables sourced to your shell from the.env
file. This is encrypted bysops
.
Now, initialize the project:
tofu init -backend-config=../backends/cloudflare-r2.conf
Plan the project:
tofu plan
Apply the project:
tofu apply
Common tasks are defined in the Taskfile.yml
file. Read more on Taskfile to learn how to use and interact with it. This will require the task
CLI.
You can list all tasks with task --list-all
.
Secrets are managed with sops and gnupg. You can edit existing sops files, granted you have sufficient access to, with sops $filepath
. Older version of sops
also had a command for this using sops edit $filename
.