A dream app for dreamers. Dreamers can record their dreams, their mood and temp, add themes, and track their dreams over time.
Fork and clone this app. Set up NPM and PostgreSQL using the steps listed in Development Setup Instructions section below. Use the database.sql file in the root folder to create the PostgreSQL database and table. I recommend using Postico to set up Postgres and Postman to test SQL queries.
Before you get started, make sure you have the following software installed on your computer:
Create a new database, rename the db in server/modules/pool.js. Follow instructions in the /database.sql file.
- Run
npm install
- Create a
.env
file at the root of the project and paste this line into the file:SERVER_SESSION_SECRET=secret code
In .env
file, replace secret code
with some long random string for security. You can use a site like https://passwordsgenerator.net/. If you don't do this step, create a secret with less than eight characters, or leave it as secret code
, you will get a warning.
NOTE: this repo uses mailgun (MG) to send 'forgot password' emails. To fully enact this feature, you will need to set up an account on the MG website, and then add a few vars to the .env file:
- EMAIL_ADDRESS: email address from which you want to send these emails
- MG_Domain: the domain used by MG to send the emails (there is a sandbox option)
- MG_Key: key provided by MG for validation
- Start postgres if not running already by using
brew services start postgresql
- Run
npm run server
- Run
npm run client
- Navigate to
localhost:3000
Before pushing to Heroku, run npm run build
in terminal. This will create a build folder that contains the code Heroku will be pointed at. You can test this build by typing npm start
. Keep in mind that npm start
will let you preview the production build but will not auto update.
- Start postgres if not running already by using
brew services start postgresql
- Run
npm start
- Navigate to
localhost:5000
- Create a new Heroku project
- Create an Heroku Postgres database
- Connect to the Heroku Postgres database from Postico
- Create the necessary tables
- Add an environment variable for
SERVER_SESSION_SECRET
with a random string for security - In the deploy section, select manual deploy