RESTful API and Serverless-ready (TBD) with Domain Driven Design
Domain driven design (DDD) is an approach to software design that values simplicity and modeling code as closely to the business domain as possible. This results in code that can be easily understood by the business and evolved as the needs of the business domain change.
By isolating domain code away from all other concerns of the system like infrastructure, security, transportation, serialization etc; the complexity of the system grows only as large as the complexity of the business or problem domain itself.
- uses Node.js > v8
- written using ES6
- uses NPM for package dependency management
- uses JavaScript Standard Style
- uses
sequelize
andsequelize-cli
as ORM and data migration tool - Filename convention are
camelCase
andkebab-case
.
Make sure you have npm
, and at least node v12.x
If you need database connectivity, PostgreSQL and MySQL is supported by default as it uses sequelize
as ORM.
- Clone the repository with
git clone --depth=1 https://github.com/ricomonster/node-ddd.git
- Install the dependencies with NPM. It is installed by default with Node.
- Install global dependencies Application Setup.
- Create the development and test Databases.
- Run database migrations and seed with
npm run db:migrate
. - Run the application in development mode with
npm run start:http
. - Access
http://localhost:<PORT>
and you're ready to go!
$ npm install -g standard # JavaScript Standard Style
$ npm install -g sequelize-cli # CLI for Sequelize
$ npm install -g pg mysql2 # Database
- Install either Postgres 12.4 or MySQL 5.x.
- Create an empty database according to your preference.
- Rename the .env and populate it with the correct credentials and settings of your preferred database.
This boilerplate is inspired from node-api-boilerplate