{"id":13517462,"url":"https://github.com/jimmylee/next-postgres-sequelize","last_synced_at":"2025-04-10T05:05:34.384Z","repository":{"id":37451581,"uuid":"88385139","full_name":"jimmylee/next-postgres-sequelize","owner":"jimmylee","description":"[OUTDATED] React 16.8.4 + NextJS 8.0.3 + Emotion + Sequelize 5/Postgres + Passport Local Auth + Google App Engine or Heroku Deployment","archived":false,"fork":false,"pushed_at":"2024-01-09T20:55:13.000Z","size":280,"stargazers_count":182,"open_issues_count":0,"forks_count":38,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-01T23:12:23.936Z","etag":null,"topics":["emotion","google-app-engine","heroku","nextjs","passport","postgres","react","redux","sequelize"],"latest_commit_sha":null,"homepage":"https://next-postgres.herokuapp.com/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jimmylee.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2017-04-16T02:01:20.000Z","updated_at":"2025-01-21T03:46:46.000Z","dependencies_parsed_at":"2024-01-13T19:26:50.015Z","dependency_job_id":"bace6366-40be-4d53-81df-221fff3aec19","html_url":"https://github.com/jimmylee/next-postgres-sequelize","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimmylee%2Fnext-postgres-sequelize","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimmylee%2Fnext-postgres-sequelize/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimmylee%2Fnext-postgres-sequelize/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimmylee%2Fnext-postgres-sequelize/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jimmylee","download_url":"https://codeload.github.com/jimmylee/next-postgres-sequelize/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248161280,"owners_count":21057554,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["emotion","google-app-engine","heroku","nextjs","passport","postgres","react","redux","sequelize"],"created_at":"2024-08-01T05:01:34.005Z","updated_at":"2025-04-10T05:05:34.348Z","avatar_url":"https://github.com/jimmylee.png","language":"JavaScript","readme":"## DEPRECATION NOTICE\n\nThis template is no longer up to date. For an updated template, either as a team or individually, we encourage you to explore our [latest template](https://github.com/internet-development/nextjs-sass-starter) produced by [INTDEV](https://internet.dev). Thank you for your interest in our work! \n\n# next-postgres\n\n\u003e **January 4th, 2022** ➝ _I recommend you use [www-react-postgres](https://github.com/jimmylee/www-react-postgres) instead because it does not have an `express` server or a need for `babel`, therefore the template has less dependencies. That means there will be less attention cost required._\n\nAn example app with...\n\n- Posts\n- Comments\n- Authentication\n\nWith some nice qualities...\n\n- Full stack JavaScript\n- Server side rendering\n\nAnd you can deploy it to...\n\n- [Google App Engine](https://cloud.google.com/appengine/)\n- [Heroku](https://github.com/jimmylee/next-postgres/blob/master/HEROKU.md)\n\nFeel free to use without attribution!\n\n#### Production Examples:\n\n- [Maurice Kenji Clarke](https://twitter.com/mauricekenji) used the setup to\n  create: [https://indvstry.io/](https://indvstry.io/)\n- [Parker Ruhstaller](https://github.com/pruhstal) used the setup to create:\n  [https://leafist.com/](https://leafist.com/)\n- [Jay Graber](https://twitter.com/arcalinea) used the setup to create: [https://happening.net](https://happening.net)\n- [Rich C Smith](https://twitter.com/richcsmith) is working on something wicked cool.\n- Maybe you?\n\n#### Preview:\n\n- [https://next-postgres.herokuapp.com/](https://next-postgres.herokuapp.com/)\n- ~[https://next-postgres.appspot.com/](https://next-postgres.appspot.com/)~ (disabled because of flexible instance cost)\n\n### Stack\n\n- [NextJS + Custom Express](https://github.com/zeit/next.js/)\n- [Emotion CSS-in-JS](https://github.com/emotion-js/emotion)\n- [Postgres](https://www.postgresql.org/)\n- [Sequelize: PostgresSQL ORM](http://docs.sequelizejs.com/)\n- [Passport for local authentication](http://passportjs.org/)\n- [Redux](http://redux.js.org/)\n- [Babel](https://babeljs.io/)\n\n### Why is this useful? Why should I care?\n\n- Bad UX/UI so you are forced to make it your own!\n- Some \"production ready\" are concepts baked in for you.\n- You'll get server side rendering for free.\n- You can move a little faster at a competition or hackathon.\n\n## Setup: Prerequisites\n\nI use [Homebrew](https://brew.sh/) to manage dependencies.\n\n- Install Postgres: `brew install postgres`.\n- Install [Node 10.7.0+](https://nodejs.org/en/): `brew install node`. (Or\n  update your node)\n\n## Setup: Quick newbies guide to Postgres\n\n- On OSX, to run Postgres in a tab on the default port.\n\n```sh\npostgres -D /usr/local/var/postgres -p 5432\n```\n\n- Postgres config is stored in `./config.js`.\n- Local database: `sampledb`.\n- Username: `test`.\n- Password: `test`.\n- Please come up with something better in production.\n\n### First time Postgres instructions.\n\n```sh\n# Enter Postgres console\npsql postgres\n\n# Create a new user for yourself\nCREATE ROLE yourname WITH LOGIN PASSWORD 'yourname';\n\n# Allow yourself to create databases\nALTER ROLE yourname CREATEDB;\n\n# Exit Postgres console\n\\q\n\n# Log in as your new user.\npsql postgres -U yourname\n\n# Create a database named: sampledb.\n# If you change this, update config.js\nCREATE DATABASE sampledb;\n\n# Give your self privileges\nGRANT ALL PRIVILEGES ON DATABASE sampledb TO yourname;\n\n# List all of your databases\n\\list\n\n# Connect to your newly created DB as a test\n\\connect sampledb\n\n# Exit Postgres console\n\\q\n```\n\nNewbie tip: I use an app called [TablePlus](https://tableplus.io/) for postgres.\n\n## Setup: Run locally\n\nIn the root directory run these commands:\n\n```sh\nnpm install\nnpm install -g babel-cli\nnpm install -g sequelize-cli\nsequelize db:migrate\nnpm run dev\n```\n\n- Visit `localhost:8000` in a browser to start development locally.\n- You will need postgres running.\n\n## Deploy Heroku\n\nTo deploy with Heroku, please follow the instructions\n[here](https://github.com/jimmylee/next-postgres/blob/master/HEROKU.md).\n\n## Deploy Google App Engine\n\nPlease set up [Google App Engine](https://cloud.google.com/appengine/) and\ndownload the `Google Cloud SDK` so you can use `gcloud` from the command line.\n\nYou will need to add an `app.yaml`. It will look something like this:\n\n```yaml\nruntime: nodejs\nenv: flex\n\nmanual_scaling:\n  instances: 1\n\nresources:\n  cpu: 1\n  memory_gb: 0.5\n  disk_size_gb: 10\n\nenv_variables:\n  NODE_ENV: production\n  PRODUCTION_USERNAME: your-database-username\n  PRODUCTION_PASSWORD: your-database-user-password\n  PRODUCTION_DATABASE: your-database-name\n  PRODUCTION_HOST: your-database-host\n  PRODUCTION_PORT: your-database-port\n  PRODUCTION_SECRET: your-secret\n```\n\nBe sure to read the\n[documentation](https://cloud.google.com/appengine/docs/flexible/custom-runtimes/configuring-your-app-with-app-yaml)\n\nMake sure you add `app.yaml` to the `.gitignore`. You don't want to commit this\nfile into your Github repository.\n\nThen run `npm run deploy`. This configuration will cost you ~\\$40 a month.\n\n## What happened to Zeit's Now service?\n\n- It is a great service.\n- Now 2.0 is about serverless everything\n- This example doesn't work with Now 2.0\n\n## Questions?\n\nFeel free to slang any feels to [@wwwjim](https://twitter.com/wwwjim).\n","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjimmylee%2Fnext-postgres-sequelize","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjimmylee%2Fnext-postgres-sequelize","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjimmylee%2Fnext-postgres-sequelize/lists"}