gentool

0.2.0 • Public • Published

Gen Tool Starter

GitHub version npm version GitHub license

Description

Tool creates basic structure for new project.

For now supports only TypeScript.

Plans for future:

  • Provide templates in JavaScript
  • Provide ability to choose React for client-side projects (with / without Redux)
  • Adding PostgreSQL / MySQL database options for server templates
  • Add AWS sign-in template

Usage

With installation

# Install globally 
npm i -g gentool
 
# Use 
gentool

Without installation

npx gentool

Variants

Server Templates

Creates basic server.

Options:

  • Redis
  • Database (For now only MongoDB)
  • Docker

Structure for basic server:

├── src
│   ├── server
│   │   ├── controllers
│   │ │   └── index.ts
│   │   ├── interfaces
│   │ │   ├── IMsg.ts
│   │ │   └── index.ts
│   │   ├── middlewares
│   │ │   ├── checkMethod.ts
│   │ │   ├── index.ts
│   │ │   ├── parseRequest.ts
│   │ │   └── setHeaders.ts
│   │   ├── models
│   │ │   └── index.ts
│   │   ├── routes
│   │ │   ├── error.ts
│   │ │   ├── health.ts
│   │ │   ├── index.ts
│   │ │   └── info.ts
│   │   ├── services
│   │ │   ├── DocsApiService.ts
│   │ │   ├── Helpers.ts
│   │ │   ├── index.ts
│   │ │   ├── LoggerService.ts
│   │ │   ├── RequestContextService.ts
│   │ │   └── ResponseService.ts
│   │   ├── utils
│   │ │   ├── config.ts
│   │ │   ├── constants.ts
│   │ │   ├── health.html
│   │ │   ├── swagger.ts
│   │ │   ├── swaggerHelpers.ts
│   │ │   └── routes.ts
│   │ └── index.ts
│   ├── .env
│   ├── nodemon.json
│   ├── package.json
│   ├── tsconfig.json
│   └── tslint.json
├── README.md
├── .editorconfig
└── .gitignore

For RedisDB option there is also:

  • CacheService.ts (set, get, del, getAll, clear dbs) + Interface
  • Cache API
  • Swagger Docs for Cache API

For Database (MongoDB) option there is also:

  • LoggerService saves loges to the MongoDB Logs collection + Interface
  • Logs Model + Logs controller (Read, Delete) + Interfaces
  • MongoDB connection controller (Set up / close connection, Error handling)
  • Logs API
  • Swagger Docs for Logs API

For Docker option there is also:

  • .dockerignore
  • Dockerfile for server
  • docker-compose.yml (If RedisDB or MongoDB options - also adds them into docker-compose)

Client Templates

For now there is only one template for Angular 8.

Template angular-starter:

Options: Material Design. Dashboard with auth, loader, snackbars, breadcrumbs & nav

Structure for app directory:

├── src
│   ├── components
│   │   ├── card
│   │   ├── loader
│   │   └── index.ts
│   ├── interfaces
│   │ └── index.ts
│   ├── pages
│   │   ├── dashboard
│   │   ├── home
│   │   ├── login
│   │   ├── logout
│   │   ├── not-found
│   │   ├── offline
│   │   ├── settings
│   │   └── index.ts
│   ├── services
│   │   ├── tests
│   │   ├── alert.service.ts
│   │   ├── auth.service.ts
│   │   ├── cookies.service.ts
│   │   ├── helpers.service.ts
│   │   ├── index.ts
│   │   ├── loader.service.ts
│   │   └── user.service.ts
│   ├── utils
│   │ ├── config.ts
│   │ ├── constants.ts
│   │ ├── routes.ts
│   │ └── variables.sass
├── app-routing.module.ts
├── app.component.html
├── app.component.sass
├── app.component.spec.ts
├── app.component.ts
└── app.module.ts

Fullstack (client + server) Templates

For now there is only one template for Widget

Template widget-starter:

Stack:

  • Angular 8 ( + Material Design)
  • Node + Express
  • RedisDB

Structure:

├── src
│   ├── client (without routing. Just App component + header + loader + some services for getting data from server API)
│   ├── server (basic server + RedisDB structure)
│   ├── .dockerignore
│   ├── .env
│   ├── docker-compose.yml
│   ├── Dockerfile
│   ├── env.ts (Parse .env for client-side usage)
│   ├── nodemon.json
│   ├── package.json
│   ├── tsconfig.json
│   └── tslint.json
├── README.md
├── .editorconfig
└── .gitignore

License

This project is licensed under the terms of the MIT license.

Package Sidebar

Install

npm i gentool

Weekly Downloads

0

Version

0.2.0

License

MIT

Unpacked Size

3.9 MB

Total Files

347

Last publish

Collaborators

  • mopc