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:
13
www/api/src/config/app.php
Normal file
13
www/api/src/config/app.php
Normal 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',
|
||||
];
|
||||
14
www/api/src/config/database.php
Normal file
14
www/api/src/config/database.php
Normal 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,
|
||||
],
|
||||
];
|
||||
11
www/api/src/config/jwt.php
Normal file
11
www/api/src/config/jwt.php
Normal 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
|
||||
];
|
||||
Reference in New Issue
Block a user