You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 7, 2022. It is now read-only.
@@ -63,8 +66,8 @@ Congratulations, you should now be running a local environment for the backend o
63
66
64
67
1. Clone this repo (`git clone https://github.com/Pogify/pogify.git`)
65
68
2. Switch to the `develop` branch (`git checkout develop`)
66
-
2. Change directory `cd` to the newly created `pogify` repo and install dependencies with `yarn install`.
67
-
3. Create a file in the directory named `.env` or `.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.
69
+
3. Change directory `cd` to the newly created `pogify` repo and install dependencies with `yarn install`.
70
+
4. Create a file in the directory named `.env` or `.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.
68
71
```
69
72
REACT_APP_SUB=https://messages.pogify.net
70
73
REACT_APP_CLOUD_FUNCTION_EMULATOR_BASE_URL={URL}
@@ -78,6 +81,7 @@ Congratulations, you should now be running a local environment for the backend o
78
81
Congratulations, you should now be running a local environment for the frontend of Pogify!
79
82
80
83
###### A couple notes:
84
+
81
85
- Sessions hosted from local environments cannot be joined from the pogify.net production deployment.
82
86
- Sessions hosted on a pogify.net production deployment can be joined from a local environment.
83
87
- Missing any one step wil throw an error. Be sure to read each and every single instruction carefully.
@@ -94,4 +98,38 @@ Congratulations, you should now be running a local environment for the backend o
94
98
4. Change directory `cd` into the `pogify` repo.
95
99
5. Run `yarn start`.
96
100
97
-
**Thanks for contributing to Pogify! We can't wait to see what you do with it!**
101
+
## Naming Scheme Conventions
102
+
103
+
- React components are PascalCased
104
+
- non React js files are camelCased
105
+
- folders are hyphen-cased
106
+
- test files are cased according to the file that the test runs
107
+
- CSS files are PascalCased
108
+
- Note: please avoid using global namespaced stylesheets and use [css modules](https://create-react-app.dev/docs/adding-a-css-modules-stylesheet/) instead.
109
+
-[Styled-components](https://styled-components.com/) are also acceptable.
110
+
- Just avoid using inline styles
111
+
- We are transitioning away from inline styles.
112
+
113
+
## Directory structure
114
+
115
+
-`/src` all source files
116
+
-`/src/routes` components that react-router
117
+
-`/src/components` other components
118
+
- Components can be just jsx files or PascalCased folders with an index.jsx and index.module.css
119
+
-`/src/components/utils` components
120
+
-`/src/layouts` layout related HOCs
121
+
-`/src/modals` modal components
122
+
-`/src/stores` mobx stores
123
+
-`/src/context` contexts
124
+
-`/src/hooks` react hooks
125
+
-`/src/styles` CSS files for global or reused styles
126
+
-_Note:_ Please try avoid writing global CSS styles (ie. \[something\].css) and use css modules instead (ie. \[something\]._module_.css)
127
+
-`/src/utils` utility functions
128
+
-`src/__tests__` all tests
129
+
-`src/__tests__/unit` unit tests
130
+
- follows structure of src files
131
+
-`src/__tests__/integration` integration tests
132
+
-`src/__mocks__` test mocks
133
+
-`src/__utils__` test utils
134
+
135
+
## **Thanks for contributing to Pogify! We can't wait to see what you do with it!**
Copy file name to clipboardExpand all lines: README.md
+54-30Lines changed: 54 additions & 30 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -55,7 +55,7 @@ Pogify does **NOT** stream audio from the host of a listening session. Instead,
55
55
- Nginx
56
56
- with [push_stream_module](https://github.com/wandenberg/nginx-push-stream-module)
57
57
- module enables us to handle 60k connections on one VPS (single core, 1GB).
58
-
- Google Firebase
58
+
- Google Firebase
59
59
- Realtime Database & Authentication
60
60
- uses anonymous sign in and the realtime database to implement a rate limiter for cloud functions
61
61
- Cloud Functions
@@ -90,34 +90,36 @@ Pogify uses Google Firebase's Authentication service to use its anonymous sign i
90
90
91
91
## Known Issues / Limitations
92
92
93
-
This project is still in alpha and as such there are still lots of bugs.
93
+
This project is still in alpha and as such, there are still lots of bugs.
94
+
95
+
If you have an issue that isn't listed below or does not have an open issue, please help us by [opening a new one](https://github.com/Pogify/pogify/issues/new/choose).
94
96
95
97
Currently the project is deployed on a free tier heroku dyno. Thus, we cannot use SSL with a custom domain. Thus, www.pogify.net redirects to the non-custom pogify.herokuapp.com for the moment.
96
98
97
-
1.### Pogify does **NOT** work on Safari, or Mobile Browsers
98
-
99
-
- This is a limitation of the Spotify Web Playback SDK.
2. Listeners cannot play pause their local spotify
104
-
3. Session member count is always 0.
105
-
4. Listener Player will stutter.
106
-
5. Listener player unexpectedly seek to beginning of track.
107
-
6. Seeking on a listener player will de-synchronize a listener from the host and will not resynchronize until an update from host.
108
-
7.~~Volume Control is not good.~~
109
-
8. 'Join Session' / 'Start session' buttons sometimes do not work
110
-
9. Incomplete error handling
111
-
10. Leftover console.logs
112
-
11. No nav bar or alternative
113
-
12. Sessions may timeout even if its active.
114
-
13. Navigating away from player screen shows an alert.
115
-
14. Pogify will unexpectedly automatically redirect to the Spotify login page if it fails to refresh the login session.
116
-
15. State updates by the Spotify Web Player SDK makes two plus updates per state change. There is not yet a solution to consolidate and/or drop an update and not post an update.
117
-
16.~~Pogify does not yet comply 100% with Spotify Developer Agreement. We are working as fast as possible to remedy this shortfall.~~
118
-
17. there are no tests.
119
-
18. sparse code commenting
120
-
19. And probably many more I forgot about
99
+
###Note: Pogify does **NOT** work on Safari, or Mobile Browsers
100
+
101
+
- This is a limitation of the Spotify Web Playback SDK.
2. Listener player may cut out a couple seconds to the end of a track.
108
+
- diagnosis: because of latency and things of this nature, host may send a new track update before the end of the listener's current track.
109
+
- short-term solution: if the update is for the next track (ie position = 0) have player wait till end of track _or_ add as next song in queue for continuous playback.
110
+
- long-term solution: listener player's queue should be synchronized with host's. If host updates with the start of the next track, listener should just continue.
111
+
3. 'Join Session' / 'Start session' buttons sometimes do not work
112
+
4. Incomplete error handling
113
+
5. Leftover console.logs
114
+
6. No nav bar or alternative
115
+
7. Sessions may timeout even if its active.
116
+
8. Excessive skipping forward or backwards will break listener.
117
+
- diagnosis: repeated skips aren't captured by debouncer, probably because updates take longer than 300 to fire thus every skip is sent to the listener.
118
+
-solution:
119
+
9.~~there are no tests.~~ there are two tests.
120
+
10. Pogify can't recognize seeks to 0 ~~sometimes~~ most of the time.
121
+
- diagnosis: Spotify doesn't fire a state change event when seeking to 0 if already seeked to 0 once, so Pogify misses it.
122
+
- solution: poll for spotify data periodically (ie once a second) using player.getCurrentState()
121
123
122
124
## Contributing and Communication
123
125
@@ -126,15 +128,37 @@ Currently, Pogify is open to contributors but please note that Pogify is stil in
126
128
The above paragraph is verbatim from the [Contributing Guidelines](https://github.com/Pogify/pogify/blob/master/CONTRIBUTING.md) which all contributors must read before attempting to contribute!
127
129
All Pogify contributors are bound by the [Contributor Covenant Code of Conduct](https://github.com/Pogify/pogify/blob/develop/CONTRIBUTING.md).
128
130
131
+
## Dev-ing
132
+
133
+
1. Execute `yarn` into the folder of this repository
134
+
2. Copy the file `.env.development` to `.env.development.local` and edit the following:
135
+
- the URL in the env variable `REACT_APP_CLOUD_FUNCTION_EMULATOR_BASE_URL` to match the URL of the functions endpoint in the Firebase emulator (typically of the form: `http://localhost:5001/theprojectyoucreated/us-central1`)
136
+
- The client ID of the Spotify App in `REACT_APP_SPOTIFY_CLIENT_ID`, obtainable from their developer website here: https://developer.spotify.com/dashboard/applications <br>
137
+
Do not forget to also whitelist the redirect URI (`/auth`, so you can put `http://localhost:3000/auth` with the default settings)
138
+
- If needed, also set the Nginx SSE endpoint via the `REACT_APP_SUB` variable
139
+
3. Run `yarn start-dev`
140
+
129
141
## Todo List
130
142
131
-
-[] Make a looping script or something that people can use to develop the listener player without 2 accounts.
132
-
-[] code comments
143
+
-[x] Make a looping script or something that people can use to develop the listener player without 2 accounts. (available in pogify/pogify-nginx-container)
144
+
-[x] code comments
133
145
-[ ] tests
134
-
-[ ] debouncer for client events (would fix no. 15 of Known Issues)
146
+
-[x] debouncer for client events (would fix no. 15 of Known Issues)
147
+
-[ ] verified sessions
148
+
-[ ] twitch
149
+
-[ ] move all player (host and listener) logic into stores so that player can be used outside of `/session/{id}`.
150
+
-[x] player logic moved to mobx store.
151
+
-[ ] readme `Fixed by {SHA}` should have proper links to commits.
0 commit comments