"Mobile first" full stack web app for streaming music.
Clone this repository and set up a MySQL Server if you do not already have one.
-
Navigate to
/backend/models/sql/
-
Log in to the Database
-
Create a new database and user with privileges on that database
-
Run
use <YOUR DATABASE NAME>
-
Run
source create-tables.sql
-
Insert a row to the table
user
by running the following SQL statementINSERT INTO user (username, password, superuser) VALUES("<YOUR USERNAME>", "<YOUR BCRYPT HASHED PASSWORD>", 1)
You will have to hash the password yourself using any bcrypt hashing tool. This row will act as your admin account, you may create multiple if you want more than one admin. There is currently no use for non-admin users.
- Navigate to
/backend/
- Run the backend server with
DBUSER="<YOUR DATABASE USER>" DBPASS="<YOUR DATABASE PASSWORD>" DBNAME="<YOUR DATABASE'S NAME>" BACKEND_PORT=3000 UPLOADS_DIR_PREFIX="../frontend/public/" go run .
- Navigate to
/frontend/
- Run
npm install
and wait for it to complete. - Run
npm run dev
to start the vite dev server. - Open your browser and navigate to
localhost:5173
- Set up the Database like in the section above.
- Set up the frontend like above by running
npm install
inside/frontend/
- In the frontend directory, run
npx vite build
.- This builds a production ready build in
/frontend/dist/
, which you simply put inside/var/www/html/
(or another directory used by your web server)
- This builds a production ready build in
- Build the backend binary with
GOARCH="amd64" GOOS="linux" go build -o backend
- (you may replace the variables above with whatever is relevant to your server)
- Put this binary on your server somewhere, and create a systemd service or screen/tmux session for it.
- You must specify a different
UPLOADS_DIR_PREFIX
relevant to your deployment.- It should point to wherever you put the frontend dist files