Skip to content

intaen/learn-simple-music-playlist

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

Music Playlist

@intanmarsjaf

Mobile Apps Simple Music Playlist using Kotlin and Golang

So, I get task to make a simple apps like spotify (thats why I name the apps with spookify), and I make the simple apps, still no music player, just get the list of artist, genre, and song. I use two programming language to build this, golang for backend and kotlin for frontend. Stack in this apps are:

Golang:

  • RestAPI
  • MySql
  • Gorilla Mux

Kotlin:

  • Volley
  • Custom Array Adapter

Assets:

  • fonts.google.com

To run this apps, all you have to do:

  • Create database (I set up my database with name spookify)
  • Create table artists, genres, songs
CREATE TABLE artists (
	id INT PRIMARY KEY AUTO_INCREMENT,
    name VARCHAR(30),
    debut DATE,
    image_url longtext,
    category VARCHAR(30)
);

CREATE TABLE genres (
	id INT PRIMARY KEY AUTO_INCREMENT,
    type VARCHAR(30)
);

CREATE TABLE songs (
	id INT PRIMARY KEY AUTO_INCREMENT,
    artist_id INT,
    genre_id INT,
    title VARCHAR(45),
    image_url longtext,
    FOREIGN KEY (artist_id)
		REFERENCES artists(id),
	FOREIGN KEY (genre_id)
		REFERENCES genres(id)
);
  • Run main.go file and the server will start in localhost:8081
go run main.go
  • Then, open android studio and start emulator, klik l>, wait for awhile...
  • Because the database is empty, we have to add user
  • So, this is API for Spookify:

Insert Artist

http://localhost:8081/artist
{
	"name": "artist_name",
	"debut": "debut_date",
	"imageUrl": "http://link_img_of_artist",
	"category": "category_artist, ex: solo"
}

GetAll Artist

http://localhost:8081/artists

GetArtistByGenre

http://localhost:8081/artist/genre/{id}

Insert Genre

http://localhost:8081/genre
{
    "type": "genre_artist"
}

GetAll Genre

http://localhost:8081/genres

Insert Song

http://localhost:8081/song
{
    "artist_id": 1,
	"genre_id": 1,
	"title": "song_title",
	"image_url": "http://link_of_song_img"
}

GetAll Song

http://localhost:8081/songs

GetSongByArtist

http://localhost:8081/song/artist/{id}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published