(DEVELOPMENT IN PROGRESS ...)
This package represents an approach of a documentation system using Daux.io BUT allowing user management using the Auth0 utility.
- Auth0
- NodeJS (Javascript Runtime Framework)
- ExpressJS (Backend tool to integrate required info to allow the Auth0 integration)
- Angular2 (JS Framework to create the frontend)
- Daux.io (Markdown documentation server)
- MongoDB (as DBMS to store the users info to allow the correct redirection once loggedin)
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.
-
Create an account in Auth0 service (could be a free one).
-
Obtain the data required to allow the connection between the Auth0 service and Authdoc2:
- AUTH0_DOMAIN
- AUTH0_CLIENT_ID
- AUTH0_CLIENT_SECRET
-
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.
- Clone the project in your prefered directory:
git clone https://github.com/katmel98/authdoc2.git
- Get into authdoc2 documentation directory:
cd authdoc2
- Install all packages requirements:
npm install
- Create a new config.json file from config.json.EXAMPLE:
cp backend/app/config.json.EXAMPLE backend/app/config.json
- Configure the file following filling attributes with your desired values.
- Install globally Angular-cli:
npm install -g @angular/cli
- Get into frontend directory:
cd frontend
- Install all Angular requirements:
npm install
- Build the distribution directory:
ng build
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 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.
-
Execute the "initdb.js" script:
node backend/resources/initdb.js
-
Check data generated in your MongoDB instance.
-
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.
-
-