GithubHelp home page GithubHelp logo

ctran01 / spoofify Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 1.19 MB

Spotify clone creating using React frontend and Python backend

Shell 0.20% Dockerfile 0.48% Python 36.62% Pug 0.11% Mako 0.29% HTML 4.36% JavaScript 55.36% CSS 2.59%

spoofify's Introduction

Spotify Clone

a clone of the popular streaming music service

Docker Containers:

  • React App (bootstrapped with create-react-app)
  • Python/Flask API Server
  • PostgreSQL Database

React App:

  • JWT
  • React Hook Form
  • React Router
  • Hooks (useState, useContext, useHistory, useEffect)
  • Material UI
  • AWS

Python/Flask API Server:

  • JWT Auth
  • Werkzeug Security for password encryption
  • API Endpoints for Song/Playlist/User CRUD

PostgreSQL DB

  • User Info
  • Library / Playlists
  • Song / Artist Info
  • Links to AWS hosting for music

API Endpoints

User

  • Create User
  • Delete User
  • Update User
  • Return Users
  • User Auth -> /token

Playlist

  • Create Playlist
  • Delete Playlist
  • Update Playlist (add/remove)
  • Return Playlist

User Library

  • Add/Remove Songs
  • Return Song Library
  • Return Artist Library
  • Return Album Library
  • Return Genre Library (optional)

Spotify Library

  • Return Song Library
  • Return Artist Library
  • Return Album Library
  • Return Genre Library (optional)

Setup

  1. Clone project
  2. Create .env files in the root directory (example.env included)
  3. Create .env file in api_server directory with DATABASE_URL
  4. From the root directory, run [docker-compose up]

To run locally:

  1. cd into either api_server or client
  2. install packages locally
  3. npm start or flask run (with venv activated)

To gain access to postgres inside container:

docker container exec -it spotify_clone_db_1 /bin/sh
psql -U flask_api -W flask_api_db

To populate DB with seeder data:

docker container exec -it spotify_clone_api_1 /bin/sh
python3 database.py

Deployment Notes:

Flask App:

Deploying flask to heroku

  • git subtree push heroku --prefix api_server master

Add heroku.yml

# add gunicorn package and swap these 2 lines in entrypoint.sh
python3 entry.py run -h 0.0.0.0
gunicorn app:app

deploying client folder from master branch

  • git subtree push client --prefix client master

installing serve package globally to serve static assets

  • npm install -g serve

deploying client folder on react-auth branch

  • git push client git subtree split --prefix client react-auth:master --force
# production image build
FROM node:12-alpine as base

FROM base as build

ENV REACT_APP_API_SERVER_BASE_URL=https://spotify-clone-appacademy.herokuapp.com

WORKDIR /app

COPY . .

RUN npm install && npm run build

RUN npm install -g serve

CMD ["serve", "-s", "build"]
# deployment for specific branch for api_server
git push heroku `git subtree split --prefix api_server react-auth`:master --force

spoofify's People

Contributors

colerutledge avatar serranomarco avatar ctran01 avatar

Stargazers

Neha Anand  avatar Zachery Haley avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.