
- Complete FastAPI application with authentication and JWT tokens - SQLite database with SQLAlchemy ORM and Alembic migrations - User management with profile features and search functionality - LinkedIn-style networking with connection requests and acceptance - Social features: posts, likes, comments, announcements, prayer requests - Event management with registration system and capacity limits - RESTful API endpoints for all features with proper authorization - Comprehensive documentation and setup instructions Key Features: - JWT-based authentication with bcrypt password hashing - User profiles with bio, position, contact information - Connection system for church member networking - Community feed with post interactions - Event creation, registration, and attendance tracking - Admin role-based permissions - Health check endpoint and API documentation Environment Variables Required: - SECRET_KEY: JWT secret key for token generation
57 lines
1.1 KiB
Python
57 lines
1.1 KiB
Python
from pydantic import BaseModel
|
|
from datetime import datetime
|
|
from typing import Optional
|
|
|
|
|
|
class PostBase(BaseModel):
|
|
title: str
|
|
content: str
|
|
image_url: Optional[str] = None
|
|
is_announcement: bool = False
|
|
is_prayer_request: bool = False
|
|
|
|
|
|
class PostCreate(PostBase):
|
|
pass
|
|
|
|
|
|
class PostUpdate(BaseModel):
|
|
title: Optional[str] = None
|
|
content: Optional[str] = None
|
|
image_url: Optional[str] = None
|
|
is_announcement: Optional[bool] = None
|
|
is_prayer_request: Optional[bool] = None
|
|
|
|
|
|
class PostResponse(PostBase):
|
|
id: int
|
|
author_id: int
|
|
created_at: datetime
|
|
updated_at: datetime
|
|
author_name: Optional[str] = None
|
|
likes_count: int = 0
|
|
comments_count: int = 0
|
|
|
|
class Config:
|
|
from_attributes = True
|
|
|
|
|
|
class CommentBase(BaseModel):
|
|
content: str
|
|
|
|
|
|
class CommentCreate(CommentBase):
|
|
pass
|
|
|
|
|
|
class CommentResponse(CommentBase):
|
|
id: int
|
|
post_id: int
|
|
author_id: int
|
|
author_name: Optional[str] = None
|
|
created_at: datetime
|
|
updated_at: datetime
|
|
|
|
class Config:
|
|
from_attributes = True
|