Mobile first website (with backend) for streaming music.
Clone this repository and set up a MySQL Server if you do not already have one.
- Create a database and write down the name as an environment variable in .env (default is "dotify")
- Create a new user and grant all permissions on the database you just created.
- Write down the username and password in
/scripts/.env
- Run
source scripts/.env
to use the variables. - In the MySQL cli, source the sql scripts located in
/scripts/
- Copy your music albums as their own folders inside
/frontend/public/audio/
- Make sure your files and directories have no spaces or otherwise problematic characters (you can use the cli program
detox
for this)
- Make sure your files and directories have no spaces or otherwise problematic characters (you can use the cli program
- Navigate to
/frontend/public/
and use the included shell functionaddalbums audio/
(sourced by .env)- This builds an sql script at
/scripts/generated.sql
which inserts all songs (sourced recursively below the specified directory) into the database - It is important that you run the function from the html root directory (
/frontend/public/
in the case of the dev server). The script depends on this to enter the correct path of each song into the database.
- This builds an sql script at
- Navigate to
/scripts/
(note the newly generated/scripts/generated.sql
file)- Launch the mysql shell as the appropriate user at the appropriate database
source generated.sql
(This will insert every song into the database)
- Build the binary with
go build .
- Make sure you sourced
/scripts/.env
- Run the built binary.
-
Navigate to
/frontend/
-
Run npm install` and wait for it to complete.
-
Navigate to
/frontend/
and runnpm 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 Backend like above.
- Set up the frontend like above.
- 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