You can either continue using your Modelence project as it is, or connect it to Modelence Cloud.
We’ve built Modelence Cloud to seamlessly host and monitor Modelence applications, and it’s designed for both scalable production apps as well as local development environments. By connecting your local project, you can use a free remote MongoDB database without having to set up your own, and you will also get access to logs, metrics and performance insights of your locally running application.
If you want to skip this for now, feel free to ignore the “Connecting to Modelence Cloud” section below and continue with the MongoDB setup section.
Create a Modelence Account
First, you need to create a free Modelence account by going to Modelence Cloud.
Create an Application
After you’ve logged in, create a new application and name it after your project. Later, you can create production, local development and other environments (e.g. staging) for the same application.
Create an Environment
After you’ve created an application, create a new environment.
Name your environment so it can uniquely identify your local development environment,
e.g. dev-YourName
rather than just dev
(unless you’re sure there won’t be anyone else working on the same project later).
Connect Your Project
After you’ve created a new environment, you will be redirected to the environment’s dashboard and should see a setup card with a Go to Setup
button, redirecting you to your environment’s Setup page.
In this page, you’ll see a Setup Local Environment
button,
which will show commands for either creating a new project or connecting an existing one.
Since you’ve already created a project, go with Connect Existing Modelence Project
and copy the corresponding shell command displayed in the popup.
Once you run this command in your project’s root directory, it will automatically create a .modelence.env
file with the necessary environment variables.
Restart Your Development Server
Stop and restart your npm run dev
command after this step.
Now, if everything is set up correctly, you should see your environment status go from inactive
to active
in the Modelence Cloud dashboard.
If you’ve connected your local project to Modelence Cloud, as described in the section above, no more setup is needed - you are automatically set up with a MongoDB database that is included with your remote environment and can skip this section.
If you skipped the Modelence Cloud setup, the easiest way to set up MongoDB is to use the MongoDB Atlas free tier. While you can set up your own local MongoDB instance, we recommend Atlas because it eliminates the need for local installation and provides cloud storage for your development data, protecting it from local environment issues or data loss.
Create an Atlas Account
For more detailed instructions, you can refer to the MongoDB Atlas documentation
Create a Free Cluster
Set up Database Access
For more detailed instructions, you can refer to the MongoDB user setup guide
Configure Network Access
For more detailed instructions, you can refer to the MongoDB network access guide
Get Your Connection String
<username>
and <password>
in the string with your database user’s username and passwordtest
), so it looks like this:For more detailed instructions, you can refer to the MongoDB connection string guide
Do not load sample data into your newly created database if prompted - Modelence already provisions what you need and will work perfectly with an empty database on the first run.
Without the Modelence Cloud setup, you need to manually add your database configuration.
Once you have your connection string, you’ll need to add it to your Modelence environment variables. Create a .modelence.env
file in your project root (if it doesn’t exist already) and add:
Make sure that your .modelence.env
file is added to your .gitignore
to keep your credentials secure.
Learn how to build with Modelence’s backend framework
Explore advanced Modelence features and best practices
You can either continue using your Modelence project as it is, or connect it to Modelence Cloud.
We’ve built Modelence Cloud to seamlessly host and monitor Modelence applications, and it’s designed for both scalable production apps as well as local development environments. By connecting your local project, you can use a free remote MongoDB database without having to set up your own, and you will also get access to logs, metrics and performance insights of your locally running application.
If you want to skip this for now, feel free to ignore the “Connecting to Modelence Cloud” section below and continue with the MongoDB setup section.
Create a Modelence Account
First, you need to create a free Modelence account by going to Modelence Cloud.
Create an Application
After you’ve logged in, create a new application and name it after your project. Later, you can create production, local development and other environments (e.g. staging) for the same application.
Create an Environment
After you’ve created an application, create a new environment.
Name your environment so it can uniquely identify your local development environment,
e.g. dev-YourName
rather than just dev
(unless you’re sure there won’t be anyone else working on the same project later).
Connect Your Project
After you’ve created a new environment, you will be redirected to the environment’s dashboard and should see a setup card with a Go to Setup
button, redirecting you to your environment’s Setup page.
In this page, you’ll see a Setup Local Environment
button,
which will show commands for either creating a new project or connecting an existing one.
Since you’ve already created a project, go with Connect Existing Modelence Project
and copy the corresponding shell command displayed in the popup.
Once you run this command in your project’s root directory, it will automatically create a .modelence.env
file with the necessary environment variables.
Restart Your Development Server
Stop and restart your npm run dev
command after this step.
Now, if everything is set up correctly, you should see your environment status go from inactive
to active
in the Modelence Cloud dashboard.
If you’ve connected your local project to Modelence Cloud, as described in the section above, no more setup is needed - you are automatically set up with a MongoDB database that is included with your remote environment and can skip this section.
If you skipped the Modelence Cloud setup, the easiest way to set up MongoDB is to use the MongoDB Atlas free tier. While you can set up your own local MongoDB instance, we recommend Atlas because it eliminates the need for local installation and provides cloud storage for your development data, protecting it from local environment issues or data loss.
Create an Atlas Account
For more detailed instructions, you can refer to the MongoDB Atlas documentation
Create a Free Cluster
Set up Database Access
For more detailed instructions, you can refer to the MongoDB user setup guide
Configure Network Access
For more detailed instructions, you can refer to the MongoDB network access guide
Get Your Connection String
<username>
and <password>
in the string with your database user’s username and passwordtest
), so it looks like this:For more detailed instructions, you can refer to the MongoDB connection string guide
Do not load sample data into your newly created database if prompted - Modelence already provisions what you need and will work perfectly with an empty database on the first run.
Without the Modelence Cloud setup, you need to manually add your database configuration.
Once you have your connection string, you’ll need to add it to your Modelence environment variables. Create a .modelence.env
file in your project root (if it doesn’t exist already) and add:
Make sure that your .modelence.env
file is added to your .gitignore
to keep your credentials secure.
Learn how to build with Modelence’s backend framework
Explore advanced Modelence features and best practices