A breakdown of a modern startup’s tech stack with a focus on JavaScript and simplicity.
Automagical is a platform that makes it easy and fun to create quality marketing videos from existing content.
Disclaimer: I’m the founder & CTO of Automagical.
I’d like to give an overview of its architecture and reflect on how important engineering simplicity is to a product’s success.
Automagical makes heavy use of JavaScript, as the backend is written in Node.js, and the frontend is built with React.js via the create-react-app standard. The source code is managed by git as a monorepo on GitHub, and deployment is handled by the extremely simple now service.
The primary backend datastore is a hosted version of mongoDB, and two hosted instances of redis are used for storing user authentication tokens and async task information respectively. An async task queue is used to manage long-running operations like video rendering and video trimming.
Google Cloud Platform is used for long-term storage (similar to AWS S3) and to host the video renderer component which has some special requirements.
A large part of how we’ve been able to scale Instagram with very few engineers is by choosing simple, easy-to-understand solutions that we trust. (source)
The platform is broken up into the following logical services. Each service can be scaled horizontally based on usage.
This service provides the core backend API powering the Automagical platform (https://api.automagical.ai). It is a Koa webserver that exposes a REST API which is consumed by the frontend webapps. It is deployed with a single command via now.
This service provides an async task queue worker for rendering and processing other long-running tasks. It is the only service hosted on Google Cloud Platform instead of now because the renderer module requires more compute resources.
This service provides the core Automagical video webapp (https://app.automagical.ai) built with create-react-app where users create, edit, and render storyboards. It is deployed with a single command via now.
This service provides the Automagical marketing site (https://automagical.ai) built with create-react-app. It is deployed with a single command via now.
The platform also includes the following modules which encapsulate well-defined, core functionality.
This module is used by the backend queue task runner. It is a 2D renderer for converting Automagical storyboards into videos. It is built using Node.js, headless-opengl, and FFmpeg.
This module is used by the backend API service to generate summaries from html. It uses a variety of metrics, NLP, and machine learning techniques to generate quality extractive text summaries from source articles.
Once deployed, Automagical is designed to run with minimal maintenance. In the unlikely event of a server crash, the affected service automatically restarts and an error is logged with Google Cloud Error Reporting.
All environment secrets like Stripe access keys, database passwords, etc. are handled by local .env files which are deployed along with the code via now. The only thing a new developer has to do to be able to run and deploy the Automagical platform is gain access to the git monorepo and the accompanying private .env files.
Everything in engineering is a tradeoff && KISS rules all.
Automagical is a modern Node.js platform architected with care and a focus on simplicity. It’s broken up into several main services: backend API, backend queue, frontend webapp, and frontend marketing site. The core IP is broken into well-encapsulated components, namely the renderer module and the summarize module. Zeit’s extremely simple now service is used for one-command deployments, and all databases (mongodb and redis) are hosted by third-parties for ease of maintenance.
For more details or specific questions, feel free to reach us at [email protected].
If you liked this article, click the 👏 below, and share it with others so they can enjoy it as well.