- - - -
- -
-
-
-

Documentation v1.0.0

-

We are constantly doing updates on the product and documentation, so please check the online version.

-
-
-
-
- -
-
-
-
-
-

Installation

-
    -
  1. You need Node.js (at least 10.x version) installed on your machine. If you don't have it, you should install it
  2. -
  3. Clone project from github or download an archive
  4. -
  5. cd to your downloaded Argon app
  6. -
  7. Install necessary dependencies:
  8. -
      -
    • Via node npm package manager - Run npm install on the project root
    • -
    • Via node yarn package manager - Run yarn install on the project root
    • -
    -
- -

Configuration for PostgreSQL database and Redis data structure store

- -
Via Docker
-
    -
  1. Install Docker on your machine
  2. -
  3. Run docker-compose up -d in a terminal on the project root. This will start 3 containers:
  4. -
      -
    • database(PostgreSQL) container;
    • -
    • redis container - required for session management;
    • -
    • haproxy container - required only for a staging/production setup;
    • -
    -
- -
Via another chosen solution.
-
    -
  1. Install your PostgreSQL database
  2. -
  3. Install your Redis server
  4. -
  5. Change connection configuration, from your root cd to env-files folder and change the following configurations with your own:
  6. -
-
    -
  • For Posgresql connection:
  • -
-
DATABASE_URL=http://127.0.0.1:5432
-                DATABASE_NAME=creativeTim
-                DATABASE_USER=creativeTim
-                DATABASE_PASSWORD=creativeTim
-              
-
    -
  • For Redis connection:
  • -
-
REDIS_HOST=localhost
-                REDIS_PORT=6379
-              
- -

Migrations and Seeds

-
    -
  1. For database tables structure, in project root run: npm knex migrate:latest or yarn knex migrate:latest if you are using yarn as the default package manager
  2. -
  3. To create a default user run: npm knex seed:run or yarn knex seed:run if you are using yarn as the default package manager
  4. -
- -

Run the application

-
    -
  1. For starting the application, the following script (defined in `package.json` under `scripts`) must be called
  2. -
      -
    • via npm: npm run start or npm run dev for starting the development environment, which has livereload enabled;
    • -
    • via yarn: yarn start or yarn dev for starting the development environment, which has livereload enabled
    • -
    -
- -

Usage

-

Register a user or login using admin@argon.com and secret and start testing the preset (make sure to run the migrations and seeders for these credentials to be available).

-

Besides the dashboard and the auth pages this preset also has an edit profile page. Keep in mind that all the features can be viewed once you login using the credentials provided above or by registering your own user.

-

Features

- -

For each feature code cd into features folder, and you will found a folder for each feature, mostly each folder contain:

-
    -
  • A routes.js file that usually contains GET and POST requests, for eg the profile router looks like this:
  • -
-
const { wrap } = require('async-middleware');
-
-                const requestBodyValidation = require('./commands/verify-request-body');
-                const updateUserInfo = require('./commands/update-user-info');
-
-                const { loadPage } = require('./commands/profile');
-
-                module.exports = (router, middlewares = []) => {
-                  router.get('/profile', middlewares.map(middleware => wrap(middleware)), wrap(loadPage));
-
-                  router.post('/update-profile-info', wrap(requestBodyValidation), wrap(updateUserInfo));
-
-                  return router;
-                };
-
-              
-
    -
  • A repository.js file that contains feature database queries
  • -
  • A commands folder where you can find the all feature functionality functions, for eg the one for login template rendering looks like this:
  • -
-
function loadPage(req, res) {
-                  debug('login:servePage', req, res);
-                  res.render('pages/login');
-                }
-              
-
    -
  • A constants.js file, to store all your static variables, for eg:
  • -
-
const USERNAME_PASSWORD_COMBINATION_ERROR = 'These credentials do not match our records.';
-                const INTERNAL_SERVER_ERROR = 'Something went wrong! Please try again.';
-                
-              
-

All feature routes are mounted in routes/index.js from the project root.

-

For the Front-end side:

- -
Templates
- -
    -
  • You can find all the templates in views folder where you will find:
  • -
-
    -
  1. The layout.ejs file, the main template layout.
  2. -
  3. A pages folder with all the pages templates
  4. -
  5. A partials folder with the common components for eg. header, footer, sidebar
  6. -
-

Change log

- -

Please see the changelog for more information on what has changed recently.

-

Credits

- - -

License

- -

MIT License.

-

Screen shots

- -

Argon Login

-

Argon Dashboard

-

Argon Users

-

Argon Profile

- -
-
-
-
- -
-