Currently, Pogify is open to contributors but please note that Pogify is stil in its infancy and undergoing rapid development which means we will not be assigning particular tasks to non-maintainers. This also means that we may be liable to reject pull requests that cause major conflicts with a mainatiner's local repository. Due to this, please first discuss the change you may wish to make via Github issue or with someone with the Developer role on our Discord before making a change. With that said, do not be afraid to make a pull request as it will likely be accepted provided you have contacted a maintainer prior to working on it. Pogify is also looking for potential contributors with skills that extend beyond code. If you think you have skills that could be of any benefit to Pogify, please do reach out to us on our Discord server!
Pogify's contributors are bound to the Contributor Covenant Code of Conduct, found in this repository as "CODE_OF_CONDUCT.md"
If you are looking to help with UI/UX, please note that we do not have a style guide as of yet which means you will have to essentially "wing it" should you wish to contribute.
- Only pull requests to the development branch will be honored.
- Explain what you did and how.
- If its a new feature, explain what it is.
- Add a screen shot if applicable.
- As it stands, pull requests that modify core components will not be honored. (unless otherwise discussed with maintainers, as above).
Refer to 'Starting up a local development environment' if you have already set up a local development environment
If you have difficulty setting up this environment, do not open an issue. Message one of the admins or ask for help on this Discord server.
- Git (Windows | MacOS | Linux)
- Node.js 10+ & NPM 6+ (Windows, MacOS, and Linux)
- Yarn (
npm i -g yarnor Yarn's Website) - A Spotify API Client ID (In doing so, please ensure you configure the auth redirect correctly. The redirect for the app is
http://localhost:{PORT}/authwhere port is the port of the create-react-app dev server (default: 3000).
- Clone Pogify/pogify-functions. (
git clone https://github.com/Pogify/pogify-functions.git) - Change directory
cdinto the newly createdpogify-functionsrepo - Install the standalone Firebase CLI from their website or, install the firebase command globally with
npm i -g firebase-tools - Run
firebase initin thepogify-functionsrepo and follow the instructions.- When prompted to select particular Firebase CLI features, only select
Database,FunctionsandEmulators. - Select
Don't set up a default projectwhen prompted with project setup options. - Accept
database.rules.jsonas the Firebase Realtime Database Rules file. - Designate
TypeScriptas the language for Cloud Functions. - Answer yes if asked to use
TSLint. - DO NOT overwrite any existing files when prompted.
- Answer yes when asked to install dependencies with NPM.
- Select both
FunctionsandDatabaseat the Emulators Setup prompt. - We recommend using the default ports for both the functions and database emulator, however, any should work granted there are no conflicts.
- The emulator UI is not necessary, however, it should cause no conflicts if you proceed to use it.
- Answer yes when asked if you would like to download the emulators now.
- When prompted to select particular Firebase CLI features, only select
- Create a file called
.runtimeconfig.jsonin thefunctionsfolder within the repo with the following text:{ "jwt": { "secret": "anysecretyoudlike" }, "pubsub": { "url": "https://anystringyoudlike.itdoesntmatteritsnotusedinemulation.com" } } - Change directory
cdinto thefunctionsfolder within the repo and runnpm run build. - Run
firebase --project=any-name emulators:startand note the URL of the emulated functions. (e.g. "localhost:5001/any-name/us-central1")
- Note: Keep the window open while you are working on the project!
Congratulations, you should now be running a local environment for the backend of Pogify!
- Clone this repo (
git clone https://github.com/Pogify/pogify.git) - Switch to the
developbranch (git checkout develop) - Change directory
cdto the newly createdpogifyrepo and install dependencies withyarn install. - Create a file in the directory named
.envor.env.development.local, replace {URL} with the URL of your emulated functions (from your Firebase CLI window) and {CLIENT_ID} with your Spotify API Client ID from the prerequisites.REACT_APP_SUB=https://messages.pogify.net REACT_APP_CLOUD_FUNCTION_EMULATOR_BASE_URL={URL} REACT_APP_SPOTIFY_CLIENT_ID={CLIENT_ID}
- Note: mesages.pogify.net is the current production endpoint for subscribing to events. It's ok to use this endpoint in a local development environment.
- Make sure
pogify-functionsfirebase emulators are running (If not, follow the above backend setup!) - Run
yarn start. Congratulations, you should now be running a local environment for the frontend of Pogify!
- Sessions hosted from local environments cannot be joined from the pogify.net production deployment.
- Sessions hosted on a pogify.net production deployment can be joined from a local environment.
- Missing any one step wil throw an error. Be sure to read each and every single instruction carefully.
- If you click
join a session, you will be stuck on the 'waiting for host' modal unless there is an active sesion w/ a host. (Alternatively, you can use session codedevto join a session with 2 tracks. Take on Me will have pauses/seeks and Death of a Bachelor should play through normally.)
Refer to 'Set up a local development environment' if you have not yet set up a local development environment with the instructions provided above. If you have difficulty starting up your environments, do not open an issue. Message one of the admins or ask for help on the discord server.
- Change directory
cdinto thepogify-functionsrepo. - Run
firebase --project=any-name emulators:startand note the URL of the emulated functions (e.g. "localhost:5001/any-name/us-central1") and leave the window running. - If the URL of the emulated functions does not match the one in your
.envor.env.development.localfile, change the file. - Change directory
cdinto thepogifyrepo. - Run
yarn start.
- React components are PascalCased
- non React js files are camelCased
- folders are hyphen-cased
- test files are cased according to the file that the test runs
- CSS files are PascalCased
- Note: please avoid using global namespaced stylesheets and use css modules instead.
- Styled-components are also acceptable.
- Just avoid using inline styles
- We are transitioning away from inline styles.
/srcall source files/src/routescomponents that react-router/src/componentsother components- Components can be just jsx files or PascalCased folders with an index.jsx and index.module.css
/src/components/utilscomponents/src/layoutslayout related HOCs/src/modalsmodal components/src/storesmobx stores/src/contextcontexts/src/hooksreact hooks/src/stylesCSS files for global or reused styles- Note: Please try avoid writing global CSS styles (ie. [something].css) and use css modules instead (ie. [something].module.css)
/src/utilsutility functions
src/__tests__all testssrc/__tests__/unitunit tests- follows structure of src files
src/__tests__/integrationintegration tests
src/__mocks__test mockssrc/__utils__test utils