Coder Social home page Coder Social logo

lunch_box's Introduction

FS-App-Template

Setup

To use this as boilerplate, you'll need to take the following steps:

  • Don't fork or clone this repo! Instead, create a new, empty directory on your machine and git init (or create an empty repo on Github and clone it to your local machine)

  • Now you will have to add the fs-app-template as a remote and merge it into your own repository.

git remote add boilermaker https://github.com/FullstackAcademy/fs-app-template.git
git fetch boilermaker
git merge boilermaker/main
git branch -m master main

Customize

Now that you've got the code, follow these steps to get acclimated:

  • Update project name and description in package.json
  • npm install
  • Create two postgres databases (MY_APP_NAME should match the name parameter in package.json):
  • These commands will create both your development and test databases
createdb <YOUR APP NAME HERE FROM package.json>
createdb <YOUR APP NAME HERE FROM package.json>-test
  • By default, running npm test will use your test database, while regular development uses development database

Start

Sync and seed your database by running npm run seed. Running npm run start:dev will make great things happen!

  • start:dev will both start your server and build your client side files using webpack
  • start:dev:logger is the same as start:dev, but you will see your SQL queries (can be helpful for debugging)
  • start:dev:seed will start your server and also seed your database (this is useful when you are making schema changes and you don't want to run your seed script separately)

Heroku

  1. Set up the Heroku command line tools
  2. heroku login
  3. Add a git remote for heroku:
  • If you are creating a new app...

    1. heroku create or heroku create your-app-name if you have a name in mind.
    2. heroku config:set JWT=<your secret here!> to set a secret for JWT signing

Database Setup

  1. heroku addons:create heroku-postgresql:hobby-dev to add ("provision") a postgres database to your heroku dyno (This creates your production database)

  2. heroku config:set SEED=true to get heroku to sync and seed your database

  3. note everytime your app restarts, the database tables will be dropped and re-created. To avoid this you can config:unset SEED

  • If you already have a Heroku app...

    1. heroku git:remote your-app-name You'll need to be a collaborator on the app.

Now, you should be deployed!

lunch_box

lunch_box's People

Contributors

aseraphin avatar brismol avatar elena-io avatar ericpkatz avatar jing1524 avatar mmac1020 avatar sarahzhao25 avatar tstrat avatar

Watchers

 avatar

Forkers

aseraphin

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.