diff --git a/.env b/.env
deleted file mode 100644
index 60996c7..0000000
--- a/.env
+++ /dev/null
@@ -1,9 +0,0 @@
-# Database
-DB_HOST=database
-DB_NAME=pawra
-DB_USER=appuser
-DB_PASSWORD=pick-a-real-password-here
-DB_ROOT_PASSWORD=pick-another-real-password
-
-# App
-APP_ENV=development
\ No newline at end of file
diff --git a/Dockerfile b/Dockerfile
deleted file mode 100644
index c0cafa6..0000000
--- a/Dockerfile
+++ /dev/null
@@ -1,13 +0,0 @@
-FROM php:8.3-apache
-
-RUN a2enmod rewrite
-
-RUN docker-php-ext-install pdo_mysql
-
-COPY docker/apache.conf /etc/apache2/sites-available/000-default.conf
-
-COPY . /var/www/html
-
-RUN chown -R www-data:www-data /var/www/html
-
-WORKDIR /var/www/html
\ No newline at end of file
diff --git a/compose.yaml b/compose.yaml
deleted file mode 100644
index 7fa99d9..0000000
--- a/compose.yaml
+++ /dev/null
@@ -1,30 +0,0 @@
-services:
- server:
- build: .
- restart: always
- ports:
- - "8080:80"
- volumes:
- - ".:/var/www/html"
- environment:
- - DB_HOST=${DB_HOST}
- - DB_NAME=${DB_NAME}
- - DB_USER=${DB_USER}
- - DB_PASSWORD=${DB_PASSWORD}
- depends_on:
- database:
- condition: service_healthy
-
- database:
- image: mariadb:lts
- restart: always
- environment:
- MARIADB_ROOT_PASSWORD: ${DB_ROOT_PASSWORD}
- MARIADB_DATABASE: ${DB_NAME}
- MARIADB_USER: ${DB_USER}
- MARIADB_PASSWORD: ${DB_PASSWORD}
- healthcheck:
- test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"]
- interval: 10s
- timeout: 5s
- retries: 5
\ No newline at end of file
diff --git a/docker/apache.conf b/docker/apache.conf
deleted file mode 100644
index 2d26a7a..0000000
--- a/docker/apache.conf
+++ /dev/null
@@ -1,14 +0,0 @@
-
= htmlspecialchars($post['body']) ?>
- - - - \ No newline at end of file diff --git a/src/migrations.php b/src/migrations.php deleted file mode 100644 index 58216b0..0000000 --- a/src/migrations.php +++ /dev/null @@ -1,27 +0,0 @@ -exec("CREATE TABLE IF NOT EXISTS users ( - id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY, - username VARCHAR(50) NOT NULL UNIQUE, - email VARCHAR(255) NOT NULL UNIQUE, - password VARCHAR(255) NOT NULL, - created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP -)"); - -$db->exec("CREATE TABLE IF NOT EXISTS posts ( - id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY, - user_id INT UNSIGNED NOT NULL, - title VARCHAR(255) NOT NULL, - body TEXT NOT NULL, - created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, - FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE -)"); - -echo "Migrations ran successfully.\n"; \ No newline at end of file diff --git a/src/seeds.php b/src/seeds.php deleted file mode 100644 index 9935f56..0000000 --- a/src/seeds.php +++ /dev/null @@ -1,45 +0,0 @@ -exec("SET FOREIGN_KEY_CHECKS = 0"); -$db->exec("TRUNCATE TABLE posts"); -$db->exec("TRUNCATE TABLE users"); -$db->exec("SET FOREIGN_KEY_CHECKS = 1"); - -$users = [ - ['luna', 'luna@pawra.dev', 'password123'], - ['marco', 'marco@pawra.dev', 'password456'], -]; - -$insertUser = $db->prepare( - "INSERT INTO users (username, email, password) VALUES (?, ?, ?)" -); - -foreach ($users as [$username, $email, $password]) { - $insertUser->execute([ - $username, - $email, - password_hash($password, PASSWORD_DEFAULT), - ]); -} - -$posts = [ - [1, 'First post', 'Hello from Luna — Pawra is live!'], - [1, 'Getting started', 'Here is how I set up my profile...'], - [2, 'Hello Pawra', 'Marco here, excited to join!'], -]; - -$insertPost = $db->prepare( - "INSERT INTO posts (user_id, title, body) VALUES (?, ?, ?)" -); - -foreach ($posts as $post) { - $insertPost->execute($post); -} - -echo "Seeded successfully.\n"; \ No newline at end of file