Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibility to deploy to Render or any modern hosting #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

catrielmuller
Copy link

@catrielmuller catrielmuller commented Oct 24, 2023

  • Install bower deps after npm install
  • Run Script
  • Migrate DB connection to Env
  • Migrate Sequelize to v6
  • Upgrade all Dependencies

Tutorial

  • Create an account on https://render.com
  • Create a new PostgreSQL
    image
  • Copy the connection params from the dashboard
    image
  • the PGHOST is not only the hostname, you can copy this from the External Database URL
  • like dpg-ckrj31g5vl2c73fbi7u0-a.ohio-postgres.render.com
  • If you need run this on local you need add a .env file on you local folder with the following content:
PGHOST='XXXXXXXXXXXXXXXXXXXXXX'
PGDATABASE='XXXXXXXXXXXXXXXXXXXXXX'
PGUSER='XXXXXXXXXXXXXXXXXXXXXX'
PGPASSWORD='XXXXXXXXXXXXXXXXXXXXXX'

The values of each constant can be get on the Neon dashboard.

  • Install the dependencies
  • npm install
  • Run the migration script
  • node rebuild_tables.js
  • Upload the fixtures
  • node load_fixtures.js
  • you can run the project with npm run start
  • Create a new Web Service
    image
    image
    image
    image
    image
  • Configure the Script to install and run the project
    image
  • Will build and install the all npm and bower dependencies.
    image
  • Configure the env variables
    image
  • After change the env variables will be forced another deployment with the new configuration
    image
  • As soon finished the deployment you can enter to the URL:
    image
  • In my case: https://nahual-carrito-web.onrender.com/

🫂

- Run Script
- Migrate DB connection to Env
- Migrate Sequelize to v6
- Upgrade all Dependencies
@catrielmuller catrielmuller changed the title Compatibility to deploy to vercel Compatibility to deploy to Render or any modern hosting Oct 24, 2023
@catrielmuller
Copy link
Author

I discard the option to deploy in vercel because you need a serverless structure on the API and that will require a deep refactor of the API, this changes are minimal

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant