Structure of Folders in a Meteor Application

Meteor folders

Some folders are important to Meteor and serve specific purposes. Listed below are some of these Meteor folders.

The server folder

The code in the files in this folder only executes on the server.

The client folder

The code contained in a client folder runs only on the client.

The imports folder

The complete application code should be placed inside the imports folder, which is a top-level folder in our project. In this folder, our files are lazily loaded on demand into our application.

The startup folder

The code in the startup folder runs when the application is starting up. It can contain both server and client folders nested inside it.

The public folder

This folder can contain assets used on the client such as images, favicon.ico, or robots.txt.

The private folder

This folder can contain assets that are only available on the server. These files are available through the Assets API.

The package.json file

Though not a folder, the package.json is a special file in a Node project. It’s usually found at the root of a project and used mainly to store package names (dependencies) that need to be installed in the project before running.

It also consists of a script section that can be configured to start the application. The sample package.json has a start key nested inside the script object. That start key is configured to start our application. We can start the application by running npm start. This references the start key inside the script section.

The application name is stored in the name property of the package.json file. Look at the widget below to see the structure of the package.json file and its content:

Get hands-on with 1200+ tech skills courses.