Skip to content

Podvoyage is a podcast player application. With Podvoyage, you can easily search your favorite podcasts, save it for later, and listen to it. This project utilizes Golang for programming languange. Supabase for the database system, and Google Cloud Run for deployment.

Notifications You must be signed in to change notification settings

airelcamilo/podvoyage-backend

Repository files navigation

Podvoyage Backend

Welcome to the backend code repository for Podvoyage, a podcast player application. With Podvoyage, you can easily search your favorite podcasts, save it for later, and listen to it. This project utilizes Golang, accompanied with packages, such as gorm, mux, and cors. Also this project uses Supabase for the database system and deployed using Google Cloud Run.

Features

  1. Create or login to your account
  2. Search your favorite podcast using iTunes API
  3. Save or remove podcast from the databse
  4. Create or remove folder for organizing your podcasts
  5. Mark podcasts as played
  6. Resuming podcast from where you left off
  7. Add or remove podcast from queue (Not integrated with frontend yet)

Getting Started

Using local postgreSQL database, in db.go change

os.Getenv("SUPABASE_DB") -> "host=localhost user=postgres password=postgres dbname=podvoyage port=5432"

Then, add the podvoyage database:

CREATE DATABASE podvoyage;

With your database in place, initiate the development server:

cd .\cmd\podvoyage\
go run main.go

Open http://localhost:4000 and you can start interacting with the API.

In this repository, there also provided a comprehensive Postman collection:

  1. Postman Podvoyage environment
  2. Postman Podvoyage collection
  3. Postman User collection

Available API Calls

User
  • [POST] Register

    Url:

    /api/register
    

    Body:

    {
      "name": string,
      "email": string,
      "username": string,
      "password": string
    }

    Return:

    {
      "token": string,
      "user": User
    }
  • [POST] Login

    Url:

    /api/login
    

    Body:

    {
      "email": string,
      "password": string
    }

    Return:

    {
      "token": string,
      "user": User
    }
  • [POST] Validate

    Url:

    /api/validate
    

    Body:

    {
      "token": string,
    }

    Return:

    {
      "name": string,
      "email": string,
      "username": string,
      "password": string
    }
  • [POST] Logout

    Url:

    /api/logout
    

    Body:

    {
      "token": string,
    }

    Return:

    string
Podcast
  • [POST] Search All Podcast

    Url:

    /api/search-all
    

    Body:

    {
      "podcastName": string
    }

    Return:

    {
      "resultCount": int,
      "results": []Podcast
    }
  • [GET] Search Podcast

    Url:

    /api/search-pod/{trackId}
    

    Return:

    {
      "id": int,
      "trackId": int,
      "trackName": string,
      "artistName": string,
      "feedUrl": string,
      "artworkUrl600": string,
      "desc": string,
      "link": string,
      "categories": []Category,
      "episodes": []Episode
    }
  • [GET] Get All Podcast

    Url:

    /api/podcasts
    

    Return:

    []Podcast
  • [GET] Get Podcast

    Url:

    /api/podcast/{podId}
    

    Return:

    {
      "id": int,
      "trackId": int,
      "trackName": string,
      "artistName": string,
      "feedUrl": string,
      "artworkUrl600": string,
      "desc": string,
      "link": string,
      "categories": []Category,
      "episodes": []Episode
    }
  • [POST] Save Podcast

    Url:

    /api/podcast
    

    Body:

    {
      "id": int,
      "trackId": int,
      "trackName": string,
      "artistName": string,
      "feedUrl": string,
      "artworkUrl600": string,
      "desc": string,
      "link": string,
      "categories": []Category,
      "episodes": []Episode
    }

    Return:

    {
      "id": int,
      "trackId": int,
      "trackName": string,
      "artistName": string,
      "feedUrl": string,
      "artworkUrl600": string,
      "desc": string,
      "link": string,
      "categories": []Category,
      "episodes": []Episode
    }
  • [DELETE] Remove Podcast

    Url:

    /api/podcast/{podId}
    

    Return:

    podId: int
Item
  • [GET] All Item

    Url:

    /api/all
    

    Return:

    [
      {
        "id": int,
        "type": string,
        "name": string,
        "artistName": string,
        "artworkUrl": string,
        "podcastId": int,
        "trackId": int,
        "folderId": int,
        "pos": int
      }
    ]
Folder
  • [GET] Get All Folder

    Url:

    /api/folders
    

    Return:

    []Folder
  • [GET] Get Folder

    Url:

    /api/folder/{folderId}
    

    Return:

    {
      "id": int,
      "folderName": string,
      "podcasts": []Podcast
    }
  • [POST] Save Folder

    Url:

    /api/folder
    

    Body:

    {
      "folderName": string
    }

    Return:

    {
      "id": int,
      "folderName": string,
      "podcasts": []Podcast
    }
  • [GET] Check in Folder

    Url:

    /api/in-folder/{podId}
    

    Return:

    folderId: int
  • [GET] Change Folder

    Url:

    /api/change-folder/{folderId}/{podId}
    

    Return:

    folderId: int
  • [DELETE] Remove Folder

    Url:

    /api/folder/{folderId}
    

    Return:

    folderId: int
Queue
  • [GET] Get All Queue

    Url:

    /api/queue
    

    Return:

    [
      {
      "episode": Episode,
      "episodeId": int,
      "pos": int
      }
    ]
  • [POST] Add to Queue

    Url:

    /api/queue
    

    Body:

    {
      "id": int,
      "podcastId": int,
      "trackId": int,
      "title": string,
      "desc": string,
      "season": int,
      "date": string,
      "duration": int,
      "audio": string,
      "played": bool,
      "currentTime": int
    }

    Return:

    {
      "id": int,
      "podcastId": int,
      "trackId": int,
      "title": string,
      "desc": string,
      "season": int,
      "date": string,
      "duration": int,
      "audio": string,
      "played": bool,
      "currentTime": int
    }
  • [DELETE] Remove in Queue

    Url:

    /api/queue/{episodeId}
    

    Return:

    episodeId: int
Episode
  • [POST] Mark as Played

    Url:

    /api/played/{episodeId}
    

    Body:

    {
      "id": int,
      "podcastId": int,
      "trackId": int,
      "title": string,
      "desc": string,
      "season": int,
      "date": string,
      "duration": int,
      "audio": string,
      "played": bool,
      "currentTime": int
    }

    Return:

    {
      "id": int,
      "podcastId": int,
      "trackId": int,
      "title": string,
      "desc": string,
      "season": int,
      "date": string,
      "duration": int,
      "audio": string,
      "played": bool,
      "currentTime": int
    }
  • [POST] Set Current Time

    Url:

    /api/folder/{id}
    

    Body:

    {
      "id": int,
      "podcastId": int,
      "trackId": int,
      "title": string,
      "desc": string,
      "season": int,
      "date": string,
      "duration": int,
      "audio": string,
      "played": bool,
      "currentTime": int
    }

    Return:

    {
      "id": int,
      "podcastId": int,
      "trackId": int,
      "title": string,
      "desc": string,
      "season": int,
      "date": string,
      "duration": int,
      "audio": string,
      "played": bool,
      "currentTime": int
    }

Credit

Airel Camilo Khairan © 2023

About

Podvoyage is a podcast player application. With Podvoyage, you can easily search your favorite podcasts, save it for later, and listen to it. This project utilizes Golang for programming languange. Supabase for the database system, and Google Cloud Run for deployment.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published