-
Clone the repo and cd into the directory
-
Install dependencies
yarn
-
Create a local .env file. Duplicate the .env.sample and name it .env.
-
Run a mongo db server in another terminal window
$ mongod
-
Seed the database
$ yarn run seed
-
Create the Jons
If you have the images you can drop them into a public/img/2009 folder. There will be 2 images per day ie.) 1230872400-hands-oh-no.png 1230872400-hands-oh-no-small.png
If you do not have them you can generate them with:
$ mkdir public/jons/2008 $ mkdir public/jons/2009 $ node server/scripts/yearOneImages.js $ node server/scripts/yearOneBackgroundAlone.js $ node server/scripts/yearOneJonAlone.js
Recommend hosting the assets in something like S3 in 2008 or 2009 folders and then removing from your public folder. You could also host them in the application and deploy them in the public folder where they were created. The API will construct the image urls using the IMAGE_HOST path in the .env.
Configure the host path in the .env
S3 example example to return 'https://s3.amazonaws.com/<bucket-name>/<subdirectory>/2008/1230786000-in-the-time-of-the-gods.png' IMAGE_HOST=https://s3.amazonaws.com/<bucket-name>/<subdirectory>
Hosted in app or in an s3 relative to where the other static files are hosted. Example to return '/jons/2008/1230786000-in-the-time-of-the-gods.png' IMAGE_HOST=jons
-
Start the development servers
Concurrently:
$ yarn dev
or start them in separate terminal windows
$ yarn web-start $ yarn server-start
-
Visit http://localhost:3000/ in your browser for the fe and http://localhost:3005/ for the api
http://localhost:3000/instruments
http://localhost:3000/locations
http://localhost:3000/song/:id
example: http://localhost:3000/song/25
http://localhost:3000/song/new
http://localhost:3000/song/SONG_NUMBER_HERE/edit
example: http://localhost:3000/song/25/edit
Some routes you may find useful:
GET /api/song/:id
===> returns song data by song number
GET /api/tag/:tag_name
=> returns an array of songs that match the provided tag