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
.
- Create or login to your account
- Search your favorite podcast using iTunes API
- Save or remove podcast from the databse
- Create or remove folder for organizing your podcasts
- Mark podcasts as played
- Resuming podcast from where you left off
- Add or remove podcast from queue (Not integrated with frontend yet)
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:
User
-
[POST]
RegisterUrl:
/api/register
Body:
{ "name": string, "email": string, "username": string, "password": string }
Return:
{ "token": string, "user": User }
-
[POST]
LoginUrl:
/api/login
Body:
{ "email": string, "password": string }
Return:
{ "token": string, "user": User }
-
[POST]
ValidateUrl:
/api/validate
Body:
{ "token": string, }
Return:
{ "name": string, "email": string, "username": string, "password": string }
-
[POST]
LogoutUrl:
/api/logout
Body:
{ "token": string, }
Return:
string
Podcast
-
[POST]
Search All PodcastUrl:
/api/search-all
Body:
{ "podcastName": string }
Return:
{ "resultCount": int, "results": []Podcast }
-
[GET]
Search PodcastUrl:
/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 PodcastUrl:
/api/podcasts
Return:
[]Podcast
-
[GET]
Get PodcastUrl:
/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 PodcastUrl:
/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 PodcastUrl:
/api/podcast/{podId}
Return:
podId: int
Item
-
[GET]
All ItemUrl:
/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 FolderUrl:
/api/folders
Return:
[]Folder
-
[GET]
Get FolderUrl:
/api/folder/{folderId}
Return:
{ "id": int, "folderName": string, "podcasts": []Podcast }
-
[POST]
Save FolderUrl:
/api/folder
Body:
{ "folderName": string }
Return:
{ "id": int, "folderName": string, "podcasts": []Podcast }
-
[GET]
Check in FolderUrl:
/api/in-folder/{podId}
Return:
folderId: int
-
[GET]
Change FolderUrl:
/api/change-folder/{folderId}/{podId}
Return:
folderId: int
-
[DELETE]
Remove FolderUrl:
/api/folder/{folderId}
Return:
folderId: int
Queue
-
[GET]
Get All QueueUrl:
/api/queue
Return:
[ { "episode": Episode, "episodeId": int, "pos": int } ]
-
[POST]
Add to QueueUrl:
/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 QueueUrl:
/api/queue/{episodeId}
Return:
episodeId: int
Episode
-
[POST]
Mark as PlayedUrl:
/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 TimeUrl:
/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 }
Airel Camilo Khairan © 2023