Skip to content

Latest commit

 

History

History
200 lines (122 loc) · 5.56 KB

developer-guide.md

File metadata and controls

200 lines (122 loc) · 5.56 KB

Developer Guide

This guide helps you get started developing APITable.

Dependencies

Make sure you have the following dependencies and programming languages installed before setting up your developer environment:

Programming Language

If you are using macOS or Linux. We recommend install programming language with SDK manager sdkman and nvm.

# quick install nvm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh | bash
# quick install sdkman
curl -s "https://get.sdkman.io" | bash
# install nodejs 
nvm install 16.15.0 && nvm use 16.15.0 && corepack enable
# install java development kit
sdk env install
# install rust toolchain
curl -sSf https://sh.rustup.rs | sh -s -- --default-toolchain nightly --profile minimal -y && source "$HOME/.cargo/env"

macOS

We recommend using Homebrew for installing any missing dependencies:

## necessary required
brew install git
brew install --cask docker
brew install make
brew install pkg-config cairo pango libpng jpeg giflib librsvg pixman

Linux

On CentOS / RHEL or other Linux distribution with yum

sudo yum install git
sudo yum install make

On Ubuntu / Debian or other Linux distribution with apt

sudo apt update
sudo apt install git
sudo apt install make

Windows

If you are running APITable on Windows 10/11, we recommend installing Docker Desktop on Windows, Ubuntu on WSL and Windows Terminal, You can learn more about Windows Subsystem for Linux (WSL) in the official site.

Install missing dependencies on Ubuntu using apt:

sudo apt update
sudo apt install git
sudo apt install make

What Build Tool we use?

We use make as our centric build tool entry that drives other build tool like gradle / npm / yarn.

So you can just input make command and see all build commands:

make

make command screenshot

How to start development environment?

APITable consists of 3 processes:

  1. backend-server
  2. room-server
  3. web-server

To start the development environment locally, run these commands:

# start databases in dockers
make dataenv 

# install dependencies
make install 

#start backend-server
make run # enter 1  

# and then switch to a new terminal
# start room-server
make run # enter 2

# and then switch to a new terminal
# start web-server
make run # enter 3

What IDE should you use?

We recommend you use Visual Studio Code or Intellij IDEA for your IDE.

APITable have prepared these two IDE's debug configs.

Just open APITable's root directory with IDE.

How to contribute translations?

We have two ways to improve the translation of APITable:

  1. You can modify the markdown files in source code and create a PR directly
  2. Join our Crowdin to find the strings to modify

In the collaboration of multilingual translation, we follow the following process:

Screenshot of multilingual translation process

How to configure the SMTP server?

By default, APITable doesn't configure the SMTP server, which means you cannot invite users since it require the email sending feature.

It is needed to modify .env configuration using self email, and restart backend server.

MAIL_ENABLED=true
MAIL_HOST=smtp.xxx.com
MAIL_PASSWORD=your_email_password
MAIL_PORT=465
MAIL_SSL_ENABLE=true
MAIL_TYPE=smtp
MAIL_USERNAME=your_email

In addition, some mailboxes need to be enabled in the background to use smtp. For details, you can search for xxx mailbox smtp tutorial.

Performance problem under macOS M1 docker run?

Where is the API documentation?

You can access the API documentation by starting a local server:

  1. The documentation address for the Backend server is: http://localhost:8081/api/v1/doc.html

  2. The documentation address for the Room server is: http://localhost:3333/nest/v1/docs

If you are interested in cloud service API interfaces, you can also directly access the online API documentation at https://developers.apitable.com/api/introduction.

How to set the limitation of widget quantity in dashboard? (30 by default)

This can be achieved by setting the DSB_WIDGET_MAX_COUNT parameter in the .env file.

Can I increase request rate limit of the API? (5 by default)

In the .env.default file of room-server, there are two parameters that can adjust request frequency:

  1. You can set LIMIT_POINTS and LIMIT_DURATION to indicate the number of requests that can be made in a unit time period. Where LIMIT_POINTS is the number of times and LIMIT_DURATION is the duration, measured in seconds.

  2. You can set the parameter LIMIT_WHITE_LIST to set a separate request frequency for specific users. Its value is a JSON string, and its structure can refer to Map<string, IBaseRateLimiter>.

How to increase the number of records inserted per API call? (10 by default)

This can be achieved by setting the API_MAX_MODIFY_RECORD_COUNTS parameter in the .env.default file of room-server.

How to upgrade to the newest release version?

How to change the default 80 port?

Configuration properties in the .env file can also be overridden by specifying them env vars NGINX_HTTP_PORT

For example. It would be set as NGINX_HTTP_PORT=8080