Codync
免費、開源的 1:1 替代方案,取代 Grok Bot 與 Muse。從 iPhone、Mac 或 Linux 桌面將 Claude Code、Codex、Cursor 與 40+ 程式碼代理人作為持續機器人傳訊。群組聊天、主題串…
AI 翻譯
個人 GitHub 帳號下公開儲存庫的擁有者可以登入並驗證所有權,自行管理介紹,無需管理員核准。
登入並產生驗證檔案,在 30 分鐘內將其提交至此儲存庫的預設分支。其他分支或分叉儲存庫中的檔案無效。然後在下方檢查檔案,即可無需管理員核准直接管理專案。請保留檔案以維持管理權限。
如需登入,將前往登入頁面。登入後請回到此處,再次點擊所選的驗證按鈕。
在專案資料夾中執行 /nomorevibe verify,即可驗證所有權並自行管理介紹。
一分鐘完成驗證Spotify client built with Angular 15, Nx Workspace, ngrx, TailwindCSS and ng-zorro
翻譯準備中
取自儲存庫 README
正在載入完整 README。
檢視完整 README ↗A simple Spotify client built with Angular 15, Nx workspace, ngrx, TailwindCSS and ng-zorro.
I have recently shared about #angularspotify at AngularAir, you can watch the session here 👉 youtu.be/uPB0KHKlrU8
Check out the live application -> https://spotify.trungk18.com
Spotify premium is required for the Web Playback SDK to play music. If you are using a free account, you can still browse the app, but it couldn't play the music. Sorry about that 🤣
If you like my work, feel free to:
Thanks a bunch for stopping by and supporting me!
I still remember Window Media Player on windows has the visualization when you start to play the music, and I wanted to have the same experience when listening to Spotify. That is the reason I started this project.
I found that there weren't many resources on building a proper real-world scale application, and that's my focus for sharing. I made a Jira clone application as the first one for that purpose. Nx workspace is getting more and more attention from the Angular community, but people are always confused about how to architect and set up an Nx project. I hope Angular Spotify will give you more insight on that even though it is my first project using Nx 🤣
You know I am one of the moderators of Angular Vietnam. Recently, I also started Angular Singapore. This piece of work is my other long-term plan to bring Angular knowledge to more people. I desire to advocate and grow the Angular developer community in Singapore and Vietnam :)
ngneat/svg-icon and ngneat/until-destroytooltip, modal, slider, switch and more.I experimented with the ngrx/component store for AuthStore and UIStore. It might not be a best practice, and I will refactor it very soon. Just FYI 🤣
See my original notes on Nx workspace structure for NestJS and Angular
All components are following:
libs folder. New modules, new models, new configurations, new components etc... are in libs. libs should be separated into different directories based on existing apps. We won't put them inside the apps folder. For example in an Angular, contains the main.ts, app.component.ts and app.module.tsI followed the structure recommended by my friend @nartc. Below is the simplified version of the application structure.
.
└── root
├── apps
│ └── angular-spotify
└── libs
└── web (dir)
├── shell (dir)
│ ├── feature (angular:lib) - for configure any forRoot modules
│ └── ui
│ └── layout (angular:lib)
├── settings (dir)
│ ├── feature (angular:lib) - for configure and persist all settings
│ └── data-access (workspace:lib) - store and services for settings module
├── playlist (dir)
│ ├── data-access (angular:lib, service, state management)
│ ├── features
│ │ ├── list (angular:lib PlaylistsComponent)
│ │ └── detail (angular:lib PlaylistDetailComopnent)
│ └── ui (dir)
│ └── playlist-track (angular:lib, SCAM for Component)
├── visualizer (dir)
│ ├── data-access (angular:lib)
│ ├── feature
│ └── ui (angular:lib)
├── home (dir)
│ ├── data-access (angular:lib)
│ ├── feature (angular:lib)
│ └── ui (dir)
│ ├── featured-playlists (angular:lib, SCAM for Component)
│ ├── greeting (angular:lib, SCAM for Component)
│ └── recent-played (angular:lib, SCAM for Component)
└── shared (dir)
├── app-config (injection token for environment)
├── data-access (angular:lib, API call, Service or State management to share across the Client app)
├── ui (dir)
├── pipes (dir)
├── directives (dir)
└── utils (angular:lib, usually shared Guards, Interceptors, Validators...)
⚠️ Migration Notice: This application previously used the
Implicit Grant Flow, which will be sunset on November 27, 2025. The application has been migrated to use Authorization Code with PKCE flow, which is the recommended approach for client-side only applications that don't involve secret keys.
I follow the Authorization Code with PKCE flow that Spotify recommends for client-side only applications. This flow provides better security than the deprecated Implicit Grant Flow and includes refresh tokens to extend access when tokens expire.
View the Spotify Authorization Guide and Authorization Code PKCE Tutorial
Angular Spotify Web PlayersequenceDiagram
participant User
participant App as Angular App
participant AuthStore as AuthStore
participant Spotify as Spotify Accounts
participant API as Spotify Web API
User->>App: Opens Application
App->>AuthStore: initAuth()
AuthStore->>AuthStore: Check URL for authorization code
alt First Login: Authorization Code Present
AuthStore->>AuthStore: handleFirstLogin(code)
AuthStore->>API: POST /api/token<br/>(code + code_verifier)
API->>AuthStore: Return access_token & refresh_token
AuthStore->>AuthStore: Save tokens to localStorage
AuthStore->>App: Dispatch AuthReady
else No Code: Check Existing Tokens
alt No Tokens Found
AuthStore->>AuthStore: Generate code_verifier (128 chars)
AuthStore->>AuthStore: Generate code_challenge (SHA256)
AuthStore->>AuthStore: Store code_verifier
AuthStore->>Spotify: Redirect to /authorize<br/>(with code_challenge)
Spotify->>User: Authorization Dialog
User->>Spotify: Approve Access
Spotify->>App: Redirect with code
Note over App: Loop back to "First Login"
else Token Expired
AuthStore->>AuthStore: handleTokenRefresh()
AuthStore->>API: POST /api/token<br/>(refresh_token grant)
API->>AuthStore: Return new tokens
AuthStore->>AuthStore: Save tokens to localStorage
AuthStore->>App: Dispatch AuthReady
else Token Valid
AuthStore->>AuthStore: handleValidToken()
AuthStore->>App: Dispatch AuthReady
end
end
Nx provides an dependency graph out of the box. To view it on your browser, clone my repository and run:
npm run dep-graph
A simplified graph looks like the following. It gives you insightful information for your mono repo and is especially helpful when multiple projects depend on each other.
Having Nx Cloud configured shortens the deployment time quite a lot.
Nx Cloud pairs with Nx in order to enable you to build and test code more rapidly, by up to 10 times. Even teams that are new to Nx can connect to Nx Cloud and start saving time instantly. Visit Nx Cloud to learn more.
I set a tentative deadline for motivating myself to finish the work on time. Otherwise, It will take forever to complete :)
March 01 - 28, 2021
Let work on it together!
I scheduled a few live stream sessions to show you how I continue developing Angular Spotify. Follow my twitter for the latest updates. See the scheduled events.
| # | Time | Description/Link |
|---|---|---|
| 1 | Sat, 3rd April 2021, 10AM | Structure your Angular application with Nx workspace |
| 2 | Sat, 10th April 2021, 10AM | Build the album list page |
| 3 | Sat, 17th April 2021, 10AM | Build the album detail page - part 1 |
| 4 | Sat, 24th April 2021, 10AM | Build the album detail page - part 2 |
| 5 | Sat, 8th May 2021, 10AM | Build the artist detail page - part 1 |
| 6 | Sat, 15th May 2021, 10AM | Build the artist detail page - part 2 |
| 7 | Sat, 12th Jun 2021, 10AM | Build the track list page - part 1 |
| 8 | Sat, 19th Jun 2021, 10AM | Build the track list page - part 2 |
| 9 | Sun, 11th July 2021, 10AM | NgRx Component Store Unit Testing |
| 10 | TBD | Config Nx build:affected with Github action |
I will also do some refactoring with @nartc for Angular Vietnam Office Hours. More detail is coming soon.
I have received some invitations to talk about Angular Spotify from the community. You can watch my talks below 🙂
| # | Time | Description/Link |
|---|---|---|
| 1 | Wed, 21st April 2021 | BLS SHOW & TELL - Angular Spotify |
| 2 | Fri, 08th May 2021 | AngularAir - Another 1k stars repository |
It is a side project that I only spent time outside of the office hours to work on. I initially planned to complete the project within two weeks, but the first two weekends were not very productive, maybe because of the holiday mood from Lunar New Year :) But once the lego blocks are getting together, I feel the rhythm, and I know it has to be finished by the end of March.
I couldn't get the full-time report from waka time because it only shows me the latest two weeks. 🤣
I have spent approximately 50 hours working on this project, which is almost the same amount as the first version of jira.trungk18.com.
The visualizer was the most exciting feature, and I decided to start this project because of that single component.
Not all components have properly defined aria attributes, visual focus indicators, etc.
git clone https://github.com/trungk18/angular-spotify.gitcd angular-spotifynpm start for starting Angular web applicationhttp://localhost:4200/I skipped writing test for this project.
Web Playback SDK supports Chrome, Firefox, Edge, IE 11, or above running on Mac/Windows/Linux.
It doesn't support Safari or any mobile browser on Android or iOS
View completed list of supported browsers
If you have any ideas, just open an issue and tell me what you think.
If you'd like to contribute, please fork the repository and make changes as you'd like. Pull requests are warmly welcome.
Special thanks to my friend @nartc, who helped me review the code early.
| Resource | Description |
|---|---|
| @koel/koel | A cool player made by @phanan, I reused the visualizer code from this repo with my additional customization |
| beeman/component-store-playground | A nice example of using Nx with ngrx/component-store, I refer to the project structure from this repo |
| Start using ngrx/effects for this | An excellent write up by Tim Deschryver |
Feel free to use my code on your project. Please put a reference to this repository.