janelznic / easyadmin-core-old

Easy Admin System - CMS focused on easy use - Backend core with RESTful API using Node.js, TypeScript, NestJS, MySQL, Sequelize ORM

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

  _____                     _       _           _         ____            _                 
 | ____|__ _ ___ _   _     / \   __| |_ __ ___ (_)_ __   / ___| _   _ ___| |_ ___ _ __ ___  
 |  _| / _` / __| | | |   / _ \ / _` | '_ ` _ \| | '_ \  \___ \| | | / __| __/ _ \ '_ ` _ \ 
 | |__| (_| \__ \ |_| |  / ___ \ (_| | | | | | | | | | |  ___) | |_| \__ \ ||  __/ | | | | |
 |_____\__,_|___/\__, | /_/   \_\__,_|_| |_| |_|_|_| |_| |____/ \__, |___/\__\___|_| |_| |_|
                 |___/                                          |___/                       

easyadmin-core

  • Easy Admin System v4 - CMS focused on easy use
  • Version: 4.0
  • Backend core with RESTful API using Node.js, Express, TypeScript, MySQL, Sequelize ORM
  • Author & Maintainer: Jan Elznic – HomepageGithubGitLabLinkedIn

Table of Contents

Links

Documentation

Features

Getting Started

Prerequisites

  • You need to install MySQL server either on your local machine.
  • Create manually a new database (preferably with charset utf8mb4 and collation utf8mb4_unicode_ci).

Installation

  1. Clone git repository:

    git clone git@github.com:janelznic/easyadmin-core.git

  2. Go to repository directory easyadmin-core:

    cd easyadmin-core

  3. Prepare config file and import MySQL database files

    npm run prepare

  4. Install all the module dependencies:

    npm install or npm i

Start

  1. Start HTTP server with npm start
  2. Go to: http://localhost:3000/

Directory structure

├── LICENSE
├── README.md
├── bin
|  ├── _get_source_dir.sh
|  ├── backup_db.sh
|  └── install.sh
├── config
├── db
|  └── mysql
|     └── install
|        ├── data.sql
|        └── structure.sql
├── doc
|  └── users.md
├── nodemon-debug.json
├── nodemon.json
├── package-lock.json
├── package.json
├── package.json.bak
├── src
|  ├── app.module.ts
|  ├── config.ts
|  ├── consts
|  |  └── app.config.ts
|  ├── db
|  |  └── mysql
|  |     └── mysql.ts
|  ├── main.hmr.ts
|  ├── main.ts
├── test
|  ├── app.e2e-spec.ts
|  └── jest-e2e.json
├── tsconfig.json
├── tsconfig.spec.json
├── tslint.json
└── webpack.config.js

NPM Scripts

  • backup:db - Backup database structure and data into the file
  • build - Transpile TypeScript to ES2017
  • dev - Run the development server without transpile to ES2017
  • format - Prettier code formatter
  • lint - Lint your TS code
  • prepare - Prepare config file and import MySQL database files
  • reinstall - Reinstall
  • start - Run the transpiled application
  • structure - List contents of directories in tree-like format
  • test - Run unit tests
  • test:cov - Show unit tests coverage
  • test:e2e - Run e2e tests
  • test:watch - Watch all files and run unit tests when changes occured
  • uninstall - Uninstall (only node_modules, not MySQL DB)

Requests

Requests authentication is performed using HTTP bareer token in headers. The component temporarily retrieves a list of tokens from a constant provided by the SessionModule.

Request example using HTTP bareer token authentication

curl --header "Authorization: Bearer Ynzyo9YNn1OAQ19rak90hXCIQh3Mj12Q" http://localhost:3000/users/list-users/

Development

Recommendations

Contributing

Please use npm run lint command before every commit and fix all your errors and warnings!

Git Branches

  • master - Production, always stable
  • test - Test (to be merged with develop branch), RC versions only
  • develop - Development branch (always make feature branches from this)
  • hotfix/* - Hotfixes (to be merged with develop and test branch)
  • feature/* - Feature branches (to be merged with develop branch only)

IMPORTANT NOTE: Always make pull requests only from your feature branch to develop branch, NOT to master branch!

Development Environment

You can use built-in development server that will monitor for any changes in your source and automatically restart your server with monitoring for any changes in source code.

  1. Start development server with npm run dev
  2. Go to: http://localhost:3000/

API

Swagger

  • Swagger UI is available on http://localhost:3000/swagger/
  • How to authenticate: How to authenticate

License

MIT © Jan Elznic – HomepageGithubGitLabLinkedIn

About

Easy Admin System - CMS focused on easy use - Backend core with RESTful API using Node.js, TypeScript, NestJS, MySQL, Sequelize ORM

License:MIT License


Languages

Language:TypeScript 60.0%Language:Shell 33.8%Language:JavaScript 5.0%Language:TSQL 1.2%