Before you begin, make sure you have the following installed:
Node.js
Node.js version 18.0 or above
If you see version numbers displayed for both commands, you’re ready to start building with Modelence!
You can create a new Modelence project using the create-modelence-app
command.
This command will create a new directory named my-app
with the necessary files and folders for your project.
The project structure for a Modelence app is as follows:
Client Files
client/index.html
The main layout for your application. You usually don’t need to edit this file.client/index.css
Global CSS styles, including Tailwind CSS configuration.client/index.tsx
Entry point for your React frontend where you initialize the client app.client/routes.ts
Define your client-side routes and their corresponding components.Server Files
server/app.ts
Server entry point where you configure your backend modules and start the server.Config Files
.modelence.env
Environment variables for your application (including API tokens for applications connected to Modelence Cloud)All client-side code goes in the src/client
directory, while server-side code belongs in src/server
.
Modelence uses a clear separation between client and server code to help maintain a clean architecture.
You can also use any other directories at the same level as src/client
and src/server
for shared code between client and server.
Install dependencies
Navigate to your project directory and install the required packages:
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).
View your application
If everything is set up correctly, you should see the Modelence new project home page in your browser.
Before you begin, make sure you have the following installed:
Node.js
Node.js version 18.0 or above
If you see version numbers displayed for both commands, you’re ready to start building with Modelence!
You can create a new Modelence project using the create-modelence-app
command.
This command will create a new directory named my-app
with the necessary files and folders for your project.
The project structure for a Modelence app is as follows:
Client Files
client/index.html
The main layout for your application. You usually don’t need to edit this file.client/index.css
Global CSS styles, including Tailwind CSS configuration.client/index.tsx
Entry point for your React frontend where you initialize the client app.client/routes.ts
Define your client-side routes and their corresponding components.Server Files
server/app.ts
Server entry point where you configure your backend modules and start the server.Config Files
.modelence.env
Environment variables for your application (including API tokens for applications connected to Modelence Cloud)All client-side code goes in the src/client
directory, while server-side code belongs in src/server
.
Modelence uses a clear separation between client and server code to help maintain a clean architecture.
You can also use any other directories at the same level as src/client
and src/server
for shared code between client and server.
Install dependencies
Navigate to your project directory and install the required packages:
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).
View your application
If everything is set up correctly, you should see the Modelence new project home page in your browser.