Giter Club home page Giter Club logo

api-postgres-node-express-sequelize's Introduction

api-pen

CircleCI Maintainability Test Coverage License: MIT

A PENS (Postgres, Express, Node and Sequelize ORM) API template for building API application. It allows you to start developing your application without the stress of basic setup.

tools

babel, eslint, airbnb javascript style guide, code-climate, circle-ci, sequelize, express, node, postgres, dotenv, jest

Basic setup already done for you

  • Sequelize setup
  • Dotenv for storing secret environment variables
  • MIT License
  • Code-Climate setup
  • Circle CI setup
  • Jest testing setup
  • Eslint Setup
  • Editor Configuration setup
  • GitIgnore file
  • Babel configuration for using latest JavaScript features
  • Code of Conduct file for Open Source project

Usage

  • clone it git clone [email protected]:onwuvic/api-postgres-node-express-sequelize.git or use the template generator.
  • npm install
  • rename .env.sample to .env and populate the required parameters

Code Climate and Circle-CI Settings

  • add your repo to code-climate and circle-ci
  • copy your code-climate Test Reporter ID from code-climate
  • create environment variable on your Circle-CI as name: CC_TEST_REPORTER_ID, key: your_code_climate_test_reporter_id

Package.json Scripts and usage

npm run [name_of_the_script]

  • test: This is used to run your tests.
  • dev: This is used to run your application on development (development mode).
  • start: This is used to run your application on production (production mode). It set the environment to production then run the build and serve script respectively.
  • serve: This is used to run your es5 transpiled application code in the dist folder.
  • lint: This is used to lint your codebase to ensure it adhere to airbnb standard.
  • lint:fix : This is used to auto fix the lint issues on your codebase.
  • db:seed : This is used to run sequelize seed operation.
  • db:migrate : This is used to run sequelize migrate operation.
  • db:rollback : This is used to run sequelize rollback operation.
  • db:rollmigrate : This is used to run db:rollback, db:migrate sequentially.
  • db:rollmigrateseed : This is used to run db:rollback, db:migrate, and db:seed sequentially.
  • clean: This is used to remove and recreate dist folder.
  • build-server: This is used transpile your ES6/7/8/9 code to ES5 into the dist folder.
  • build: This runs the clean and build-server scripts.

Optional

Sequelize configuration

if you like to customize the way your database folder (migrations, models and seeders) should be, delete the database folder and you can specify your structure in .sequelizerc and then run sequelize init.

eslint

You can configure your eslint in .eslintrc file

jest

By default we make used of jest for testing but you are free to make used of any testing suite like mocha etc.

api-postgres-node-express-sequelize's People

Contributors

onwuvic avatar

Stargazers

 avatar

Watchers

 avatar  avatar

api-postgres-node-express-sequelize's Issues

No .env file to store secrete credentials

env file for secrete credentials

When this project is generated the user have to do another heavy lifting of installing dotenv modules for env file. This can be added to reduce the stress from the user.

Sequelize initiation

After generating the project with js-templates-generator the following folder is not found under the database

  • seeders
  • migrations

The only what to do this, one has to install Sequelize globally. In order to reduce the extra step for the installation, a script can be added to the package.json file

"sequelize-init": "node_modules/.bin/sequelize init"

This can save the user extra installation.

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.