Database setup

cat << "EOF" >> /etc/yum.repos.d/MariaDB.repo
name = MariaDB
baseurl = <>
cat /etc/yum.repos.d/MariaDB.repo

sudo yum install MariaDB-server MariaDB-client -y
sudo systemctl start mariadb
sudo systemctl enable mariadb
sudo mysql-secure-installation
cat << "EOF" >> /etc/my.cnf
init-connect='SET NAMES utf8mb4'
sudo systemctl restart mariadb

mysql -u root -p
## mariadb login
create database helper;
create database helper-dev;
create user 'helper'@'localhost' identified by 'USER_PASSWORD';
grant all on helper.* to 'helper'@'localhost';
grant all on helper-dev.* to 'helper'@'localhost';
flush privileges;

Scheme setup

create table member
    id      bigint generated by default as identity,
    role    varchar(255) not null,
    team_id bigint       not null,
    user_id bigint       not null,
    primary key (id)
create table project
    id   bigint generated by default as identity,
    name varchar(255),
    primary key (id)
create table team
    id               bigint generated by default as identity,
    end_time         timestamp,
    location         varchar(255),
    max_member_count bigint not null,
    start_time       timestamp,
    status           varchar(255),
    project_id       bigint,
    primary key (id)
create table user
    id       bigint generated by default as identity,
    email    varchar(255) not null,
    fullname varchar(255) not null,
    nickname varchar(255) not null,
    picture  varchar(255),
    role     varchar(255) not null,
    primary key (id)
alter table member
    add constraint FKa04a95gj3stpfpgfofmg3f694 foreign key (team_id) references team;
alter table member
    add constraint FKj59gibu1r9jj1yub9gs5xf7il foreign key (user_id) references user;
alter table team
    add constraint FK5fbtjj3np8cwc128vo7wlm4ul foreign key (project_id) references project;

nginx setup

sudo amazon-linux-extras install nginx1.12 -y
sudo systemctl start nginx
sudo systemctl enable nginx

Reverse proxy setup

cat << "EOF" >> /etc/nginx/conf.d/helper.conf
	server {
		listen       80;
		listen       [::]:80;
		root         /usr/share/nginx/html;

		location / {
		sendfile off;
		proxy_pass         <>;
		proxy_redirect     default;
		proxy_http_version 1.1;
		proxy_set_header   Host              $host;
		proxy_set_header   X-Real-IP         $remote_addr;
		proxy_set_header   X-Forwarded-For   $proxy_add_x_forwarded_for;
		proxy_set_header   X-Forwarded-Proto $scheme;
		proxy_cache_bypass $http_upgrade;
		proxy_max_temp_file_size 0;

		error_page 404 /404.html;
		location = /404.html {

		error_page 500 502 503 504 /50x.html;
		location = /50x.html {
sudo systemctl restart nginx