Takeoff is a toolkit for rapid development, allowing you to prototype web applications using it’s command line tool.
Installing takeoff is simple, via NPM.
npm install -g @takeoff/takeoff takeoff init <myenv> cd <myenv> takeoff start # This starts the default environment container in `envs/default`
To see how this all works, it’s all explained below.
Blueprints are repositories with some batteries included applications and configurations for containers. Takeoff uses these to build a full working environment in minutes. A blueprint generally contains a backend component, a frontend, a database and an ingress server.
Currently Takeoff only ships with the default blueprint (but it’s relativly easy to create new ones!) called takeoff-blueprint-basic and it provides:
node 8 API server powered by Hapi. Using
node 8 allows the use of
async/await to make code more readable. Included in the application is a User system for username/password login and basic user management, 2 levels (admin and user - and easily extendible). There is also a JSON Web Token (JWT) authentication system that gives you control over access to your API endpoints.
React Frontend with React Router V4, Redux and ReactStrap (Bootstrap 4). The frontend comes with a basic Dashboard layout and homepage. A login page with some basic validation allows you to log in (the default login is
admin/password Do not expect this to be a fully secure environment). Once logged in you have a basic user CRUD application to manage users, and a navigation bar that you can customise.
Disclaimer: If you build an app with this you wish you deploy, you are responsible for your own security.
A Postgres 9 database. Within the Hapi application, Sequelize is used as the database connection and ORM. Here we can use this to create migrations and seeds, as well as create simple or complex model types as you like. The postgres also comes with a simple configuration file.
A Nginx ingress server, by default running on
port 80 (which means you get http://localhost or http://
Under the hood is uses
docker-compose to minimise the hassle out of setting up frontend, backend and database servers (support for minikube is coming soon).
Using Docker volumes, the development files for the applications sit on your local computer file system, however the applications run within
docker and hot reload on changes. This means you can switch between your code and browser in seconds and see the changes and not have to worry about manually compiling before seeing your changes. On the server side this is accomplished with
nodemon and on the clientside with
webpack using hot reloading, so in most cases you don’t need to refresh the browser at all.
If you ever get disconnected from your docker sessions afer starting them up, you can type
takeoff start again and you will reconnect to see any log output.
Takeoff is designed to cut out those first few crucial hours where you are setting up your project environment, such as babel and webpack configurations, user authentication or even just selecting a framework. It’s perfect for hackdays, rapid prototypes, teaching new coders by having a pre-configured environment in just 4 simple commands.
It cut out the scary/annoying bit and gets right to the fun bit!
This software has some dependencies, and currently has only been fully tested on Linux using Docker Community Edition.
First install this, Once installed you will have the
docker-compose commands. You also need
node >= 8.4.0.
After installing, you will this folder structure in your Takeoff environment
-| |- blueprints/basic # The basic blueprint that Takeoff ships |- envs/default # The default environment installed |- env # Folders with the source code you can change |- api # This is the Hapi API Server |- app # This is the frontend app |- nginx # Nginx configuration |- db # Postgres DB config |- docker # This is where all the docker configurations are kept |- docker-compose.yml # The glue file for your services |- api # This is the Hapi API Server |- app # This is the frontend app |- nginx # Nginx configuration |- db # Postgres DB config
When you install a new blueprint, it is cached in the
blueprints folder; this way when you create a new environment below it uses your local copy. If you want to update a blueprint, for now go into the folder and type
git pull origin master. A command will be coming for this soon.
Unofficially there are two blueprints:
defaultenvironment in the
When you want to create a new environment you can type:
takeoff new <environment> takeoff start <environment>
This will start up your new named environment using the
basic blueprint. Make sure you have stopped any other environments running unless you have changed ingress port assignments.
There is also a Wordpress Blueprint, you can find out more about installing it via it’s documentation (it may currently be broken, and I want to make this into a more general PHP blueprint anyway).
Currently only Linux is fully tested and supported out the box, but support for other OS is coming (testers and contributors welcome!). There is a page for Windows Users to provide extra information in the quest to get it working.