diff --git a/.htaccess b/.htaccess deleted file mode 100644 index b6e583e354236299b97f983c7a46ddaa3c1d575a..0000000000000000000000000000000000000000 --- a/.htaccess +++ /dev/null @@ -1,2 +0,0 @@ -RewriteEngine On -RewriteRule ^$ app/views/landing [L] \ No newline at end of file diff --git a/db/mahasiswa_leveling.sql b/db/mahasiswa_leveling.sql new file mode 100644 index 0000000000000000000000000000000000000000..0c0f47b6af0e9cee9d6855f4d08401b4d9195bb9 --- /dev/null +++ b/db/mahasiswa_leveling.sql @@ -0,0 +1,70 @@ +-- phpMyAdmin SQL Dump +-- version 5.2.1 +-- https://www.phpmyadmin.net/ +-- +-- Host: db:3306 +-- Generation Time: Sep 30, 2023 at 07:40 AM +-- Server version: 8.1.0 +-- PHP Version: 8.2.8 + +SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; +START TRANSACTION; +SET time_zone = "+00:00"; + + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8mb4 */; + +-- +-- Database: `mahasiswa_leveling` +-- + +-- -------------------------------------------------------- + +-- +-- Table structure for table `users` +-- + +CREATE TABLE `users` ( + `id` int NOT NULL, + `username` varchar(255) NOT NULL, + `email` varchar(255) NOT NULL, + `password` varchar(255) NOT NULL, + `isAdmin` tinyint(1) NOT NULL DEFAULT '0' +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +-- +-- Dumping data for table `users` +-- + +INSERT INTO `users` (`id`, `username`, `email`, `password`, `isAdmin`) VALUES +(1, 'admin', 'admin@gmail.com', 'admin', 1), +(2, 'user', 'user@gmail.com', 'user', 0); + +-- +-- Indexes for dumped tables +-- + +-- +-- Indexes for table `users` +-- +ALTER TABLE `users` + ADD PRIMARY KEY (`id`), + ADD UNIQUE KEY `username` (`username`); + +-- +-- AUTO_INCREMENT for dumped tables +-- + +-- +-- AUTO_INCREMENT for table `users` +-- +ALTER TABLE `users` + MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; +COMMIT; + +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; diff --git a/docker-compose.yml b/docker-compose.yml index 7c5e0aeeb93e6ef1a07efefaf9b94d87a8878aad..afc719e660ad8e82d788a4029514051b4c872f45 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,6 +1,25 @@ version: '3.3' services: - web: - image: tubes-1:latest + www: + image: php:8.0-apache + volumes: + - "./:/var/www/html" # sync project dir with container ports: - - 8008:80 + - 8080:80 + - 443:443 + db: + image: mysql:latest + environment: + - MYSQL_DATABASE=mahasiswa_leveling + - MYSQL_USER=zero_one + - MYSQL_PASSWORD=password # this should live in a env var + - MYSQL_ALLOW_EMPTY_PASSWORD=1 # equivalent to True + volumes: + - "./db:/docker-entrypoint-initdb.d" # sync persistent sql files with container + phpmyadmin: + image: phpmyadmin/phpmyadmin + ports: + - 8001:80 + environment: + - PMA_HOST=db + - PMA_PORT=3306 \ No newline at end of file diff --git a/index.php b/index.php new file mode 100644 index 0000000000000000000000000000000000000000..a054d22ece30cf4c507a2edbedfac0aafca18df5 --- /dev/null +++ b/index.php @@ -0,0 +1 @@ +<meta http-equiv="refresh" content="0;url=app/views/landing"> \ No newline at end of file