https://github.com/ikhsan3adi/open-music-api
OpenMusic API Submission dicoding intermediate
https://github.com/ikhsan3adi/open-music-api
hapi-plugin javascript nodejs postgresql
Last synced: 4 months ago
JSON representation
OpenMusic API Submission dicoding intermediate
- Host: GitHub
- URL: https://github.com/ikhsan3adi/open-music-api
- Owner: ikhsan3adi
- Created: 2023-06-09T16:30:21.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2023-08-04T11:59:34.000Z (over 2 years ago)
- Last Synced: 2025-08-26T09:32:32.874Z (6 months ago)
- Topics: hapi-plugin, javascript, nodejs, postgresql
- Language: JavaScript
- Homepage:
- Size: 180 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Open Music API
This readme provides an overview and instructions for setting up the Open Music API project using Hapi.js, Redis, PostgreSQL, and RabbitMQ.
## Table of Contents
- [Introduction](#introduction)
- [Prerequisites](#prerequisites)
- [Installation](#installation)
- [Configuration](#configuration)
- [Usage](#usage)
- [Endpoints](#endpoints)
- [Contributing](#contributing)
- [License](#license)
## Introduction
The Open Music API project is a RESTful API that allows users to manage and access music data. It is built using Hapi.js as the server framework, Redis for caching, PostgreSQL as the database, and RabbitMQ for message queuing.
## Prerequisites
Before setting up the project, make sure you have the following prerequisites installed:
- Node.js and npm
- Redis
- PostgreSQL
- RabbitMQ
## Installation
1. Clone the repository: `git clone https://github.com/ikhsan3adi/open-music-api.git`
2. Navigate to the project directory: `cd open-music-api`
3. Install the dependencies: `npm install`
## Configuration
1. Create a `.env` file in the project root directory.
2. Configure the following environment variables in the `.env` file:
- `HOST` : The hostname of the server.
- `PORT` : The port on which the server will run.
- `PGHOST` : The hostname of the PostgreSQL database.
- `PGPORT` : The port number of the PostgreSQL database.
- `PGDATABASE` : The name of the PostgreSQL database.
- `PGUSER` : The username for accessing the PostgreSQL database.
- `PGPASSWORD` : The password for accessing the PostgreSQL database.
- `REDIS_SERVER` : The hostname of the Redis server.
- `RABBITMQ_SERVER` : The hostname of the RabbitMQ server.
## Usage
To start the server, run the following command: `npm start`
## Endpoints
The Open Music API provides the following endpoints:
- `GET /songs` : Get a list of all songs.
- `GET /songs/{songId}` : Get details of a specific song.
- `POST /songs` : Add a new song.
- `PUT /songs/{songId}` : Update details of a specific song.
- `DELETE /songs/{songId}` : Delete a specific song.
Other endpoints coming soon!