Tugas Kelompok PJPB - Smart Contracts

Anggota kelompok

Teknologi

URL frontend: https://testapp.pjpb.gabrielkheisa.xyz/login.php

Video demonstrasi dan penjelasan: https://drive.google.com/drive/u/1/folders/1L0w71TZnqa41XFDGfoZ3mM8ILZQeZeXE

Instalasi menggunakan Docker LEMP Stack:

1. Buat file dengan nama docker-compose.yml, isi file dengan konfigurasi berikut:

```yaml # ./docker-compose.yml version: '3' services: app: image: adhocore/lemp:7.4 # For different app you can use different names. (eg: ) container_name: some-app volumes: # app source code - ./web:/var/www/html # db data persistence - db_data:/var/lib/mysql # Here you can also volume php ini settings # - /path/to/zz-overrides:/usr/local/etc/php/conf.d/zz-overrides.ini ports: - 8080:80 environment: MYSQL_ROOT_PASSWORD: supersecurepwd MYSQL_DATABASE: appdb MYSQL_USER: dbusr MYSQL_PASSWORD: securepwd # for postgres you can pass in similar env as for mysql but with PGSQL_ prefix volumes: db_data: {} ```

2. Kemudian, compose

docker-compose up -d

3. Navigasi menuju folder web

cd web

4. Clone repository berikut, kemudian ganti branch ke docker

git clone https://github.com/gabrielkheisa/tugas-pjpb.git
cd tugas-pjpb
git checkout docker

5. Bash ke container untuk melakukan beberapa konfigurasi database:

docker exec -u root -t -i some-app /bin/bash

6. Login ke MySQL sebagai root dengan password supersecurepwd

mysql -u root -p

7. Tambahkan tabel berikut, beserta user Admin:

USE appdb;
CREATE TABLE `user_pjpb` (
	`nama` VARCHAR(30),
	`email` VARCHAR(30),
	`hash` VARCHAR(70),
	`public_key` VARCHAR(70),
	`url` TEXT(70),
	`id` INT(11) AUTO_INCREMENT,
	PRIMARY KEY (`id`)
);

7. Berikan akses dbusr ke appdb:

GRANT ALL PRIVILEGES ON appdb.* TO 'dbusr'@'localhost' WITH GRANT OPTION;
exit;

Aplikasi dapat diakses melalui http://{ip-address}:8080/login.php, untuk registrasi melalui http://{ip-address}:8080/register.php