reichert621 / health

1 stars 1 forks source link

Getting started

Install dependencies

Set up a local Postgres database

For reference, my local environment variables look like this in my ~/.bash_profile file:

  # Node environment
  export NODE_ENV='dev'

  # DB credentials
  export BLOG_DB_PORT=5432
  export BLOG_DB_HOST='localhost'
  export BLOG_DB_NAME='blog' # this should match the db you created above
  export BLOG_DB_USER=''
  export BLOG_DB_PW=''

Run the app

Migrate the database, build the client, and run the server:

$ npm start

which is the same as:

$ npm run db:migrate              # Ensures the db is up to date with latest migrations
$ npm run build                   # Builds the React client
$ node server/javascript/index.js # Runs the Node/Express server

Go to localhost:8000 (or whatever $PORT you set) to check that the app is running.

Development

The current focus of this project is in the server/javascript directory for the API, and the client/reactdirectory for the client.

To simply start the server, run:

$ npm run dev

This will serve the contents of the client/react/build directory, which are built with Webpack.

To run Webpack in --watch mode, run:

$ npm run watch

And that should be it! Happy hacking 🤓