A web app for revealing a user's (good) taste in music with Spotify.
Tastyfi.me is a full-stack application built with Node.js, Express, MongoDb, and EJS that uses the Spotify Web API for querying unique user and song data for generating dynamic user pages.
It exists to help listeners understand their musical tastes over different time periods by viewing their most loved Artists, Tracks, trends, and musical kinks.
Listeners can sign up with one click, create and view their user profiles, and share them with friends and family for discovering great new music.
Back-End:
- MV* Back-End Architecture
- RESTful Routes
- User Sessions with express-session
- Session Storage with connect-mongo
- Oath 2.0 Authentication with Passport and Spotify
- Asynchronous HTTP Requests and Db Queries with JavaScript Promises and Async/Await
- In-Memory Caching of HTTP Responses with memory-cache
- Custom Middleware for Express Routers
- Flash Messages with connect-flash
Front-End:
- Dynamic Views with EJS
- Responsive Pages and Components with Semantic-UI
- Responsive Media Queries for Mobile Layouts
- Web Browser Clipboard Functionality with Clipboard.js
You'll need a computer with the following software installed:
- Node.js
- npm
- Gulp (optional)
- MongoDb
You'll need to have a registered Developer Account with Spotify and a valid Client ID and Client Secret. Your web application registration must be set up to use the Authorization Code Flow OAuth 2.0 scheme.
See the Spotify Developers website for information on how to do this.
Tastyfi.me uses the dotenv Node module so you must create a .env
file in the project directory with the following key-value pairs:
# Application Variables
NODE_ENV=<node_environment>
DATABASE_URL=<connection_string_for_mongo_db>
SESSION_SECRET=<key_for_encrypting_session_cookies>
PORT=<port_number>
# Spotify Variables
CLIENT_ID=<spotify_client_id>
CLIENT_SECRET=<spotify_client_secret>
REDIRECT_URI=<redirect_uri_for_spotify_authentication>
# Caching
SPOTIFY_CACHE_DURATION_MS=<cache_duration_value_in_milliseconds>
The REDIRECT_URI
should be the same as the Redirect URI registered with your Spotify application.
Tastyfi.me already comes with preconfigured runtime values for Application and Caching Variables. You'll just need to provide the Spotify Variables values if you're only interested in deploying to a local instance.
- Clone the repo
- Open a Terminal in the project directory
- Run
npm install
- In another Terminal tab or window, run
mongod
, the Mongo daemon instance for your db - Run
npm start
- Open a browser window and visit http://localhost:3000/
This repository intentionally contains the compiled Semantic UI files in version control under the public/semantic
directory, but in case of an upgrade or a fresh build, follow these instructions:
- Open a Terminal in the project directory
- Run
cd node_modules/semantic-ui
to open the semantic-ui package directory - Run
gulp install
and perform an 'Express' installation. - Set the installation directory to
public/semantic
when prompted by Gulp - Run
cd public/semantic
- Run
gulp build
to build the Semantic UI distribution files
For more information on installing and using Semantic UI, see Getting Started with Semantic UI.
Note: This project uses a CDN resource for the required jQuery file for Semantic UI. If you're upgrading the Semantic UI version you might need to also upgrade to a newer version of jQuery in your landing and partial view files.
- Hand holding an iPhone Photo by Jean on Unsplash
- 404 Pug Photo by Matthew Henry on Unsplash
MIT License
Copyright (c) 2018 Damián Adams
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.