Preconfigured boilerplate for building Node.js applications using Express & TypeScript, MySQL with Objection (ORM) and Knex.
Start building a Node.js server using SQL database and TypeScsipt in seconds ๐
Clone the repo, remove .git
folder (rm -rf .git
), install dependencies (yarn install
) and you're ready to go (yarn start
)
yarn start
- serves the app onlocalhost
in watch modeyarn run build
- builds the project, the out directory is/dist
yarn db:migrate
- updates the database with the latest migrations (an alias forknex migrate:latest
),yarn db:rb
- rollbacks last migrations (an alias forknex migrate:rollback
),yarn db:mc migration_name
- creates a new migration file namedmigration_name
(an alias forknex migrate:make
)
- TypeScript is here just to get modern ES6 features in Node, like
import/export
- request-promise-native - use
Promise
s in Node requests - express - watch (and interact) whatever you expect in the browesr rather than CLI
- nodemon - runs the server in watch mode (i.e. will rebuild each time the code has changed)
- knex - a query builder for PostgreSQL, MySQL and SQLite3
- mysql2 - MySql database client
- objection - ORM
- Use Knex migrations for creating database schemas
MIT