Setup

Meteor is a full-stack framework for building JavaScript applications. Its server-side code runs inside a Node.js container so in order to start your Meteor app in SourceLair you need to create a Node.js project with a MongoDB connected to it. When you create a Node.js project, SourceLair launches a Node.js container running nodemon that reloads your server on change.

Delete default files

Meteor starts with its own skeleton, so it's better to delete the default files that come with the Node.js project type in SourceLair. To delete everything except .git directory run the following command in your terminal:

$ rm -r !(.git) 2>/dev/null

Install Meteor

To install Meteor you have to run the following command from your fully featured terminal:

Configure the environment of your project

Configure server command

By default, your server runs the nodemon utility that monitor for any changes in your source and automatically restarts your server. In Meteor your server command should be meteorso you need to create a Procfile that configures this server command:

Install Modulus CLI

Set up Modulus workflow

After installing Modulus CLI you are able to use Modulus commands via SourceLair's terminal. Firstly, you need to login running the following command:

$ modulus login

and enter your Modulus credentials.

Then, you need to create a new Modulus application that you can push to. By running the following command you can create a project called app using the Meteor runtime in a 512MB servo:

$ modulus project create -r Meteor -s 512 app

Now, you have to set the ROOT_URL environment variable of our project to the project URL provided by Modulus, which is required by Meteor in production. To do this list your projects by running the following command in your terminal and copy the URL of the app project:

$ modulus project list

You can set the ROOT_URL environment variable by running the following command in the terminal:

Don't forget to replace "somerandomhex" with the result from the modulus mongo create meteor command that you run earlier (e.g. jello.modulusmongo.net:27017/qyw2ymOg).

Deploy

Now that you created and configured your project and your database, you are ready to start working on your Meteor app and deploy it to Modulus!

To do so use run the following command in your terminal:

$ modulus deploy --node-version 4

When this command end, you can check out your Modulus url and see your Meteor app in production.

Now every time you want to push something new to production, all you have to do is commit your changes and deploy to Modulus.

Extras - Tips to code faster

SourceLair provides you with some great features in order to help you develop faster your website being focused on the creative part of programming.

Auto-format

When you write your HTML, CSS or JS files, SourceLair's editor automatically place your cursor at the correct indentation level so that you don't have to worry about it. Although, when you break down your format you can select the number of lines you want to "auto-format" and press Shift + Tab.

Command Palette

Command Palette is a free text search tool which helps you use most of SourceLair's features really fast. You can open it by pressing Ctrl/Cmd + Shift + P.

Quickopen

Quickopen is a fast and time saving way to navigate through your filesystem in order to find and open any file you want using your keyboard.

You can open the Quickopen prompt using its shortcut Ctrl/Cmd + Shift + O.

Find in files

Find in files is a simple and easy way to search for something in your entire project at once, with quick file navigation from the results.

You can trigger the Find in files prompt using its shortcut Ctrl/Cmd + Shift + F.