Skip to content

Commit 1aee907

Browse files
committed
fixed readme
1 parent 0b6ab90 commit 1aee907

File tree

3 files changed

+67
-88
lines changed

3 files changed

+67
-88
lines changed

README.md

Lines changed: 56 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,61 @@
1-
Express Boilerplate!
2-
This is a boilerplate project used for starting new projects!
1+
# TuneChain
32

4-
Set up
5-
Complete the following steps to start a new project (NEW-PROJECT-NAME):
3+
Michael Bonner, Primary Developer
64

7-
Clone this repository to your local machine git clone BOILERPLATE-URL NEW-PROJECTS-NAME
8-
cd into the cloned repository
9-
Make a fresh start of the git history for this project with rm -rf .git && git init
10-
Install the node dependencies npm install
11-
Move the example Environment file to .env that will be ignored by git and read by the express server mv example.env .env
12-
Edit the contents of the package.json to use NEW-PROJECT-NAME instead of "name": "express-boilerplate",
13-
Scripts
14-
Start the application npm start
5+
[LiveApp](https://tunechain-app.mdb1710.now.sh)
156

16-
Start nodemon for the application npm run dev
7+
[Client Repo](https://github.com/mdb1710/tunechainclient_final)
8+
9+
## Summary
10+
11+
You have Spotify and you're looking for the music to match your current mood. Now you can chain your music to your mood with Tunechain. With Tunechain you can search for used curated playlist to match the mood and genre you desire. You can even save your searches. This is the back-end api to perform those searches.
12+
13+
## Database
14+
15+
Please refer to the seed tables. This database will help you with requests for saved searches
16+
1. Create a database called saved_playlists
17+
2. Create a role to own the db called tunechainer
18+
3. Run npm run migrate to create needed tables
19+
4. Use seed file in seeds folders for starter data
20+
21+
## API
22+
23+
GET /api/search
24+
25+
The Spotify Web API uses the request library for the mood and genre searches. Because all Spotify request require a web token for authorization, we set up a POST request to receive/refresh that token for each search. Once the token is received a get request with the search query is immediately made the search endpoint to retrieve the data from Spotify. This data is then sent to the client.
26+
27+
POST /api/saved
28+
29+
This request send the mood and genre you just searched to the database.
30+
31+
GET /api/saved
32+
33+
This request will send to the client all of the saved searches the used made at that point from the database.
34+
35+
36+
## Technology
37+
38+
39+
40+
For The Back End
41+
- Spotify Web API
42+
- NodeJs
43+
- ExpressJs
44+
- Request
45+
- Mocha/Chai
46+
- PostgreSQL
47+
- Supertest
48+
49+
50+
Deployed via Now
51+
52+
53+
54+
## Setup
55+
56+
To setup the application
57+
58+
1. Fork and clone the project to your machine.
59+
2. `npm install`.
1760

18-
Run the tests npm test
1961

20-
Deploying
21-
When your new project is ready for deployment, add a new Heroku application with heroku create. This will make a new git remote called "heroku" and you can then npm run deploy which will push to this remote's master branch.

test/app.spec.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,17 @@ describe('App', () => {
2525
.expect('Content-type', /json/)
2626
.then(res => {
2727
expect(res.body).to.be.an('array');
28-
expect(res.body).to.have.all.keys('lat', 'lon');
28+
2929
});
3030
});
31+
32+
it('GET /api/saved responds with array from db', () => {
33+
return supertest(app)
34+
.get('/api/saved')
35+
.expect(200)
36+
.expect('Content-type', /json/)
37+
.then(res => {
38+
expect(res.body).to.be.an('array');
39+
});
40+
});
3141
});

test/auth-endpoints.spec.js

Lines changed: 0 additions & 71 deletions
This file was deleted.

0 commit comments

Comments
 (0)