Newsletter
Join the Community
Subscribe to our newsletter for the latest news and updates
Full-stack Next.js 7 + Postgres boilerplate with TypeScript, Jest testing, and Zeit/Heroku deployment.

A full-stack Next.js TypeScript template focused on functionality over UI, featuring Zustand, TanStack Query, and ESLint 9 support.
next-postgres-with-typescript is a full-stack boilerplate that combines Next.js 7, React 16.4.2, Postgres, and Sequelize with TypeScript and Jest support for building server-rendered web applications. It is a fork of the next-postgres repo by @jimmylee, extended with provisional TypeScript types and a Jest/Enzyme test setup, while keeping the original stack of custom Express, Emotion CSS-in-JS, Passport local authentication, and Redux.
next-postgres-with-typescript is a production-ready starting point for a full-stack JavaScript application with posts, comments, and server-side rendering. It takes a Postgres database connection and your application code, and outputs a deployed web app that can run on Zeit (now) or Heroku, with local development served at localhost:8000. The template was created by forking the original next-postgres repository and is open for contributions to make it more type-safe.
The template follows a standard full-stack workflow: install dependencies and Postgres, configure the database in config.js, run Sequelize migrations, then start the development server with npm run dev. For production, you deploy to Heroku following HEROKU.md, or to Zeit using now, after setting production secrets for the database connection via now secrets.
The repo is open source and explicitly states the code can be used without attribution, so it is free to use for personal or commercial projects.
Several areas remain untyped: the IUser, IPost, and IComment interfaces are still defined as any, and files such as withData.js, _document.js, and the api directory have not yet been converted to TypeScript. Jest tests currently fail for components that need Redux Provider or Next Router context.
Yes, it includes Passport local authentication for username/password login, integrated with the Postgres database via Sequelize.
Deployment instructions are specifically provided for Zeit (now-cli) and Heroku. Since it uses Next.js and a custom Express server, other Node-compatible hosting platforms may work, but those two are officially documented.
