4.2.3 • Published 5 years ago

generator-astro v4.2.3

Weekly downloads
6
License
MIT
Repository
github
Last release
5 years ago

Astro Generator

Yeoman generator for building RESTful APIs and microservices using Node.js, ExpressJS and Docker support, and fullstack service with ReactJS, Redux, and Redux Observable. Astro Generator was designed to be scalable on containerized environment like Kubernetes, and designed to be enterprise ready. The principle of the project structure is isolation, so multiple developers can work on the same project without high dependency.

Technology Stack Supported

  • ExpressJS project, with vanilla javascript, this is suitable for creating service only project.
  • ReactJS Fullstack Project, this is for creating web app using Server Side Rendering.

Client Features (Only for Fullstack)

Server Features

  • No transpilers, just vanilla javascript
  • ES2017 latest features like Async/Await
  • CORS enabled
  • Uses yarn
  • Express
  • Consistent coding styles with editorconfig
  • Docker support
  • Uses helmet to set some HTTP headers for security
  • Load environment variables from .env files with dotenv
  • Request validation with joi
  • Gzip compression with compression
  • Linting with eslint with eslint-config-astro
  • Tests with jest along with coverage
  • Git hooks with husky
  • Logging with winston, and winston-cloudwatch for production log stream
  • API documentation geratorion with apidoc
  • Monitoring with pm2
  • Startup boot tasks that can be used for data migrations or pre startup task runner.
  • ORM using Sequelize (optional) sequelize with docker-compose migrations
  • HTTP using axios with retry axios

Requirements

Getting Started

Install:

npm install -g yo generator-astro

Generate a new project:

yo astro

Choose your project, either service or fullstack

Client Side Generator

Generate a new component

yo astro:component

Upon creation on a component, a new component folder will be created on src/components, and entries will be injected on the following files:

  • src/client/ducks/routers.js
  • src/client/ducks/epics.js
  • src/client/ducks/reducers.js

Server Side Generator

Generate a new API:

yo astro:api

Generate a new middleware:

yo astro:middleware

Generate a new service:

yo astro:service

Generate a new utility:

yo astro:util

Generate a new boot task:

yo astro:boot

Set environment variables:

cp .env.example .env

Running Locally

yarn dev

Running in Production

yarn start

Lint

# lint code with ESLint
yarn lint

# try to fix ESLint errors
yarn lint:fix

# lint and watch for changes
yarn lint:watch

Sequelize Migrations (optional)

yarn db:migrate

# to undo the migration

yarn db:migrate:undo

Test

# run all tests with Jest with coverage
yarn test

# run unit tests
yarn test:unit

# run integration tests
yarn test:integration

# run all tests and watch for changes
yarn test:watch

Validate

# run lint and tests
yarn validate

Logs

# show logs in production
pm2 logs

Documentation

# generate and open api documentation
yarn docs

Docker

# run container locally
yarn docker:dev
or
docker-compose -f docker-compose.yml -f docker-compose.dev.yml up

# run container in production
yarn docker:prod
or
docker-compose -f docker-compose.yml -f docker-compose.prod.yml up

# run tests
yarn docker:test
or
docker-compose -f docker-compose.yml -f docker-compose.test.yml up

License

MIT License - Suhendra Ahmad

4.2.3

5 years ago

4.2.2

5 years ago

4.2.1

5 years ago

4.2.0

5 years ago

4.1.6

5 years ago

4.1.5

5 years ago

4.1.4

5 years ago

4.1.3

5 years ago

4.1.2

5 years ago

4.1.1

5 years ago

4.1.0

5 years ago

4.0.9

5 years ago

4.0.8

5 years ago

4.0.7

5 years ago

4.0.6

5 years ago

4.0.5

5 years ago

4.0.4

5 years ago

4.0.3

5 years ago

4.0.2

5 years ago

4.0.1

5 years ago

4.0.0

5 years ago

3.4.0

5 years ago

3.3.4

5 years ago

3.3.3

5 years ago

3.3.2

5 years ago

3.3.1

5 years ago

3.2.0

5 years ago

3.1.7

5 years ago

3.1.6

5 years ago

3.1.5

5 years ago

3.1.4

5 years ago

3.1.3

5 years ago

3.1.2

5 years ago

3.1.1

5 years ago

3.1.0

5 years ago

3.0.5

5 years ago

3.0.4

5 years ago

3.0.3

5 years ago

3.0.2

5 years ago

3.0.1

5 years ago

3.0.0

5 years ago

2.1.7

5 years ago

2.1.6

6 years ago

2.1.5

6 years ago

2.1.4

6 years ago

2.1.3

6 years ago

2.1.2

6 years ago

2.1.1

6 years ago

2.1.0

6 years ago

2.0.8

6 years ago

2.0.7

6 years ago

2.0.6

6 years ago

2.0.5

6 years ago

2.0.4

6 years ago

2.0.3

6 years ago

2.0.2

6 years ago

2.0.1

6 years ago

2.0.0

6 years ago

1.1.6

6 years ago

1.1.5

6 years ago

1.1.4

6 years ago

1.1.3

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

0.0.1

6 years ago