dbdocs.io is a free, simple tool to create web-based documentation for your database. This guide will help you set up and start using dbdocs in less than 5 minutes.
Make sure NodeJS and NPM have been installed on your computer before the installation.
Run the following command in the terminal:
Note that in some cases, you need to add sudo to your command so npm can install dbdocs globally.
Execute dbdocs command to check that it has already been installed and preview some commands.
To work with dbdocs, define your database schema using DBML - a simple and open-source DSL language. We recommend you use Visual Studio Code as you can install DBML Language Support package that comes with it, but any other editors will work just as fine.
Before generating dbdocs view, you need to login by executing the following command
A login page will appear in your browser. It requires you to login with your GitHub account, click Continue with GitHub, then copy and paste your token to the terminal where it asks "Please input your authentication token".
Open the folder which contains your dbml file in terminal, then generate dbdocs view by the following command.
You will receive a warning that password is not set for your project, read the privacy instruction below to know how to protect your project.
The last step provides you with a link to visit your database documentation. In our example, visit: https://dbdocs.io/khanh-tran-quoc/Ecommerce to take a look.
Your dbdocs project is set to be public by default. However, you can follow the following command to protect it with a password.
Or you can build your project with password by using build command with --password
Now your project is protected, only the one who have your password can access your project.
Remove password from your project to make it public
You can use your unique access token to update projects with continuous integration (CI) systems:
First, generate your access token on local after logged in.
Then add DBDOCS_TOKEN as a new environment variable in your CI machine.
It's done! Now you can run dbdocs build command on your CI without login actions.
You can try it out with our GitHub's Actions quick setup
Remove your existing token with this command
You can simply remove your project by remove command
By now, you've successfully set up dbdocs.io . A few things we'd suggest you do as the next steps: