Setup
What You'll Learn
- How to setup a Cortex project in few minutes
Packages installation
- yarn
- npm
- pnpm
yarn add @azot-dev/cortex
npm i @azot-dev/cortex
pnpm i @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>
);
};