rediahmds / open-music-api-dcd

A Simple REST API that implements CRUD (Producer)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

🎼 OpenMusic (Producer)

OpenMusic is a backend service that implements CRUD operation. It allows you to add song, playlist, albums, collaborate a playlist, with authentication and authorization feature.

Here's the link to the consumer source code

📑 Major Topics Covered in Each Version

1️⃣ OpenMusic V1

  1. This version introduces a "cleaner" way to create a RESTful API using the Hapi plugin.
  2. Validation is done using Joi.
  3. Using node-postgres to interact with PostgreSQL in a Node app.
  4. Implements the migration technique to manipulate table structures using pgm.

✅ OpenMusic V1: To-do List

  • Mandatory criteria
    • CRUD /albums endpoint (use plugin)
    • CRUD /songs endpoint (use plugin)
    • Data validation on both endpoints using Joi
    • Error handling (use onPreResponse event extension from Hapi)
    • Use database and dotenv
  • Optional criteria
    • Display a list of songs in an album
    • Query parameter for song search
  • Fulfill all Postman requests (API testing)
  • Use ESLint and one of the style guides
  • Clean code

💡 OpenMusic V1: Tips

  • To avoid binding errors:
    • Use arrow functions in route files (preferred, lighter, no need to install any packages)
    • Use the auto-bind package.

OpenMusic V1: Summary

OpenMusic V1 implements hapi plugin, validation and database.

2️⃣ OpenMusic V2

  1. Implements authentication and authorization using token based schema, JWT specifically.
  2. Learn how to normalize a database.
  3. Implements foreign key
  4. Introduces a way to implement collaboration feature.

✅ OpenMusic V2: To-do List

  • Mandatory Criteria
    • Implements user registration and authentication
    • Playlist management feature
    • Implements foreign key in tables
    • Data validation
    • Error Handling
    • Maintain the OpenMusic V1 features
  • Optional Criteria
    • Playlist collaboration feature
    • Playlist activities history
    • Maintain the OpenMusic V1 features

💡 OpenMusic V2: Tips

For references, follow the ERD provided by dicoding. This is optional tho.

OpenMusic V2: Summary

OpenMusic V2 implements authentication & authorization using jwt, normalize and use foreign key in a database, also learn how to create simple collaboration feature.

To create a new account (sign up), clients should use the POST /users endpoint. To log in to an existing account, they should use the POST /authentications endpoint.

3️⃣ OpenMusic V3

  1. Implements message broker using rabbitmq to decouple services and reduce server workload.
  2. Use FS or Amazon S3 Bucket to store object.
  3. Implements server-side caching with Redis or Memurai.

✅ OpenMusic V3: To-do List

This time, there's no optional criteria, everything are mandatory.

  • Export songs in playlists
  • Upload album cover
  • Ability to like/favorites a specific album
  • Implements server-side caching.
  • Maintain OpenMusic V1 & V2

💡 OpenMusic V3: Tips

  • For reference, they provides ERD to follow. It is students choice to use the ERD they've provided.
  • Run postman tests sequentially and exclude Upload tests before running a collection. For Upload tests tho, it has to run without collections, it will always be failed otherwise.
  • Create an object to only store sensitive information. So, it will replace the process.env.XXX syntax.

OpenMusic V3: Summary

OpenMusic V3 implements a message broker using RabbitMQ to decouple services and reduce server workload. It allows the use of either FS or Amazon S3 Bucket to store objects and introduces server-side caching with Redis or Memurai.

ℹ️ More Information

About

A Simple REST API that implements CRUD (Producer)


Languages

Language:JavaScript 100.0%