Front-end only development environment
This guide is to start developing on vocaDB front-end only. This bypasses the need to set up the back-end, run the server locally and set up a database. By connecting to the VocaDB beta website you are able to develop locally with minimal setup. Do mind that if you have only recently created your account, it might not yet be available on the beta website and you will be unable to log in. Any other functionality should work as expected.
Requirements
- Visual Studio Code
- Extensions:
- Node.js v12.18.3 (or latest LTS) with NPM.
Step-by-step first setup
-
Ensure you have all the requirements installed.
-
Clone the repository and its submodules.
git clone https://github.com/vocadb/vocadb.git --recurse-submodules cd vocadb -
Open the VocaDB project in Visual Studio.
-
Prepare the vite configuration file. See vite.config section for more information.
-
Build the frontend using Node.js. See Compiling frontend assets section for more information.
- Right click
VocaDbWebon the Solution Explorer in the right and select the Open in Terminal option. - Install dependencies by running
npm installon the Terminal. - Build assets by running
npm run developmenton the Terminal.
- Right click
-
You should now be able to start developing.
Formatting
Line endings and indentation are configured by EditorConfig. There’s a plugin for almost any major IDE/text editor. Please install that plugin before editing the code files.
For the frontend located on VocaDbWeb, Prettier and ESLint is used to ensure code quality. You can use plugins to enhance the use of them.
Visual Studio Code
The following extensions are recommended in the VocaDbWeb folder.
These configuration is recommended for better formatting on Visual Studio Code. Open the Settings screen (by pressing F1 and press Preferences: Open Settings (UI) or File (on the top left) > Preferences > Settings) and change these settings.
- Editor: Default Formatter: Prettier - Code formatter esbenp.prettier-vscode
- Editor: Format on Save: checked
vite.config
Navigate to VocaDbWeb\vite.config.ts. Here you will see a configuration file that currently points to 'https://localhost:5001' in two locations locations. Replace the value with 'https://beta.vocadb.net' to connect to the VocaDB beta server.
Compiling frontend assets
Ensure Node.js is installed and VocaDbWeb is opened on the Terminal of Visual Studio Code before running these commands.
Install the frontend dependencies by running this command.
npm install
Run this command so that Vite will automatically recompile your assets when it detects a change.
npm run development