CLI Setup

This guide covers the installation of Nocto using CLI.

To install the Nocto, you need to have several prerequisites in place. Here's a list of all the essential pre-requisites for setting up and working on this project.

Prerequisites

1

System Requirements

  • Node.js: Make sure you have Node.js installed. The project uses npm, which comes with Node.js. Install Node.js from here.
  • NPM or Yarn: Since the project uses npm commands, ensure that npm is installed with Node.js. Alternatively, you can use Yarn if preferred.
node -v
npm -v

Installation

1

Create new project

First, use NPX to create a Nocto project. Run the command:

npx @rsc-labs/create-nocto-app <project-name>

Change the directory to the project folder:

cd <project-name>
2

Install Dependencies

Use npm or yarn to install all the required dependencies:

npm install

or

yarn install

This will install all the dependencies listed in the package.json file.

3

Install Medusa Backend

Required:

Nocto is the frontend application. To have it working properly, you need to also run Medusa Backend.

Start the Medusa backend. Install Medusa using documentation from here Medusa Installation.

4

Setup Medusa Backend

Before running Medusa, disable default admin - Medusa Admin Disabled.

Also, you need to setup CORS - by default Nocto will run on port 5173, so you need to this port to medusa-config.ts. For details about setting the CORS, see Medusa Config Docs. Because Nocto is the new admin, you care about http.authCors and http.adminCors.

5

Run Medusa Backend

Once you’ve made changes, run Medusa Backend, for instance in Development Mode

6

Run Nocto

When your Medusa Backend is running, you can now run the Nocto. Go to your Nocto project and just run:

npm dev

or

yarn dev

The app will be available at:

http://localhost:5173