Skip to content

Repository of using Sequelize with Next JS in Typescript... mostly

Notifications You must be signed in to change notification settings

steveninouye/ts-next-sequelize-example

Repository files navigation

Next JS App using Typescript, Sequelize, Sequelize CLI, and PostgreSQL Example

It took me a week to figure out how to add Sequelize to my Next JS app so I wanted to share my approach so others can steal the pattern as well as welcome feedback.

The commit history is well documented in sections of the project

Installation

  1. Create a .env file with the following values
// .env

DB_HOST=localhost
DB_USERNAME=root
DB_PASSWORD=
DB_NAME=ts_next_sequelize_example
DB_PORT=5432
  1. Run the following commands
# Install node packages
$ npm install
# Create the database
$ npm run db:create
# Run the migrations that will create the tables
$ npm run db:migrate
# Run the seed
$ npm run db:seed

Development

  1. Run the command
$ npm run dev
  1. Visit http://localhost:3000

About

Repository of using Sequelize with Next JS in Typescript... mostly

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published