- React App (bootstrapped with create-react-app)
- Python/Flask API Server
- PostgreSQL Database
- JWT
- React Hook Form
- React Router
- Hooks (useState, useContext, useHistory, useEffect)
- Material UI
- AWS
- JWT Auth
- Werkzeug Security for password encryption
- API Endpoints for Song/Playlist/User CRUD
- User Info
- Library / Playlists
- Song / Artist Info
- Links to AWS hosting for music
- Create User
- Delete User
- Update User
- Return Users
- User Auth -> /token
- Create Playlist
- Delete Playlist
- Update Playlist (add/remove)
- Return Playlist
- Add/Remove Songs
- Return Song Library
- Return Artist Library
- Return Album Library
- Return Genre Library (optional)
- Return Song Library
- Return Artist Library
- Return Album Library
- Return Genre Library (optional)
- Clone project
- Create .env files in the root directory (example.env included)
- Create .env file in api_server directory with DATABASE_URL
- From the root directory, run [docker-compose up]
- cd into either api_server or client
- install packages locally
- npm start or flask run (with venv activated)
docker container exec -it spotify_clone_db_1 /bin/sh
psql -U flask_api -W flask_api_db
docker container exec -it spotify_clone_api_1 /bin/sh
python3 database.py
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