VocaDB development environment (Linux)
note: this has only been tested on linux mint 20.2 (ubuntu 20.04), but it should work on other linux distributions as well.
Install git
sudo apt install git
for more information, see download for linux and unix.
Clone the repo
git clone https://github.com/vocadb/vocadb.git --recurse-submodules
cd vocadb
Install VSCode
go to https://code.visualstudio.com/ and download for linux.
Install .net 7
make sure your system installed the .net dependencies and requirements.
download the dotnet-install script from https://dot.net/v1/dotnet-install.sh. when your download completes, open a terminal and run the following commands.
./dotnet-install.sh -c current
export dotnet_root=$home/.dotnet
export path=$path:$home/.dotnet
you can install a specific version by altering the -c
parameter to indicate the specific version. the following command installs .net sdk 5.0.
./dotnet-install.sh -c 7.0
verify installation by running the dotnet
command in your terminal.
dotnet --version
Install node.js and npm
curl -fssl https://deb.nodesource.com/setup_16.x | sudo -e bash -
sudo apt-get install -y nodejs
verify installation by running the following commands in your terminal.
node --version
npm --version
for more information, see installing node.js via package manager.
Install SQL Server
Native installation
Docker
assuming you already have a working docker installation
create a docker-compose.yml
file.
version: "3.9"
services:
db:
image: mcr.microsoft.com/mssql/server:2022-latest
container_name: vocadb-dev-db
environment:
- accept_eula=y
- mssql_sa_password=y0urv0c@dbstr0ngp@ssw0rd
volumes:
- ./db:/var/opt/mssql
- <your other directory on host>:<some directory in container> # this is how you share files between host machine and the container
ports:
- 1433:1433
cap_add:
- sys_ptrace
user: 0:0 # currently i don't know how to run without root, so i have to put 0:0 here to run with root
at the directory of the docker-compose.yml
file, run docker compose up -d
to bring up the sql server. the database content will be persisted in the ./db
directory in the host machine.
to stop the server, run docker compose down
.
for more information, see quickstart: run sql server linux container images with docker
Create a new database
Native installation
connect to your new sql server instance, and create a new database named vocaloidsite
.
create database vocaloidsite
go
download the schema creation script and run it against that database.
example:
sqlcmd -u login_id -s localhost -d vocaloidsite -i ./empty-mssql.sql
Docker
first, connect into the docker container (assuming the container_name
is still vocadb-dev-db
in the docker-compose.yml
example).
docker exec -it vocadb-dev-db bash
then, inside the docker container, connect to the database.
/opt/mssql-tools/bin/sqlcmd -s localhost -u sa -p "y0urv0c@dbstr0ngp@ssw0rd"
at this point, you can follow the method for the native installation.
to download the schema creation script into the container, you can first download it in the host machine, then bind mount it into the container. then, connect to the docker container again, and run the script against the database.
/opt/mssql-tools/bin/sqlcmd -s localhost -u sa -p "y0urv0c@dbstr0ngp@ssw0rd" -i /where/you/mount/the/empty-mssql.sql
Install fluentmigrator
install the dotnet-fm
tool.
dotnet tool install -g fluentmigrator.dotnet.cli
export path="$path:$home/.dotnet/tools/"
cd ./vocadb.migrations
dotnet build
execute the migration.
dotnet-fm migrate -p sqlserver -c "data source=.; initial catalog=vocaloidsite; trusted_connection=true;" -a "./bin/debug/net472/vocadb.migrations.dll"
connection string example:
"data source=localhost;initial catalog=vocaloidsite;integrated security=false;user id=as;password=y0urv0c@dbstr0ngp@ssw0rd;multipleactiveresultsets=true;"
if you encounter an error related to kerberos, you may need to update the connection string with integrated security=false;
.
for other errors, you may need to install the .net 5 sdk to perform the migration. although it should work with .net 7.
for more information see starting with fluentmigrator.
Minimal configuration
Compiling assets
see compiling assets.
Starting the server
cd ./vocadbweb
dotnet build
dotnet run
visit http://localhost:5000.