1.0.82 • Published 1 year ago

stackit-cli v1.0.82

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

Stackit-CLI

Contributors npm-package

About

The Stackit-CLI project is a Node.js command-line interface (CLI) tool for interacting with the Stackit templates.

The tool allows the creation, selection, and deployment of project backend and frontend with a standard configuration and the creation of cloud resources.

The project's main objective is to provide an easy and quick way to build internal projects for the Stackit group from the command line.

Built With

Frontend Technologies

Backend Technologies

Cloud Technologies

Next Redux Jest GoogleAnalytics

UI Frameworks

Tailwind MaterialUI Bootstrap

  • TypeScript
  • NestJs
  • NodeJS
  • Redis

  • Terraform

  • Amazon
  • Digital-Ocean
  • Azure

Getting Started

This is an example of how you may give instructions on setting up your project locally. To get a local copy up and running follow these simple example steps.

  1. Install

    npm i stackit-cli -g

    This package supports Node 10 and above

  2. Create a new project Once it’s finished, you will be able to create a new project by typing in your console/shell

    stackit-cli
  3. A prompt will appear on your terminal. Here you can select the stack and technologies you wish to implement in your project

    Note: You do not need to install everything at the start of your project. You can install certain modules using flag commands after a project is created.

  4. Install Yarn packages

    cd newProject
    cd nextjs or cd nestjs
    yarn install
  5. Enter your APIs in /terraform/variables.tf
    variable "API_KEY" {
       type        = string
       default     = ""
       description = "ENTER YOUR DESCRIPTION"
     }
  6. Enter your API in .env
    API_KEY = 'ENTER YOUR API'

Options

There are additional modules to implement with the Flags/Options:

  • -h, --help Provide the options available to you.

  • -r, --redis Implement redis in the project in your NestJS as an example mode in addition to adding the redis service in docker.

  • -g, --google-analytics <key> Integrate Google Analytics automatically into your NextJS.
  • -na, --next-auth Next Auth login module implementation to your NextJS.

  • -v, --version Provides the current version of Stackit CLI.

Run Example

Example .ENV local project

The env variables will depend on each project, this is a basic example.

# .env
$ DB_TYPE=postgres
$ DB_HOST=localhost
$ DB_PORT=5432
$ DB_USERNAME=postgres
$ DB_PASSWORD=postgres
$ DB_NAME=<yourdbname>
$ POSTGRES_SYNC=true
$ JWT_SECRET=TOP_SECRET_EXAMPLE
$ PGADMIN_DEFAULT_EMAIL=admin@admin.com
$ PGADMIN_DEFAULT_PASSWORD=admin
$ PGADMIN_LISTEN_PORT=80

# Terraform .env
$ AWS_ACCESS_KEY=""
$ AWS_SECRET_KEY=""

Running the app

# development
$ yarn start

# watch mode
$ yarn start:dev

# production mode
$ yarn start:prod

Test

# unit tests
$ yarn test

# e2e tests
$ yarn test:e2e

# test coverage
$ yarn test:cov

Naming Convention and Folder Structure

  • icons
      • Note: If it's an image that will be used on many sites, just add it to the root path with a dash-case. Otherwise, add a folder with the name of the page where it'll be used (in the dash-case case as well) and add it.
  • Hooks
  • ui
    • ui.slice.ts
  • store.ts

  • Globals css at the root path (using dash-case)

  • Add a folder with the page where the style will be used and the file inside (both of them with dash-case)

Contributing

Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request