Skip to content

Latest commit

 

History

History
82 lines (65 loc) · 1.31 KB

README.md

File metadata and controls

82 lines (65 loc) · 1.31 KB

🎉🎉 typescript-backend-starter 🎉🎉

Prerequisites:

  • nodejs
  • postgres

Make yourself home ☕

Initialize your workspace

$ npm run setup

optionally 🙂

$ npm run seed

And finally ✨

$ npm start

Libraries

  • 🕸 Interfacing – GraphQL
  • 🖥 Server – Fastify
  • 💾 DatabaseAccess – Knex
  • 🧪 Testing – Jest
  • 💻 Language – TypeScript

Environments (NODE_ENV)

  • Use 'development' or leave blank to use the dev environment
  • Use 'prod' to use the production environment

Knex 💾, your everyday cookbook 🧑‍🍳

Pass an env

$ npx knex migrate:latest --env envname

Seeding

  • Creating
$ npx knex seed:make name
  • Running
$ # by default runs all of em, you may specify
$ # a seed to run
$ npx knex seed:run [options]

Create a migration

  • Creating
$ npx knex migrate:make name
  • Running
# Run a single migration up
$ npx knex migrate:up 

# Run a single migration down
$ npx knex migrate:down

# Run all pending migrations
$ npx knex migrate:latest 

# Run back all the latest migrations
$ npx knex migrate:rollback

Know more by just running:

# All knex options
$ npx knex
# Docs about a command
$ npx knex help command