Giter Site home page Giter Site logo

bionic-broccoli's Introduction

๐ŸŒฒ $~$ redwood-template-app

This is a template application using RedwoodJS. It establishes common patterns for creating an app quickly.


ย 

๐Ÿง‘โ€๐Ÿ’ป $~$ Additional Core Components

The following is a list of frameworks, utilities, libraries, components, etc... that have been added to the template to streamline the development experience.


ย 

โœจ $~$ Features

The following is a list of features this template has

  • /admin section that holds all crud operations for the application
    • /admin/roles CRUD operations for roles
    • /admin/users CRUD operations for users
    • /admin/teams CRUD operations for teams

ย 

๐Ÿงฑ $~$ Development Setup

Prerequisites


ย 

โšก๏ธ $~$ Quickstart

# install dependencies
yarn install

# setup .env
cp .env.example .env

# start dev server and database
# Your browser should automatically open to <http://localhost:8910>.
yarn dev

# (first run) run command in a separate terminal to setup database and seed data
yarn db:setup

See the other helper scripts in the package.json


ย 

๐Ÿ” $~$ Testing

# unit tests
yarn test # <api|web>
yarn test:watch # <api|web>

# end to end
yarn test:e2e

# run e2e in headed mode
yarn test:e2e --headed

ย 

๐ŸŒฑ $~$ Data and Migrations

# Run migrations on a newly changed schema
yarn db:migrate:dev

# Reset the mistake
yarn db:reset

# Seed data
yarn db:seed

# To create data-centric migrations (different than schema migrations)
# https://redwoodjs.com/docs/data-migrations
yarn rw generate dataMigration <data_migration>

# Excute data migrations
yarn db:migrate:data

# Execute deployment migrations
yarn db:migrate:deploy

# Run both data and deployment migrations
yarn db:deploy

ย 

๐Ÿš€ $~$ Deployment on Heroku

  • ๐Ÿš‘ $~$ REVERT DEPLOYMENT!

    • heroku releases:info --remote staging|prod or --app <app_name>
    • heroku rollback v<X>

ย 

  • โšก๏ธ $~$ REVERT DATABASE!

    • You can't yet. We need to setup backups.
    • Last resort DATABASE_URL=<CONNECTION-STRING> yarn rw prisma db reset (you will lose all the data)

ย 

Please note: The pipelines can take a few min and may not reflect the current state at times

ย 

  • Heroku "review apps" can be triggered for any branch in the 'pipeline' section of heroku
    • Review apps' database is ephemeral and will migrate / seed on each trigger
    • Review apps can be "promoted" but this is discouraged. PR into staging and let it auto deploy
    • The naming pattern for review apps is redwood-temp-app-pr-<PR number>
  • Migrations are run automatically for staging and prod
  • Deployment to staging occurs automatically from the staging branch
  • Deployment to production occurs automatically from the main branch
  • Manual Deployment (see notes below)
  • Heroku configuation exists in app.json as well as the Procfile

ย 

๐Ÿ‘€ $~$ Heroku Notes

  • Redwood deployments in heroku need to be managed by a process manager and requests proxied via NGINX
  • NGINX must have its config named and placed in config/nginx.config.erb
  • PM2 is the process manager, initialization can be found in the root index.js file.
  • @redwoodjs/api-server was added to facilitate proxing the api requests and a proxyPath is set in the redwood.toml for NGINX to use
# Login to heroku
heroku login

# Setup remotes for manual deploys
heroku git:remote -a staging-redwood-template-app

# heroku names new remotes 'heroku by default'
git remote rename heroku staging

# push and deploy via heroku git
git push staging main

# NOTE: Use the same methods as above to setup prod

# Show app logs example. replace -a name with your app name
# i.e. staging-redwood-template-app
heroku logs --tail -a redwood-temp-app-pr-23

ย 

๐Ÿ“ $~$ Notes


ย 

  • ๐Ÿ‘Š $~$ Heroku

# Deploying other branches
git push heroku <branchname>:main

# buildpacks
heroku buildpacks --remote <staging|prod>
heroku buildpacks:<add|remove> heroku-community/nginx --remote staging
  • ๐Ÿ“„ $~$ Github Templates

To make creating new issues and pull requests easy and consistent, we have templates for the different use cases when creating an issue or pull request. You can find them in the .github directory.

bionic-broccoli's People

Contributors

nfuller52 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.