Prerequisites
Before you begin, make sure you have the following installed:Node.js
Node.js
Node.js version 18.0 or aboveIf you see version numbers displayed for both commands, you’re ready to start building with Modelence!
- When installing Node.js, make sure to check all checkboxes related to dependencies
- Node.js installation includes NPM (Node Package Manager) which is required
- You can verify your installation by running:
Creating a new project
You can create a new Modelence project using thecreate-modelence-app command.
my-app with the necessary files and folders for your project.
Project structure
The project structure for a Modelence app is as follows:Client Files
Client Files
client/index.htmlThe main layout for your application. You usually don’t need to edit this file.client/index.cssGlobal CSS styles, including Tailwind CSS configuration.client/index.tsxEntry point for your React frontend where you initialize the client app.client/routes.tsDefine your client-side routes and their corresponding components.
Server Files
Server Files
server/app.tsServer entry point where you configure your backend modules and start the server.
Config Files
Config Files
.modelence.envEnvironment variables for your application (including API tokens for applications connected to Modelence Cloud)
Start your application
1
Install dependencies
Navigate to your project directory and install the required packages:
2
Run the development server
Start the development server:The
npm run dev command builds your website locally and serves it through a Vite development server,
ready for you to view at http://localhost:3000/ (or the port you specified in the .env file).3
View your application
If everything is set up correctly, you should see the Modelence new project home page in your browser.