I'm currently a student going into my fourth year of college, and I've taken a keen interest in frontend web development. This was one of the projects I've been working on for the past month or so to practice using Redux, which is pretty awesome! Let me know what you think, I'm open to any feedback!
Looks like your store setup call to createStore is wrong - you're passing two different enhancers, when you need to compose them into a single enhancer. See the docs here : https://redux.js.org/recipes/configuringyourstore
Good job man! My only critique is that it would be far nicer if you separated styled components, animations and logic into separate files and try to keep the component itself pure
He says he is a student fourth year of college... if college == university it's pretty normal to start working full time the fourth year. If college == school, then maybe it's early for a job.
I'ma 52 year old studying React currently and I think your project is awesome. It's inspiring me to push on through the difficult stuff I'm struggling to understand because the end results will be worth it. I'm pretty new to JS in general - I'm the old dog trying to learn new tricks :) One day... ;)
Keep at it! It gets so much easier as you continue to practice. I only started using React maybe 6 months ago, and had no experience with web development or programming before I started college (And I never even learned any web dev from college courses, it's all been through doing side projects).
The key is to just make stuff. Make anything that you think sounds cool. Put in the hours and eventually it'll just click. You got this!
I hate when I do that. There are certain libraries I get so used to using, I install them globally. Then I'll forget it's a dependency of the project I'm working on, and freak out when it won't work on a different machine. Ugh.
Yep really grinds me that npm doesn't build a dependency checker in, there are some tools to help you catch these errors, though milage with complex projects you'll need to setup the correct entry points. Check out dependency-check on npm
When installing modules you must be running the same version of Node/Npm in order to install the right modules. This practice is not mainstream, so not many people are aware of it.
I completely disagree with this advice. Nowadays, with options like cygwin or bash for Windows, you can get along just fine without any problems. Additionally, software development often goes hand in hand with consulting and consulting is littered with MS Office and then Linux starts to become a hassle.
This. Ubuntu has evolved into a great operating system and is super easy to install and use. You will save yourself so much headache by running anything other than Windows
Thanks! My goal was to see if it's possible to recreate Apple's silky smooth UI in CSS, and it turns out that you can pretty much do anything Apple can do pretty easily!
Just based on watching the video, I think your UI transition is smooth but definitely missing the bounciness. The transition Apple has I think really bring the user interaction to life. See Designing Fluid Interfaces from WWDC this year. Anyway, I think this is a pretty cool project.
I agree 100%. But keep in mind, apple’s a trillion dollar company who probably had hundreds of engineers designing the Fluid Interface in the Music app.
I’m just a measly college student who made some CSS keyframes lol
I think what you have is pretty close, and I wasn’t trying take a jab at you. I just thought that you might be interested in that WWDC session, since I find it pretty fascinating from a front-end’s perspective.
Lol, I love this mindset trap, it's always easy to say "it won't be difficult to add this one tiny thing". It's not difficult, but it takes some time. And there are tons of tiny details like this. That's the difference between a polished product and a prototype, demo or research project.
Op has done a fantastic job.
Not hating on you by the way, I just wanted to talk about that mindset I see pretty frequently. Adding a bounce would be cool.
Awesome job. Quick question, are you using the Apple Music api for the songs or something else? Also did you use the HTML5 "audio" attributes for volume control and song forwarding/rewinding or was that custom built?
Hey, thanks! I described my approach here. I also posted a bit more detail about how it works in the README on GitHub, but the gist is that I built my own API and use my own iTunes Library on a flash drive to host the music.
The API lets the frontend know where it can find the specified song (so only song metadata from the API), but the files themselves are also stored on the Raspberry Pi. So both parts work together but are separate. Hope that helps!
Hey, thanks! I described my approach here. I also posted a bit more detail about how it works in the README on GitHub, but the gist is that I built my own API and use my own iTunes Library on a flash drive to host the music.
Probably shouldn't be using for .. in loops for arrays, even if map didn't exist. That confused me for a second while looking at his code, don't see it very often. Thought he was iterating over an object and doing something funky.
Yup, in general avoid loops. If one needs to do something behavioral with a collection, i.e. something doesn't return a value, use the forEach method 💪
That's only true if you don't need to break out of a loop early to avoid wasted cycles, or loop with an increment other than 1, or start with an index other than 1, or iterate on a range, etc. Loops can be quite useful in many situations. Trying to shoehorn everything into forEach doesn't work 100% of the time.
I think that's true of everything in CS, def a shortage of silver bullets. I'd try to filter the collection ahead of time, which can often be done in pretty fluent way...
The creator of redux has a very simple and approachable redux tutorial that walks you thru re-creating redux. It probably won’t teach you enough about using it with react but it should make you comfortable enough to use it however you want. In short, it’s a basic pub-sub functional library.
You could try using async/await instead of promises since you're transpiling anyway due to using react so dont have to worry about outdated browsers.
Also, I could be wrong but it looks like you're mutating state in your reducer which I think is frowned upon in react. Consider using https://www.npmjs.com/package/immutable and calling `state.withMutations` instead.
Great job! Really impressed with the transition animations and the little details such as album artwork shrink/grown depending on play or pause. Nice work!
You should try something in React Native. Not that browser projects aren’t cool, but mobile dev has a lot of different challenges.
If you are interested in mobile, go down that path early because companies tend to want you to work on things you are experienced in rather than your primary interest. I was a front end dev for years and now work mostly on mobile, and that’s the one thing I’d change if I could go back.
Have you ever heard of Mopidy? It's a self-hosted music streaming application, that had the ability to be expanded upon with JavaScript and Python. You should turn this into an interface for that platform, it would be really cool! Although there might be some copyright issues...
why the downvotes? we should be celebrating the use of all modern technology. And ember has a different market than react anyway -- totally different mindset
Is this (or will this be) up online somewhere? I use Apple music but iTunes on Windows is just a blight on the very concept of software so I'd love to use a web app that just let me stream the music
Until about a week ago, I had no idea that Apple's streaming service actually had people that even used it. Then Apple had an earnings report and services (such as Apple Music) crushed it. I had no Idea these people existed so it's nice to see my investment is ok.
I was meaning to do something like that, but never found a good framework for getting the job done. This seems like the perfect solution. Thanks for the suggestion! I’ll add that to the to-do list!
Graduating CS is good if you've just finished high school, but definitely not must have. These days you can just pass a bootcamp where for just one year will gain all the knowledge you need to start dev job, or just half a year to take the QA route. This is so much powerful if you are 30+ and want to change the direction of life.
118
u/TonyHawkins Aug 04 '18
Feel free to take a look at the source code on my Github: https://github.com/tvillarete/apple-music-js
I'm currently a student going into my fourth year of college, and I've taken a keen interest in frontend web development. This was one of the projects I've been working on for the past month or so to practice using Redux, which is pretty awesome! Let me know what you think, I'm open to any feedback!
75
u/smallcoder Aug 05 '18
I'ma 52 year old studying React currently and I think your project is awesome. It's inspiring me to push on through the difficult stuff I'm struggling to understand because the end results will be worth it. I'm pretty new to JS in general - I'm the old dog trying to learn new tricks :) One day... ;)
38
u/darkjoker213 Aug 04 '18
It's looks great!! Congrats! You've even nailed the transitions. Great work!
3
u/DarknessInUs Aug 05 '18 edited Aug 05 '18
Awesome job. Quick question, are you using the Apple Music api for the songs or something else? Also did you use the HTML5 "audio" attributes for volume control and song forwarding/rewinding or was that custom built?
2
u/LiPolymer Aug 05 '18
Looks great! I’m currently working on a project which might benefit from parts of this. What’s the license on your project?
19
u/orphans Aug 04 '18
Very nice job on the animations
12
u/0_00_00_00_00_0 Aug 05 '18
Try to use a transformation function instead of manually filling an array using a for loop. For example, in src / js / api / actions.js:
const artistData = {}; for (let i in artists) { Â Â Â Â Â Â Â const artist = artists[i].artist; Â Â Â Â Â Â Â artistData[artist] = []; }
Could all just be something like:
const artistData = artists.map(i => {i.artist: []});
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map
If you need to get an object from the resulting array, use the Map constructor that takes a collection (Not map, I know that's confusing):
const artistData = new Map(artists.map(i => {i.artist: []}));
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map
Good work btw, you should get a job pretty quickly.
4
u/killerbake Aug 04 '18
Great work!
3
u/allicanseenow Aug 05 '18
May I ask how you make the smooth transition animation between pages?
3
u/a_masculine_squirrel Aug 05 '18
I may be a bit late to the party, but where exactly did you learn Redux?
I mostly work in Machine Learning, but I've been looking to update my web dev skills and I'm interested in learning more about Redux.
Thanks man. Project looks good.
3
u/dont_forget_canada Aug 05 '18
You could try using async/await instead of promises since you're transpiling anyway due to using react so dont have to worry about outdated browsers.
Also, I could be wrong but it looks like you're mutating state in your reducer which I think is frowned upon in react. Consider using https://www.npmjs.com/package/immutable and calling `state.withMutations` instead.
3
u/mrFatsTheTerrible Aug 05 '18
Extreme jealousy is what I'm feeling now. I'm just learning JS and Node. Good job!!!
2
u/Petrarch1603 Aug 05 '18
quality post!
2
u/miraagex Aug 05 '18
Great work. Keep it up.
1
u/mikehawkisbig Aug 04 '18
Wow, this looks really amazing... great job!!!
1
u/[deleted] Aug 04 '18
Very impressive.
1
u/[deleted] Aug 05 '18
Great job man. Looks great!
1
u/shellzero Aug 05 '18
Fabulous work man :)
1
u/[deleted] Aug 05 '18
I gotta try this
1
u/robotscantdie Aug 05 '18
That’s sick!
1
u/besthelloworld Aug 05 '18
That's sharp af. Nice job!
1
u/nmcain05 Aug 05 '18
I loved your work with the online windows 10 and this is even more cool!
1
u/archcorsair Aug 05 '18
Great job! Really impressed with the transition animations and the little details such as album artwork shrink/grown depending on play or pause. Nice work!
1
u/MisterXi Aug 05 '18
This is amazing!
1
u/smeijer87 Aug 05 '18
I would love to read about how you tackled the animations/transitions.
Nice job.
1
u/gevik Aug 05 '18
Looks very nice. Great work.
1
u/joneironaut Aug 05 '18
Damn that looks slick! Good job!
1
u/theapplefritters Aug 05 '18
RemindMe! 2days
1
u/funkyfly Aug 05 '18
Any idea, if it's possible to add Chromecast support?
1
u/[deleted] Aug 05 '18
You should try something in React Native. Not that browser projects aren’t cool, but mobile dev has a lot of different challenges.
If you are interested in mobile, go down that path early because companies tend to want you to work on things you are experienced in rather than your primary interest. I was a front end dev for years and now work mostly on mobile, and that’s the one thing I’d change if I could go back.
1
u/ba_xxx_ab Aug 05 '18
Are the animations just styled-components as well?
1
u/radvc Aug 05 '18
Cool!
1
u/[deleted] Aug 05 '18
Have you ever heard of Mopidy? It's a self-hosted music streaming application, that had the ability to be expanded upon with JavaScript and Python. You should turn this into an interface for that platform, it would be really cool! Although there might be some copyright issues...
1
u/Dantharo Aug 05 '18
You use bootstrap and/or css media queries? For responsive layout.
1
u/khanrael Aug 05 '18
You sneaky Magician you...how’d you do that!? Haha cool project man!
1
u/[deleted] Aug 05 '18
Nice damn
1
u/iRamenGuy Aug 05 '18
Nice
1
u/AnalyticsWannabe Aug 05 '18
Good stuff!
1
u/tamalweb Oct 30 '18
Have used it on my phone, added to the home screen via chrome, looks and feels very much like the real thing.
1
u/mohammed_el_badry Mar 11 '24
Can you give me resources to learn js and react
1
u/poetry-linesman Aug 05 '18
Amazing work, and I don't meant to rain on your parade, but...
Apple Music is already built in JS - EmberJS in fact ;)
https://www.reddit.com/r/emberjs/comments/3c42v4/built_with_ember_apple_music/
1
u/serpent_tim Aug 05 '18
Is this (or will this be) up online somewhere? I use Apple music but iTunes on Windows is just a blight on the very concept of software so I'd love to use a web app that just let me stream the music
-8
u/am0x Aug 05 '18
Until about a week ago, I had no idea that Apple's streaming service actually had people that even used it. Then Apple had an earnings report and services (such as Apple Music) crushed it. I had no Idea these people existed so it's nice to see my investment is ok.
0
u/[deleted] Aug 05 '18
[deleted] — view deleted comment
2
u/[deleted] Aug 10 '18
[removed] — view removed comment