Skip to content

New project configuration

SerenaG edited this page Dec 28, 2014 · 1 revision

Back-end Configuration

For back-end configuration you have to edit the ./config.js file in the main directory of the application. Inside the file there are two section “development” and “production”, the application choose between the two by the enviroment the value of the variable NODE_ENV. In each of them you can set the following parameters:

  • webServer: an object that contains:

    • port: the server port (Integer);
    • static: the absolute path of the directory that contains the static files (String);
  • userDB: an object that contains:

    • url: the database url that the application use as users database (String);
  • usersPerPage: by default set to 5, indicates the number of users you want display for each page in the user table;

  • dataDB: an object that contains:

    • url: the database url that the application use as database (String);
  • smtp: the object that contais the smtp service configuration used by the Nodemailer library (https://github.com/andris9/Nodemailer).

  • resetPassword: contains reset password configuration:

    • tokenLife: expiration time in milliseconds of password reset (Integer);
    • link: the link to send for the reset password (String);
  • collectionPath: absolute path of the directory that contains DSL configuration files (String);

  • allowSignup: boolean value that indicates if user registration is possible (Boolean);

  • superAdmins: array of users that by default has to be set as superadmin. The application have to have at least one superAdmin (String).

Front-end configuration

For front-end configuration you have to edit the file:

./app/scripts/config.js

You can configure Angular constant. In particular:

  • debug: indicates if error messages should be shown in details (Boolean);

  • navBarCollections: indicates the number of Collections to display in navigation bar (Integer);

  • showSignup: indicates whether or not to show the user registration button. It's important remember to disable or re-enable the user registration feature even in the back end (Boolean);

  • reportLink: indicates the link to which the user can report bugs or issues (String).

Application structure

The application generated by the framework has the following files and folders:

  • ProjectName/: contains files that will be used as scaffold for the project;

  • ProjectName/collections/: contains the configuration files of the collection sample. By default it is the folder where the DSL files should be saved;

  • ProjectName/app/: contains the files of the AngularJS application used in the frontend;

  • ProjectName/app/scripts/: contains all the scripts related to the frontend application;

  • ProjectName/app/scripts/services/: contains the services files AngularJS used in frontend;

  • ProjectName/app/scripts/controllers/: contains AngularJS controllers files;

  • ProjectName/app/view/: contains the views of AngularJS;

  • ProjectName/app/style/: contains CSS files used by the application;

  • ProjectName/app/bower_components/: contains the library files used by the frontend application;

  • ProjectName/node_modules/: contains the library files used by the backend application.