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
Run these commands in your terminal (explanation below):
git pull origin master
yarn
- If the Mongo server isn't currently running, run:
mongod
yarn run seed
yarn run build-and-start
- Visit http://localhost:3000/ in your browser
What do these things do?
- Gets the latest master version of the code base
- Installs any newly added packages/modules
- Runs the Mongo daemon, a service that lets you connect to the database. If it's already running, this command will leave the service running and will exit with an error message.
- This drops the development DB and restores the dataset to mirror what's in the Google Sheet
- This both transpiles the React code (JSX/ES6) into JavaScript that the browser can execute and runs a Node-based web server that your web browser can connect to.
- This is you typing a URL into your browser.
Install Hombrew from http://brew.sh
Then run:
brew install yarn
This will install the latest stable version of Node.js and Yarn
You don't have git?! C'mon!
brew install git
You need MongoDB, too:
brew install mongodb
Make a directory called 'data' on your root, and a directory inside that called 'db', so MongoDB has a default place to store DB files If this directory already exists, don't recreate it!
sudo mkdir -p /data/db
Now, navigate to where you want to download this code and clone this repo:
git clone https://github.com/plasticbugs/cryptosong.git
Change into the downloaded directory
cd cryptosong
Install all the app's dependencies (this may take a while):
yarn
Build the app (this will take about 10 seconds or so):
yarn run build
In another terminal window, run MongoDB:
mongod
Once the MongoDB daemon is running, you can seed the database in another terminal window. You can re-run this seed file at any time to reset the database to the original dataset based on the Google Spreadsheet. Make sure you're inside the 'cryptosong' directory when you run this command:
yarn run seed
After the seed file runs and exits successfully (you'll see a bunch of stuff scroll by), run:
yarn start
When you want to stop the build process or the web server:
Control + C in your terminal window