Skip to content

kmauter/RankWebProject

Repository files navigation

How to get your environment set up for local testing

Part 1: Downloading the necessary programs

In order to build, run, and test this web project, the following programs must be downloaded.

Part 2: Setting up the project

Now that you have the tools, you've got to put them to use.

  1. Open GitHub Desktop and clone this repository
  2. Open the repo in visual studio code
  3. Install the extension donjayamanne.python-extension-pack
  4. Click the python extension and click the + next to Workspace Environments
  5. Select the python 3.10 as your interpreter from your system
  6. Open a terminal in your new virtual environment by clicking open in terminal in the python extension
  7. Execute the following command: pip install flask flask_sqlalchemy flask_migrate
  8. Navigate to the client directory by executing: cd client
  9. Execute the following command: npm install

Part 3: Running the program

Now that you're all set up, let's run this thing.

  1. Open two separate terminals, just like before
  2. In the first, navigate to the client directory by executing: cd client
  3. Now execute: npm start
  4. In the other terminal execute: py run.py
  5. It should be running now!

Roadmap

Game Creation

  • Game creation includes a description
  • Game creation includes choosing the submission limit
  • Use main-content format

Game Join

  • Use main-content format

During Submission Stage

  • Player can submit a song
  • Player can delete a submitted song
  • Player can see their submitted songs
  • Player cannot submit more than a designated number of songs
  • Owner can do all things Player can do AND
  • Owner can see all songs submitted by any player in that game
  • Owner can delete any submitted song
  • Owner can NOT see who submitted what song ALSO
  • Owner can change submission due date
  • Owner can change rank due date
  • Owner can remove player from game

Submission Bug Tracker

  • When submitting a song, the song list is not updated
  • When submitting a song, if it is successful, it should clear the fields
  • Fix formatting on settings page to emphasize headers
  • User should get some feedback when saving the changed dates.
  • UI for description viewing

Automation Between

  • When submission due date is passed, trigger Automation
  • Randomize order of songs
  • Create Spotify playlist (if given spotify account to make playlist in)
  • Create Youtube playlist (if given youtube account to make playlist in OR default account)
  • Switch stage to ranking

Automation Additional Tasks

  • Update Game table to include playlist links
  • Remove song links from songs table
  • Add youtube/spotify account to user table for use in creating playlists
  • Create API endpoints for connecting user spotify and youtube
  • Set up Youtube OAuth Redirect
  • Set up Spotify OAuth Redirect
  • Update settings popup to use connection endpoints
  • Access user spotify and youtube tokens in automation task

During Ranking Stage

  • Player can see all songs/artists/comments
  • Player can rank all songs
  • Player can edit ranking
  • Player can save unfinished or finished rankings
  • Owner can do all things Player can do AND
  • Owner can edit the playlists if songs are incorrect (unless they did not give their account info)
  • Owner can change rank due date
  • Owner can remove player from game

Ranking Additional Tasks

  • CRUD Ranking APIs
  • Drag and Drop UI
  • Style Drag and Drop
  • Saving rankings button
  • Save finished and partial rankings
  • Load finished and partial rankings
  • UI for Youtube and Spotify Playlists
  • Songs don't refresh once loaded during ranking stage
  • Mobile Friendly UI

Automation Between

  • When ranking due date is passed, trigger Automation
  • Take all finished rankings (where all songs have been ranked)
  • Remove the songs a user submitted from their ranking
  • If a user submitted a song but did not rank, they cannot win. Make Red in results
  • Calculate statistics for the game:
  • Each song avg rank, median rank, range, controversy score, user who submitted

During Finished Stage

  • Display all songs, avg ranking and controversy score, and who submitted what
  • Mobile Friendly UI

Deployment Setup and Development Processes

  • Set up a cloud server (e.g., DigitalOcean Droplet) and connect via SSH
  • Install all required software (Python, Node.js, Nginx, Git, etc.) on the server
  • Clone the project repository onto the server
  • Set up and activate a Python virtual environment for the backend
  • Install backend dependencies and configure environment variables/secrets
  • Build the frontend React app for production use
  • Configure nginx to serve the built frontend files
  • Set up Gunicorn to serve the Flask backend as a service
  • Configure Nginx as a reverse proxy to Gunicorn for production traffic
  • Set up a domain name and HTTPS with Let's Encrypt
  • Test the deployed site to ensure all services are running correctly
  • Set up Docker for consistent development and deployment environments
  • Implement a CI/CD pipeline for automated testing and deployment
  • Document any environment variables, secrets, or special setup steps for future development

Stretch and QOL Features for Later

  • UNIT TESTS
  • Owner can delete the game
  • Owner can set playlist name
  • Modify settings popups to use main-content format
  • Upload Profile pictures for users
  • Detailed User statistics
  • Upload Game images for preview backgrounds?
  • Add additional developers to the project (David, Spencer, Steph, Justin)
  • Standardize font sizes
  • Hover effects and increased visual feedback for interactions
  • Email Verification
  • Fetch additional song data from spotify (loudness, happiness, etc.) during first stage change
  • Create a spreadsheet with all stats, ones given above and including additional song data from spotify during second stage change
  • Allow download for full data
  • Display winner and winning song prominently!

Goal POC Date: 8/1

More Tasks

Proper Documentation

Security

Deployment Notes

  • If using a production WSGI server (e.g., Gunicorn), ensure the background scheduler in app/tasks.py runs only once (not per worker process). Consider running it as a separate service in production.

  • Store client secrets and tokens securely (use environment variables).

  • Use HTTPS in production.

  • Never expose secrets to the frontend.

  • Add your production domain’s redirect URI (e.g., https://yourdomain.com/api/spotifycallback) to the app’s Redirect URIs in spotify dashboard.

  • Add your production domain’s redirect URI (e.g., https://yourdomain.com/api/youtubecallback) to the OAuth consent screen and credentials in google cloud console.

  • Set env variables to correct production URIs

  • In Google Cloud Console, publish your OAuth consent screen (move from "testing" to "production").

    • Complete the verification process (Google will require you to provide details, privacy policy, and may take several days to approve).
    • You may need to prove domain ownership and provide a privacy policy URL.
  • Ensure your backend and frontend are served over HTTPS in production.

  • Update any CORS settings to allow requests from your production frontend domain.

  • For Google, once verified and in production, you can remove test users and allow public access.

  • Proper logging for debugging purposes

  • Allow users to submit bug reports

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors