Skip to main content

Installation

Install global package

npm i -g @cairjs/cli

Create new project

Syntax

cairjs new <name>

Example

cairjs new myproject

Or use alternative method:

git clone https://github.com/cairjs/javascript-graphql-starter.git myproject
info

If you use the alternative method you will have to clean the .git folder in myproject

Start example project

Change directory

cd myproject

Copy environment variables

cp .env.example .env

Install dependencies

npm install

Start

npm run start

Description of the example project structure

This project will contain the following example structure:

src
├── components
│ ├── ComponentA
│ │ ├── infraestructure
│ │ ├── application
│ │ └── model
│ └── ComponentB
│ ├── infraestructure
│ ├── application
│ └── model
├── modules
│ ├── graphql
│ ├── http
│ └── models
└── index.ts

Description folders:

  • src: Source code.
    • components:.
      • ComponentA: .
        • infraestructure: Interface adapters.
        • application: Application Rules.
        • model: Business Rules.
    • modules:.
      • graphql:.
      • http:.
      • models:.

Install only Core

You can also create something completely from scratch using only what you need with:

npm install --save @cairjs/core