/quicker-picker-upper

Template for quick NodeJS/TypeScript development

Primary LanguageTypeScript

quicker-picker-upper

Template for quick NodeJS prototyping and development

code style: prettier

Quick Start

  1. Instal NodeJS on your computer if you haven't done so already: https://nodejs.org/en/download/
  2. Click the "Use this template" button on GitHub, right of the "Clone or download" button and give your repository a name.
  3. Clone your new repository to your computer.
  4. cd into your repository's directory and install dependencies:
npm install
  1. That's it, you can start developing!
  • If you want your app to automatically restart upon file changes, run it with the following command:
    npm run dev

Why use it?

  • Has the things you'll need, less time setting up
    • Rolling sessions, connected to the database, with signed cookies
    • Simple, modular routing structure
    • Body and cookie parsers
  • Stop worrying about configuring a database
    • Uses Sequelize ORM.
    • Define your schema once and have it work with mysql, postgres, sqlite, or mariadb out of the box
    • The app will automatically create a sqlite3 database with the name app.db if you don't provide a database
  • Continuous integration.
    • Encourages unit-testing
    • GitHub workflow, with caching, already set up
    • Tests your code, in parallel on NodeJS 10.x and 12.x, as well as with every database type, on every commit or pull request
  • Prettier-ready
    • Automatically format your code with npm run prettier
    • Spend more time writing code and less time worrying about formatting
  • Production Ready
    • Creates clusters to distribute load across cpu cores
    • Instantly revives child processes if they die. Your entire app won't go offline if something crashes in production.
    • Pooling of database connections allows for quicker access to data
  • PaaS Ready (Platform as a Service)
    • Instantly deploy on Heroku or AWS Elastic Beanstalk with ease
    • Most configuration happens using environment variables

Databases

Define your schema using Sequelize CLI

Have a database already? You can use it with the app by setting the SEQUELIZE_URL environment varible. You can do this in a .env file like so:

SEQUELIZE_URL=mysql://user:password@localhost/my_db

Testing

Testing happens with the mocha and chai libraries. By default, mocha will look for tests inside of the test/ directory. You can alter the mocha configuration in the package.json file/