Skip to content

katmel98/authdoc2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Authdoc2

(DEVELOPMENT IN PROGRESS ...)

This package represents an approach of a documentation system using Daux.io BUT allowing user management using the Auth0 utility.

Components and Requirements

  1. Auth0
  2. NodeJS (Javascript Runtime Framework)
  3. ExpressJS (Backend tool to integrate required info to allow the Auth0 integration)
  4. Angular2 (JS Framework to create the frontend)
  5. Daux.io (Markdown documentation server)
  6. MongoDB (as DBMS to store the users info to allow the correct redirection once loggedin)

Project Directory Structure

authdocs2  
+-- backend  
|   +-- app
|   |   +-- db
|   |   +-- models
|   |   |   +-- Users.js
|   |   +-- config.json
|   |   +-- config.json.EXAMPLE
|   +-- resources
|   |   +-- initdb.js
+-- frontend  
+-- node_modules
+-- .gitignore  
+-- LICENSE  
+-- package-lock.json  
+-- package.json  
+-- README.md  
+-- server.js  

The structure explanation:

  • backend: this directory contains any backend resource created for support the server.js script.
  • frontend: an Angular2+ project directory, contains all the code necessary to create the frontend to allow a loggedin user select any of the assigned documentation to his profile.
  • node_modules: support packages for the app
  • .gitignore: git file that configures what files will be ignored when upload data to repository.
  • LICENSE: this package is MIT licensed.
  • package-lock.json: nodejs locking file, it's required to lock the update process of the package.json file.
  • package.json: nodejs configuration file with information for manage dependencies and orchestation tasks.
  • README.md: documentation file.
  • server.js: software initialization script.

Installation Process

AUTH0

  1. Create an account in Auth0 service (could be a free one).

  2. Obtain the data required to allow the connection between the Auth0 service and Authdoc2:

    • AUTH0_DOMAIN
    • AUTH0_CLIENT_ID
    • AUTH0_CLIENT_SECRET
  3. It is required to create a SESSION_SECRET and configure the value as the param to identify the sessions between platforms. This value can be any random generated value.

AUTHDOC2

  1. Clone the project in your prefered directory:
    git clone https://github.com/katmel98/authdoc2.git
  2. Get into authdoc2 documentation directory:
    cd authdoc2
  3. Install all packages requirements:
    npm install
  4. Create a new config.json file from config.json.EXAMPLE:
    cp backend/app/config.json.EXAMPLE backend/app/config.json
  5. Configure the file following filling attributes with your desired values.

ANGULAR2+

  1. Install globally Angular-cli:
    npm install -g @angular/cli
  2. Get into frontend directory:
    cd frontend
  3. Install all Angular requirements:
    npm install
  4. Build the distribution directory:
    ng build

DAUX.IO

Daux.io is a documentation generator that uses a simple folder structure and Markdown files to create custom documentation on the fly. It helps you create great looking documentation in a developer friendly way.

It allows you to create a static content from Markdown documentation. You can generate n-number of documentations with this tool, it'll be necessary to take the static content into a predefined docs directory that will contains different packages docs in it and will be used as documentation's origin folder.

MONGODB

MongoDB is the DBMS selected to manage the user/documentation assignment. This database could be a localhost installation or a cloud installation. In order to use the database, a script "initdb.js" is provided.

  1. Execute the "initdb.js" script:
    node backend/resources/initdb.js

  2. Check data generated in your MongoDB instance.

  3. Create users and relations in User Collection, using the following structure:

    • name: (type: String) user email used as login username in the Auth0 service.

    • documentation: (type: Array) Object's array to identify all the documentations related to an user ...

      • Element: (type: Object)

        • name: (type: String) title to be used in order to identify the documentation.
        • url: (type: String) the independent route where the documentation resides in the documentation root directory.
        • group: (type: String) group name to be used in order to allow different documentations to be organized.
        • order: (type: Number) order to be used when creating a dropdown to allow the user select documentation to be read.
        • active: (type: Boolean) this parameter indicates if the documentation will be accesible to the user.

About

An application to manage documentations using Auth0, Daux.io, Express, Angular5 and MongoDB

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published