All Projects → jimmylee → Next Postgres Sequelize

jimmylee / Next Postgres Sequelize

Licence: mit
React 16.8.4 + NextJS 8.0.3 + Emotion + Sequelize 5/Postgres + Passport Local Auth + Google App Engine or Heroku Deployment

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Next Postgres Sequelize

Nextjs Pwa Graphql Sql Boilerplate
Next.js serverless PWA with GraphQL (Apollo) + Postgres SQL boilerplate
Stars: ✭ 125 (-28.98%)
Mutual labels:  heroku, postgres, nextjs
Vscodethemes
Preview themes from the VSCode marketplace.
Stars: ✭ 374 (+112.5%)
Mutual labels:  heroku, nextjs, emotion
Posthog
🦔 PostHog provides open-source product analytics that you can self-host.
Stars: ✭ 5,488 (+3018.18%)
Mutual labels:  heroku, postgres
Node Express Mongoose Demo
A simple demo app using node and mongodb for beginners
Stars: ✭ 4,976 (+2727.27%)
Mutual labels:  heroku, passport
Kohei.dev
🌎 A Production-level Single Page App with Server Side Rendering
Stars: ✭ 50 (-71.59%)
Mutual labels:  nextjs, emotion
Heroku Nextjs
⏩ Deploy Next.js universal web apps to Heroku
Stars: ✭ 323 (+83.52%)
Mutual labels:  heroku, nextjs
Core Nestjs
A simple application demonstrating the basic usage of permissions with NestJS (JWT, Passport, Facebook, Google+, User, Group, Permission)
Stars: ✭ 347 (+97.16%)
Mutual labels:  heroku, passport
Nextjs Sequelize
Next.js With Sequelize Web Application, a Full-Stack Web App Development Boilerplate. https://medium.com/@defrian.yarfi/next-js-with-sequelize-web-application-a-full-stack-web-development-a0051074e998
Stars: ✭ 21 (-88.07%)
Mutual labels:  sequelize, nextjs
snipcart-nextjs
Demo code for a Next.js e-commerce app powered by Snipcart
Stars: ✭ 116 (-34.09%)
Mutual labels:  heroku, nextjs
Lowmess.com
My personal portfolio website
Stars: ✭ 99 (-43.75%)
Mutual labels:  nextjs, emotion
React Next Boilerplate
🚀 A basis for reducing the configuration of your projects with nextJS, best development practices and popular libraries in the developer community.
Stars: ✭ 129 (-26.7%)
Mutual labels:  nextjs, emotion
heroku-nextjs-build
Heroku build adapter for Next.js (an npm module)
Stars: ✭ 12 (-93.18%)
Mutual labels:  heroku, nextjs
nest-js-boilerplate
Nest.js boilerplate
Stars: ✭ 79 (-55.11%)
Mutual labels:  heroku, passport
Koa2 Blog
第一个web项目,仿照cnode,欢迎新建账号试用
Stars: ✭ 141 (-19.89%)
Mutual labels:  heroku, sequelize
boilerplate
Fullstack boilerplate using Typescript, React, Node & GraphQL
Stars: ✭ 738 (+319.32%)
Mutual labels:  postgres, nextjs
Zws
Shorten URLs using invisible spaces.
Stars: ✭ 780 (+343.18%)
Mutual labels:  heroku, postgres
nodejs-with-postgres-api-example
k8s course example - node.js app with Postgres, Hapi.js and Swagger
Stars: ✭ 59 (-66.48%)
Mutual labels:  postgres, sequelize
nest-blog-api
Blog Web API with NestJs, Postgres, and Sequelize ORM
Stars: ✭ 69 (-60.8%)
Mutual labels:  postgres, sequelize
Placeline Nextjs
HyperTrack Placeline web application sample using NextJS, Ant-Design, Styled-Components, and Heroku
Stars: ✭ 88 (-50%)
Mutual labels:  heroku, nextjs
Next Dark Mode
🌑 Enable dark mode for Next.js apps
Stars: ✭ 133 (-24.43%)
Mutual labels:  nextjs, emotion

next-postgres

An example app with...

  • Posts
  • Comments
  • Authentication

With some nice qualities...

  • Full stack JavaScript
  • Server side rendering

And you can deploy it to...

Feel free to use without attribution!

Production Examples:

Preview:

Stack

Why is this useful? Why should I care?

  • Bad UX/UI so you are forced to make it your own!
  • Some "production ready" are concepts baked in for you.
  • You'll get server side rendering for free.
  • You can move a little faster at a competition or hackathon.

Setup: Prerequisites

I use Homebrew to manage dependencies.

  • Install Postgres: brew install postgres.
  • Install Node 10.7.0+: brew install node. (Or update your node)

Setup: Quick newbies guide to Postgres

  • On OSX, to run Postgres in a tab on the default port.
postgres -D /usr/local/var/postgres -p 5432
  • Postgres config is stored in ./config.js.
  • Local database: sampledb.
  • Username: test.
  • Password: test.
  • Please come up with something better in production.

First time Postgres instructions.

# Enter Postgres console
psql postgres

# Create a new user for yourself
CREATE ROLE yourname WITH LOGIN PASSWORD 'yourname';

# Allow yourself to create databases
ALTER ROLE yourname CREATEDB;

# Exit Postgres console
\q

# Log in as your new user.
psql postgres -U yourname

# Create a database named: sampledb.
# If you change this, update config.js
CREATE DATABASE sampledb;

# Give your self privileges
GRANT ALL PRIVILEGES ON DATABASE sampledb TO yourname;

# List all of your databases
\list

# Connect to your newly created DB as a test
\connect sampledb

# Exit Postgres console
\q

Newbie tip: I use an app called TablePlus for postgres.

Setup: Run locally

In the root directory run these commands:

npm install
npm install -g babel-cli
npm install -g sequelize-cli
sequelize db:migrate
npm run dev
  • Visit localhost:8000 in a browser to start development locally.
  • You will need postgres running.

Deploy Heroku

To deploy with Heroku, please follow the instructions here.

Deploy Google App Engine

Please set up Google App Engine and download the Google Cloud SDK so you can use gcloud from the command line.

You will need to add an app.yaml. It will look something like this:

runtime: nodejs
env: flex

manual_scaling:
  instances: 1

resources:
  cpu: 1
  memory_gb: 0.5
  disk_size_gb: 10

env_variables:
  NODE_ENV: production
  PRODUCTION_USERNAME: your-database-username
  PRODUCTION_PASSWORD: your-database-user-password
  PRODUCTION_DATABASE: your-database-name
  PRODUCTION_HOST: your-database-host
  PRODUCTION_PORT: your-database-port
  PRODUCTION_SECRET: your-secret

Be sure to read the documentation

Make sure you add app.yaml to the .gitignore. You don't want to commit this file into your Github repository.

Then run npm run deploy. This configuration will cost you ~$40 a month.

What happened to Zeit's Now service?

  • It is a great service.
  • Now 2.0 is about serverless everything
  • This example doesn't work with Now 2.0

Questions?

Feel free to slang any feels to @wwwjim.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].