From fa7dd81902a318b6c7523cc410c77cd91f33dbf4 Mon Sep 17 00:00:00 2001 From: Muhammad Farrel Danendra Rachim <13521048@std.stei.itb.ac.id> Date: Wed, 27 Sep 2023 01:36:07 +0000 Subject: [PATCH] Revert "update: update gitignore" This reverts commit d4bfbf8f0185d2914c655fdb8a61bac6f03f3057 --- .env.example | 2 -- .gitignore | 3 --- Dockerfile | 7 +------ README.md | 36 ------------------------------------ docker-compose.yml | 17 ----------------- php.ini | 3 --- 6 files changed, 1 insertion(+), 67 deletions(-) delete mode 100644 .env.example delete mode 100644 .gitignore delete mode 100644 php.ini diff --git a/.env.example b/.env.example deleted file mode 100644 index 95ccfc5..0000000 --- a/.env.example +++ /dev/null @@ -1,2 +0,0 @@ -POSTGRES_USER= -POSTGRES_PASSWORD= \ No newline at end of file diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 7e10641..0000000 --- a/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -db/ -.env -.DS_Store \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 08018e2..2e3ddd6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1 @@ -FROM php:8.0-apache - -RUN apt-get update && apt-get install -y libpq-dev -RUN docker-php-ext-install pdo pdo_pgsql -COPY ./php.ini /usr/local/etc/php/php.ini -RUN a2enmod rewrite \ No newline at end of file +FROM php:8.0-apache \ No newline at end of file diff --git a/README.md b/README.md index d3c5315..1132afa 100644 --- a/README.md +++ b/README.md @@ -1,37 +1 @@ # Drawl - -## Development - -## Running App - -This guide is primarily intended for Windows users. For Linux users please adjust according to your setup. - -1. (For Windows) Install the Desktop version of docker. For installation guide please visit the link: https://bobbyhadz.com/blog/docker-is-not-recognized-as-internal-or-external-command -2. (For Linux) Install Docker from terminal. For installation guide please visit the link: https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-20-04 -3. Open your preferred terminal navigate towards the main "drawl" folder. -4. Type `bash scripts/build-image.sh` to run the script file. -5. Run `docker compose up` (+ another flag like `-d` (optional)) -6. Add `.env` file on root dir. The format is same like `.env.example` -7. Add `.env` file on the `.src/server`. The format is same like `.env.example` on that folder. Make sure that the "DB_NAME" parameter is filled with an existing database (e.g. fill it with "postgres") -8. Open the web on `localhost:8008` and the database admin on `localhost:8080` -9. On database admin, select `postgresql` as the system, and get the username and password from `.env`, then write a table name or left it blank - -## Development (Temporary) - -### Create new Page - -1. Tambah file `.php` baru di `src/server/app/View` (sebaiknya taruh dalam folder juga sesuai fungsionalitas) -2. Buat controller atau pake yang udah ada di `src/server/app/Controller`. Basic formatnya kaya yang di `HomeController.php`. -3. Daftarin route baru di `src/server/routes/view.php`. Formatnya, - -```php -Router::add('{http method}', '{path}, '{controller name}', '{function name}', '{middlewares}') -``` - -4. File CSS bisa ditambah di `src/public/css`, trus jangan lupa import di fungsi render di controller pagenya. Contohnya kaya di `HomeController.php` -5. Harusnya pagenya udah bisa muncul. - -## Version Control - -There is a backup for this project on a remote repo `backup`. -So, when pushing changes, push it to the remote `origin` and `backup`. diff --git a/docker-compose.yml b/docker-compose.yml index c6c25d1..7c5e0ae 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,22 +2,5 @@ version: '3.3' services: web: image: tubes-1:latest - volumes: - - ./src/server:/var/www - - ./src/public:/var/www/html ports: - 8008:80 - db: - image: postgres:latest - restart: always - volumes: - - "./db:/var/lib/postgresql/data" - ports: - - "5432:5432" - env_file: - - .env - adminer: - image: adminer:latest - restart: always - ports: - - "8080:8080" diff --git a/php.ini b/php.ini deleted file mode 100644 index 4e75d5f..0000000 --- a/php.ini +++ /dev/null @@ -1,3 +0,0 @@ -file_uploads = On -upload_max_filesize = 100M -post_max_size = 100M \ No newline at end of file -- GitLab