Installation
Requirements
Octo is based on TypeScript, allowing you to use it as either a NodeJS project or a TypeScript project. Before you get started, here are a few things you need to ensure are installed and configured properly.
Program | Description | Version |
---|---|---|
NodeJS | Octo requires a JavaScript based engine to run. There are several help articles available online, but we really love using nvm. | >= 18.x (Supported) >= 20.x (Recommended) |
aws-cli | Assuming you want to build the infrastructure on AWS, Octo requires access to AWS infrastructure. We recommend following aws official docs, or our aws setup guide. | >= 2.x (Recommended) |
Disclaimers
The docs only provide syntax for TypeScript, but of course Octo projects can be written in pure NodeJS. If you decide to use just NodeJS, it is up to you to translate all instructions accordingly.
Octo exclusively supports ESM modules, requiring "type": "module"
in package.json.
In this blog post, we explore using Octo with CJS modules.
Please translate all instructions accordingly.
New Project
Create a new directory
mkdir octo-starter-project
cd octo-starter-project
Create new files
Octo is a monorepo by design. This is to promote consolidation of all infrastructure in one codebase. To create a new repository, please create all files in below tabs.
- package.json
- tsconfig.json
{
"name": "octo-starter-project",
"private": true,
"scripts": {
"build": "rimraf dist && tsc -p tsconfig.json",
"start": "node dist/main.js"
},
"type": "module",
"version": "0.0.1"
}
{
"compilerOptions": {
"allowSyntheticDefaultImports": true,
"baseUrl": "./",
"declaration": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"forceConsistentCasingInFileNames": true,
"incremental": true,
"module": "Node16",
"moduleResolution": "Node16",
"noFallthroughCasesInSwitch": true,
"noImplicitAny": false,
"noImplicitOverride": true,
"outDir": "./dist",
"removeComments": true,
"skipLibCheck": true,
"sourceMap": true,
"strictBindCallApply": true,
"strictNullChecks": true,
"target": "ES2022",
"typeRoots": ["node_modules/@types"],
},
"exclude": ["dist", "node_modules"],
"include": ["**/*.json", "**/*.ts"]
}
Install libraries
npm install @quadnix/octo @quadnix/octo-aws-cdk @quadnix/octo-event-listeners --save-prod
npm install @types/node rimraf ts-loader ts-node tsconfig-paths typescript --save-dev
Summary
In this article, we explored how to set up Octo on your local machine. Next, we will create a "hello world" project to introduce you to Octo.