Introducing

Junjun for Beginners

  • Init DatabaseStep 1: Set up your database by executing the following SQL script.
    CREATE DATABASE `junjun` DEFAULT CHARACTER SET = `utf8mb4` DEFAULT COLLATE = `utf8mb4_bin`;
    
    -- 1. create project table
    
    create table jj_project
    (
        id          int auto_increment
            primary key,
        name        varchar(255)                        not null,
        alias_name  varchar(255)                        null,
        description varchar(1000)                       null,
        is_delete   char      default '0'               not null,
        created_at  timestamp default CURRENT_TIMESTAMP null,
        updated_at  timestamp default CURRENT_TIMESTAMP null on update CURRENT_TIMESTAMP
    );
    
    -- 2. create api table
    create table jj_api
    (
        id           int auto_increment
            primary key,
        project_id   int                                 null,
        name         varchar(255)                        not null,
        description  varchar(1000)                       null,
        endpoint_url varchar(255)                        not null,
        is_delete    char      default '0'               not null,
        created_at   timestamp default CURRENT_TIMESTAMP null,
        updated_at   timestamp default CURRENT_TIMESTAMP null on update CURRENT_TIMESTAMP,
        constraint jj_api_ibfk_1
            foreign key (project_id) references jj_project (id)
    );
    
    -- 3. create parameter
    create table jj_parameter
    (
        id          int auto_increment
            primary key,
        api_id      int                                                              null,
        name        varchar(255)                                                     not null,
        cn_name     varchar(500)                                                     null,
        param_type  enum ('String', 'Integer', 'Number', 'Boolean', 'Date', 'Other') not null,
        description varchar(1000)                                                    null,
        is_required char      default '0'                                            not null,
        is_delete   tinyint   default 0                                              not null,
        created_at  timestamp default CURRENT_TIMESTAMP                              null,
        updated_at  timestamp default CURRENT_TIMESTAMP                              null on update CURRENT_TIMESTAMP,
        constraint jj_parameter_ibfk_1
            foreign key (api_id) references jj_api (id)
    );
    
    create index api_id
        on jj_parameter (api_id);
    
    
    create index project_id
        on jj_api (project_id);
    
    
  • Init DatabaseStep 2: Create your configuration file. Navigate to your home directory.linux/macOS: /home/Your Username
  • Init DatabaseCreate a junjun.json file and edit it with your database configurations.
    {
      "db": {
        "host": "127.0.0.1",
        "user": "<Your Username>",
        "password": "<Your Password>",
        "database": "<Your Database>"
      }
    }