Structure of a Nijor project

When you use the nijor create {appname} command, it creates a new directory named after your project. This page is intended to help you understand the use of each of these directories and files.

app directory

The app directory contains the index.html file for our website. It also contains another directory called assets which stores our css file and it also contains another directory called modules which contains the js files produced by the compiler.

src directory

The src directory is our main working directory. We generally don't need to touch the app directory.

src/components directory

This directory stores all the reusable Nijor components.

src/pages directory

This directory stores all the Nijor components which are to be used as pages during routing. Pages are just normal Nijor components which are used for routing, they behave normally as other Nijor components.

src/styles directory

This directory stores our global stylesheets.

src/images directory

This directory stores our images which can be imported into a Nijor component just like a Javascript file using ES6 imports.

src/App.js file

This file is the main entrypoint of our Nijor project.

src/App.nijor file

This file is like the index.html for Nijor. We still need to use the index.html file sometimes though. The template tag of App.nijor is like the body of the index.html file.

Nijor Configuration File

The nijor.config.json is a file which contains certain configurations for a Nijor project.
If you try to run the nijor build ,nijor compile ,nijor serve commands inside a Nijor project without this file, then the nijor-compiler won't work and will throw errors.