This is all the code that powers https://tokens.dougrich.net
The code is roughly broken into 5 big parts: api, batch, ux, pipe, and gateway.
api is an HTTP service which hosts the service endpoints and authentication
batch is a pubsub subscriber which asynchronously handles batch commands
ux is both an HTTP service and a client-side application
pipe is a pipe to take the legacy storage (mongodb documents) and pump them into the new DB
gateway is a NGINX gateway that correctly maps all the routes, handles SSL termination, and caches static assets
Additionally, there are the following root folders:
.circleci which contains the continuous integration commands
deploy which contains deployment scripts and utilities
misc which contains related pictures and similar that don't fit under a specific group
token-parts which contains the raw token parts
cd tooling
npm start -- remove tag new
- Create a
config.json
based onconfig.example.json
& give access to google compute by providing acreds.json
which contains a google account code. You'll need to create the firebase account in google compute. - Create a
config.auth.json
based onconfig.auth.example.json
. Each provider will need to be setup with their own credentials.
- Start the containers with
docker-compose -f docker-compose.yml -f docker-compose.dev.yml up --build
- Bundle the token parts
cd tooling
npm start -- bundle
- Make changes to either code (re-run docker-compose commands) or token parts (re-run bundling commands)
Missing ux/src/token-parts
or api/src/token-parts
- you're missing the output from the token parts bundle. Check that you ran step 2 of the developer loop.
If you're adding a new part, run through this checklist:
- Create artwork
- Ensure layers are separate. Each layer needs to be a root level
g
tag in the SVG - Ensure each layer can be colored independently. Each layer will have the
fill
style element replaced with a new value. - Each layer needs a unique class attribute. This determines their name in the code & should be on the
g
element. It is saved as part of the token.