Skip to content

Elegant, Maintainable nodejs project file/directory structure along with powerful query builder KNEX and ORM.

Notifications You must be signed in to change notification settings

narayansharma91/node_quick_start_with_knex

Repository files navigation

Included features

  • Well structure of the files for a large project.
  • Configured database connection.
  • Exception Handling
  • Implemented powerful query builder knex
  • Implemented objection.js a powerful ORM package for knex.
  • Unit Test
  • Validation
  • Linter (eslint, prettier) for code guideline and increase the readability of the code.

Application File/Directory Structure


Application layer Architecture

alt text


Quick setup

  • Download and install npm from offical website if you don't have already (https://nodejs.org/en/)
  • Clone this project using below command.
git clone https://github.com/narayansharma91/node_quick_start_with_knex.git
  • Goto your project directory by command line.
cd node_quick_start_with_knex
  • Install dependency of project using given below command
npm install
  • Once dependency downloaded,
copy manually .env.example and rename with .env name
  • Configure your configuration based on your requirements on .env file(eg. port, database name, environment etc)

  • Install postgres/mysql database if you don't have already.

  • Migrate database schema (existing) using below command.

knex migrate:latest
  • Start project using below command.
npm start

Official website/url for different packages.




About

Elegant, Maintainable nodejs project file/directory structure along with powerful query builder KNEX and ORM.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published