Installation
Install global package
- npm
- Yarn
npm i -g @cairjs/cli
yarn i -g @cairjs/cli
# couldn't auto-convert command
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
- Yarn
npm install
yarn install
Start
- npm
- Yarn
npm run start
yarn 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
- Yarn
npm install --save @cairjs/core
yarn add @cairjs/core