Giter VIP home page Giter VIP logo

bekreno's Introduction

Krenovator LMS System (Open Source)

Introduction

Krenovator LMS (backend) is a collaborative learning platform.

Documentation

System Requirements

Installation

  1. git clone
  2. npm ci

Back to top

Configuration File

  1. Create a file name .env file in root folder
  2. Copy the syntax from .env-example to .env and enter the information as below:
Key Description Example value
NODE_ENV General code environment production or development
TOKEN_SECRET JWT hasing salt mylocal
TOKEN_VALIDITY JWT Expiration in milliseconds 21600
MYSQL_HOST Path to MYSQL instance localhost
MYSQL_DB Name of the DB obkreno
MYSQL_USERNAME username root
MYSQL_PASSWORD password
SMTP_HOST Handle outgoing email SMTP [email protected]
SMTP_SECURE Handle outgoing email SMTP true @ false
SMTP_PORT Handle outgoing email SMTP 465
SMTP_USERNAME Handle outgoing email SMTP
SMTP_PASSWORD Handle outgoing email SMTP
OTP_ENABLE Enable OTP (one-time-password) login 0 or 1
SMS_URL If OTP_ENABLE=1, SMS provider detail (optional)
SMS_API If OTP_ENABLE=1, SMS Api Key (optional)
SMS_TAG If OTP_ENABLE=1, SMS Tag (optional)
OTP_SECRET If OTP_ENABLE=1, OTP code generation secret (optional)
OTP_VALIDITY Define how long the token will be valid in milliseconds
ONESIGNAL_APPID Optional, OneSignal
ONESIGNAL_APPKEY Optional, OneSignal
STORAGE_PROVIDER Optional, Storage aws
STORAGE_PROVIDER_KEY_ID Optional, Storage
STORAGE_PROVIDER_KEY Optional, Storage
STORAGE CONTAINER Optional, Storage

Database

Database: MySQL

The model is built with SQL-query in mind. To change it, u need to update the datasource.

Back to top

Database Migration

Database migration is a process to migrate models to database tables or collections. When a migration is finished, the dataset in the source databases resides in target databases.

Auto-migration helps the user create relational database schemas based on definitions of their models together with their relation.

Reference https://loopback.io/doc/en/lb4/Database-migrations.html

Create a new migration

  1. Create models
  2. Create repository
  3. Add model in migrate.ts

Run migration

npm run build
npm run migrate

Back to top

File Storage

To reduce system complexity, the framework use cloud-based storage.

Reference Loopback-storage-components

Using Cloud provider (AWS)

  1. Go to file.datasource.ts, and change code for const config to below
const config = {
  name: 'File',
  connector: 'loopback-component-storage',
  provider: 'aws',
  key: <AWS_KEY>,
  keyId: <AWS_KEY_PROVIDER>,
  nameConflict: 'makeUnique',
  makeUnique: true,
};

To get AWS_KEY you'll will need to register and go to AWS Console

Using Filesystem

To change to to local storage follow step belows:

  1. In root, create a new folder named storage
  2. Change directory inside ./storage and create another folder name similar as STORAGE CONTAINER
  3. Go to file.datasource.ts, and change code for const config to below
const config = {
  name: 'File',
  connector: 'loopback-component-storage',
  provider: 'filesystem',
  root: './storage',
};
  1. Run application

Back to top

bekreno's People

Contributors

iqbalbaharum avatar ahmadshah avatar kautsarh avatar arexxa avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.