Skip to main content
Version: v2.x.x

Setup

What You'll Learn
  • How to setup a Cortex project in few minutes

Packages installation

  yarn add @azot-dev/cortex

Automatic installation of the template

In the folder you want to instantiate cortex (inside your React project, maybe in src) It will install a basic template of the Cortex structure, you can then modify it as you wish

npx @azot-dev/cortex@latest init react

The structure installed with the above command line

├── cortex
│ ├── dependencies
│ │ └── _dependencies.ts
│ ├── services
│ │ ├── _services.ts
│ │ ├── counter.service.ts
│ │ └── logger.service.ts
│ └── setup
│ ├── base.service.ts
│ └── setup.ts

Then wrap your root component with the Cortex provider:

const App = () => {
return (
<CortexProvider core={createCore()}>
<App />
</CortexProvider>
);
};