Jesse Alvarado, signature
Back to work

Case study · 2023

Factory

An internal tool that deploys a full AWS backend from a five-step form. I designed and built it for a client's DevOps team.

Role
UI design and prototype
Year
2023
Stack
Next.js, Material UI, AWS CDK, Vercel, Django, Postgres

Why we built it

My client's DevOps team set up nearly the same backend servers for every new project. Each setup took the team hours they could spend elsewhere.

We wanted to automate that work. The plan was an app that deploys a backend from reusable configuration templates.

What Factory does

Factory runs the deploy, shows live status while it works and hands back the files a DevOps engineer needs to manage the new stack.

Can a form deploy a server?

The first question was whether a UI could trigger these deploys at all. I sat down with the DevOps team to map what an AWS deploy needs and where a new tool would fit in their week.

We settled on a simple step form. You enter a project name, your AWS keys and a template. Factory handles the rest.

A whiteboard sketch of the Factory flow: project details, a choice of dev, staging or prod, a confirm step with price and credentials, then YAML downloads.
The first sketch of the flow, on the office whiteboard.

After some research, we picked the AWS CDK toolkit. A CDK script describes one infrastructure setup as code. Factory sends that script to AWS with the user's keys. If AWS accepts the keys, it builds the whole stack right away.

My role

I designed the UI in Figma on a Material UI design system. Then I built a working prototype.

Wireframes

Factory is an internal tool, so I used Material UI. It kept design time short and left more time for features. After a few rounds with the engineers, we agreed on a design.

The Factory wizard in Figma: a dark sidebar, the five numbered steps and the Material UI layer list.
The wizard layout in Figma, built from Material UI components.

How it works

The frontend is Next.js. Vercel serverless functions run each CDK deploy.

A tour of the app

Dashboard

The dashboard lists every project you have deployed. The New Project button opens the wizard.

The Factory dashboard while it loads, with grey placeholder cards in a three-column grid.
Placeholder cards hold the layout while projects load.
The Factory dashboard: project cards with a status badge, a date and a Details button, plus a sidebar of AWS links.
Each card shows the stack status from CloudFormation.

The wizard

The wizard is the core of Factory. I wanted a flow a junior DevOps engineer could follow without help.

Step one of the New Infrastructure wizard: the five steps on the left and a project name field on the right.
Step one: name the project.
The template step: Django-based development, production and debug templates, each listing its AWS settings.
Step two: pick a template. Each one lists the AWS settings it uses.

Factory must never store AWS keys. The key fields hide every character but the last four, and the keys stay in memory only as long as the deploy needs them.

The access step: AWS key fields that mask every character but the last four, with a note that keys are never stored.
Step three: paste your AWS keys.

A deploy costs money. So a review screen asks the user to check every detail and confirm before anything runs.

The final confirmation: project name, template and masked keys, with a consent checkbox above the Deploy button.
Step four: review and confirm.

After you click Deploy, a live log shows progress. When the deploy finishes, Factory sends you to the project's details page.

The deploy step: a progress bar above a live log that reads "Starting CDK deployment".
Step five: the deploy runs with a live log.

What users asked for next

Users wanted to see the deploy logs from AWS. Phase one kept logs on the server. In phase two, a Django API saved them to Postgres.

A project page with a Deployment Logs panel: a date picker above the CDK output, and a Delete Project button below.
Saved deploy logs for each project. The AWS account ID is hidden here.
A Finished card with download links for the CloudFormation YAML, ecs-compose.yml, ecs-params.yml and a GitHub Actions deploy.yml, above a summary of IDs.
The finish screen links each generated file.

Each project page offers downloads: the CloudFormation YAML, ecs-compose.yml and ecs-params.yml for the ECS task, and a GitHub Actions deploy.yml. Factory builds these files on request from live AWS API calls.

A project details page: status, a Downloads menu, a summary of subnets and settings, and a list of resources with copy buttons.
The project page sums up the stack and its resources.

Security

Phase one only tested whether a Next.js app could deploy infrastructure, so it had no login. Phase two added accounts, so users can come back to past projects. A Django server handles auth, and Factory deployed that server itself.

The forms also check every field in the browser before they submit.

The Factory sign-in page: the logo above username and password fields and a Login button.
Sign in.
The Factory create-account page with username, email and password fields.
Create an account.
The create-account form with errors: "Please enter a valid email address" and "Must include at least one capital letter".
Validation catches a bad email and a weak password.

Where it ended up

Phases one and two shipped. Phase three planned GitHub integration to speed up deploys. The beta is no longer online.