Phase 1: Foundation - Database schema, core PHP structure, JWT auth, and User CRUD

Implemented:
- Database schema (SQLite) with tables: users, profiles, posts, swipes, matches, chats, chat_messages, events, notifications, relationships, post_likes, post_comments, refresh_tokens, media
- Core PHP structure following skeleton pattern (www/api/)
- JWT Authentication (register, login, refresh, logout)
- User profile CRUD (show, update, delete, search)
- User sub-resources (posts, friends, followers, following)
- Minimal Firebase JWT implementation for PHP without Composer
This commit is contained in:
2026-04-29 06:49:15 +02:00
parent df6cce8678
commit 937a32ad06
15 changed files with 1698 additions and 14 deletions

View File

@@ -0,0 +1,13 @@
<?php
/**
* Application Configuration
*/
return [
'name' => 'Sozial',
'env' => $_ENV['APP_ENV'] ?? 'development',
'debug' => $_ENV['APP_DEBUG'] ?? true,
'url' => 'https://api.sozial.shadow-land.de',
'version' => 'v1',
'timezone' => 'UTC',
];

View File

@@ -0,0 +1,14 @@
<?php
/**
* Database Configuration
*/
return [
'driver' => 'sqlite',
'database' => __DIR__ . '/../../database/sozial.db',
'options' => [
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
PDO::ATTR_EMULATE_PREPARES => false,
],
];

View File

@@ -0,0 +1,11 @@
<?php
/**
* JWT Configuration
*/
return [
'secret' => $_ENV['JWT_SECRET'] ?? 'sozial-dev-secret-change-in-production',
'algorithm' => 'HS256',
'access_token_ttl' => 86400, // 24 hours in seconds
'refresh_token_ttl' => 2592000, // 30 days in seconds
];