func: add initial structure

This commit is contained in:
Aidan 2025-04-26 15:33:25 -04:00
parent 6f55d0a531
commit be8f1bdb4c
7 changed files with 83 additions and 0 deletions

9
.gitignore vendored Normal file
View File

@ -0,0 +1,9 @@
# Composer
/vendor/
# Bun
node_modules/
bun.lock*
# Tailwind
public/assets/css/tw.css

17
composer.json Normal file
View File

@ -0,0 +1,17 @@
{
"name": "aidan/tinytalk",
"description": "Blogging without all the extras",
"license": "Unlicense",
"autoload": {
"psr-4": {
"Aidan\\Tinytalk\\": "src/"
}
},
"authors": [
{
"name": "Aidan",
"email": "aidan@p0ntus.com"
}
],
"require": {}
}

23
package.json Normal file
View File

@ -0,0 +1,23 @@
{
"name": "tinytalk",
"module": "index.ts",
"type": "module",
"private": true,
"scripts": {
"build:css": "bunx @tailwindcss/cli -i ./public/assets/css/tw-pre.css -o ./public/assets/css/tw.css",
"build:css:watch": "bunx @tailwindcss/cli -i ./public/assets/css/tw-pre.css -o ./public/assets/css/tw.css --watch"
},
"devDependencies": {
"@types/bun": "latest"
},
"peerDependencies": {
"typescript": "^5"
},
"dependencies": {
"@tailwindcss/cli": "^4.1.4",
"tailwindcss": "^4.1.4"
},
"trustedDependencies": [
"@parcel/watcher"
]
}

View File

@ -0,0 +1 @@
@import "tailwindcss";

11
public/index.php Normal file
View File

@ -0,0 +1,11 @@
<?php
require_once __DIR__ . '/../vendor/autoload.php';
$uri = $_SERVER['REQUEST_URI'];
if ($uri === '/' || $uri === '/index.php') {
(new \Aidan\Tinytalk\Controller\HomeController())->index();
} else {
http_response_code(404);
echo "404 Not Found";
}

View File

@ -0,0 +1,8 @@
<?php
namespace Aidan\Tinytalk\Controller;
class HomeController {
public function index() {
include __DIR__ . '/../../templates/home.php';
}
}

14
templates/home.php Normal file
View File

@ -0,0 +1,14 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>TinyTalk</title>
<link rel="stylesheet" href="/assets/css/tw.css">
</head>
<body>
<h1 class="text-3xl font-bold">TinyTalk</h1>
</body>
</html>