Skip to content

LuchoRivas/spotylist

Repository files navigation

Spotylist

This workspace has been generated by Nx, a Smart, fast and extensible build system.

This is a small project I developed in my spare time to explore and test the Spotify API. The application allows users to log in, view their playlists, and manage the order of songs through an interactive interface.

Features

  • User Authentication: Log in with your Spotify account to access your playlists.
  • Playlist Viewing: View all the playlists you have created in your Spotify account.
  • Playlist Details: Access a detailed view of each playlist, showing all the songs it contains.
  • Song Reordering: Use the dnd-kit library to drag and drop songs within a table, easily adjusting their order.

Technologies Used

  • Nx: Used to manage both frontend and backend in a monorepo.
  • React: Frontend implementation, including routing libraries and dnd-kit for drag-and-drop functionality.
  • NodeJS: Backend implementation and handling of the Spotify API.

Installation and Running

  1. Clone this repository.
  2. Install dependencies with npm install or yarn install.
  3. Configure your Spotify API credentials.
  4. To start the frontend, run npm run start-front. Open your browser and navigate to http://localhost:3000/
  5. To start the backend, run npm run start-back.

Setting Up Spotify API Credentials

  1. Go to the Spotify Developer Dashboard.
  2. Log in and navigate to the dashboard.
  3. Click on the "Create App" button to create a new app.
  4. Configure the Redirect URIs by adding the following:
  • http://localhost:3000/callback
  • http://localhost:3000
  1. Once the app is created, note down the Client ID and Client Secret.

Environment File (.env) / Miscellaneous Notes

Create a .env file at the root level of the monorepo with the following content:

CLIENT_ID=<your_client_id>
API_BASE_URL=http://localhost:4000
BASE_URL=http://localhost:3000
CLIENT_SECRET=<your_client_secret>
PORT=4000

Notes:

It's important that the API runs on port 4000. I couldn't manage to use the environment file (common/src/lib/api-client.ts).

Generate code

If you happen to use Nx plugins, you can leverage code generators that might come with it.

Run nx list to get a list of available plugins and whether they have generators. Then run nx list <plugin-name> to see what generators are available.

Learn more about Nx generators on the docs.

Running tasks

To execute tasks with Nx use the following syntax:

nx <target> <project> <...options>

You can also run multiple targets:

nx run-many -t <target1> <target2>

..or add -p to filter specific projects

nx run-many -t <target1> <target2> -p <proj1> <proj2>

Targets can be defined in the package.json or projects.json. Learn more in the docs.

Want better Editor Integration?

Have a look at the Nx Console extensions. It provides autocomplete support, a UI for exploring and running tasks & generators, and more! Available for VSCode, IntelliJ and comes with a LSP for Vim users.

Ready to deploy?

Just run nx build demoapp to build the application. The build artifacts will be stored in the dist/ directory, ready to be deployed.

Set up CI!

Nx comes with local caching already built-in (check your nx.json). On CI you might want to go a step further.

Connect with us!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published