Spaces:
Runtime error
Runtime error
Commit ·
55fd541
1
Parent(s): 752a4b2
initial commit
Browse filesFiles changed (28)
- .gitignoreAdded+5
- DockerfileAdded+13
- alembic.iniAdded+149
- alembic/READMEAdded+1
- alembic/env.pyAdded+81
- alembic/script.py.makoAdded+28
- alembic/versions/adcdae776345_initial.pyAdded+58
- app/__init__.pyAdded
- app/config.pyAdded+16
- app/database.pyAdded+17
- app/main.pyAdded+26
- app/models/__init__.pyAdded+3
- app/models/posts.pyAdded+14
- app/models/users.pyAdded+9
- app/models/votes.pyAdded+7
- app/oauth2.pyAdded+42
- app/routers/__init__.pyAdded+1
- app/routers/auth.pyAdded+27
- app/routers/post.pyAdded+84
- app/routers/user.pyAdded+29
- app/routers/vote.pyAdded+38
- app/schemas/__init__.pyAdded+4
- app/schemas/post.pyAdded+28
- app/schemas/token.pyAdded+10
- app/schemas/user.pyAdded+17
- app/schemas/vote.pyAdded+7
- app/utils.pyAdded+9
- requirements.txtAdded+58
12345venv/.env__pycache__/*.pyc.env.*12345678910111213FROM python:3.11
RUN useradd -m -u 1000 userUSER userENV PATH="/home/user/.local/bin:$PATH"
WORKDIR /app
COPY --chown=user ./requirements.txt requirements.txtRUN pip install --no-cache-dir --upgrade -r requirements.txt
COPY --chown=user . /appCMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149# A generic, single database configuration.
[alembic]# path to migration scripts.# this is typically a path given in POSIX (e.g. forward slashes)# format, relative to the token %(here)s which refers to the location of this# ini filescript_location = %(here)s/alembic
# template used to generate migration file names; The default value is %%(rev)s_%%(slug)s# Uncomment the line below if you want the files to be prepended with date and time# see https://alembic.sqlalchemy.org/en/latest/tutorial.html#editing-the-ini-file# for all available tokens# file_template = %%(year)d_%%(month).2d_%%(day).2d_%%(hour).2d%%(minute).2d-%%(rev)s_%%(slug)s# Or organize into date-based subdirectories (requires recursive_version_locations = true)# file_template = %%(year)d/%%(month).2d/%%(day).2d_%%(hour).2d%%(minute).2d_%%(second).2d_%%(rev)s_%%(slug)s
# sys.path path, will be prepended to sys.path if present.# defaults to the current working directory. for multiple paths, the path separator# is defined by "path_separator" below.prepend_sys_path = .
# timezone to use when rendering the date within the migration file# as well as the filename.# If specified, requires the tzdata library which can be installed by adding# `alembic[tz]` to the pip requirements.# string value is passed to ZoneInfo()# leave blank for localtime# timezone =
# max length of characters to apply to the "slug" field# truncate_slug_length = 40
# set to 'true' to run the environment during# the 'revision' command, regardless of autogenerate# revision_environment = false
# set to 'true' to allow .pyc and .pyo files without# a source .py file to be detected as revisions in the# versions/ directory# sourceless = false
# version location specification; This defaults# to <script_location>/versions. When using multiple version# directories, initial revisions must be specified with --version-path.# The path separator used here should be the separator specified by "path_separator"# below.# version_locations = %(here)s/bar:%(here)s/bat:%(here)s/alembic/versions
# path_separator; This indicates what character is used to split lists of file# paths, including version_locations and prepend_sys_path within configparser# files such as alembic.ini.# The default rendered in new alembic.ini files is "os", which uses os.pathsep# to provide os-dependent path splitting.## Note that in order to support legacy alembic.ini files, this default does NOT# take place if path_separator is not present in alembic.ini. If this# option is omitted entirely, fallback logic is as follows:## 1. Parsing of the version_locations option falls back to using the legacy# "version_path_separator" key, which if absent then falls back to the legacy# behavior of splitting on spaces and/or commas.# 2. Parsing of the prepend_sys_path option falls back to the legacy# behavior of splitting on spaces, commas, or colons.## Valid values for path_separator are:## path_separator = :# path_separator = ;# path_separator = space# path_separator = newline## Use os.pathsep. Default configuration used for new projects.path_separator = os
# set to 'true' to search source files recursively# in each "version_locations" directory# new in Alembic version 1.10# recursive_version_locations = false
# the output encoding used when revision files# are written from script.py.mako# output_encoding = utf-8
# database URL. This is consumed by the user-maintained env.py script only.# other means of configuring database URLs may be customized within the env.py# file.sqlalchemy.url = driver://user:pass@localhost/dbname
[post_write_hooks]# post_write_hooks defines scripts or Python functions that are run# on newly generated revision scripts. See the documentation for further# detail and examples
# format using "black" - use the console_scripts runner, against the "black" entrypoint# hooks = black# black.type = console_scripts# black.entrypoint = black# black.options = -l 79 REVISION_SCRIPT_FILENAME
# lint with attempts to fix using "ruff" - use the module runner, against the "ruff" module# hooks = ruff# ruff.type = module# ruff.module = ruff# ruff.options = check --fix REVISION_SCRIPT_FILENAME
# Alternatively, use the exec runner to execute a binary found on your PATH# hooks = ruff# ruff.type = exec# ruff.executable = ruff# ruff.options = check --fix REVISION_SCRIPT_FILENAME
# Logging configuration. This is also consumed by the user-maintained# env.py script only.[loggers]keys = root,sqlalchemy,alembic
[handlers]keys = console
[formatters]keys = generic
[logger_root]level = WARNINGhandlers = consolequalname =
[logger_sqlalchemy]level = WARNINGhandlers =qualname = sqlalchemy.engine
[logger_alembic]level = INFOhandlers =qualname = alembic
[handler_console]class = StreamHandlerargs = (sys.stderr,)level = NOTSETformatter = generic
[formatter_generic]format = %(levelname)-5.5s [%(name)s] %(message)sdatefmt = %H:%M:%S1Generic single-database configuration.123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081from logging.config import fileConfig
from sqlalchemy import engine_from_configfrom sqlalchemy import pool
from alembic import contextfrom app.models import Basefrom app.config import setting
# this is the Alembic Config object, which provides# access to the values within the .ini file in use.config = context.configconfig.set_main_option("sqlalchemy.url",f"postgresql://{setting.database_username}:{setting.database_password}@{setting.database_hostname}:{setting.database_port}/{setting.database_name}")
# Interpret the config file for Python logging.# This line sets up loggers basically.if config.config_file_name is not None: fileConfig(config.config_file_name)
# add your model's MetaData object here# for 'autogenerate' support# from myapp import mymodel# target_metadata = mymodel.Base.metadatatarget_metadata = Base.metadata
# other values from the config, defined by the needs of env.py,# can be acquired:# my_important_option = config.get_main_option("my_important_option")# ... etc.
def run_migrations_offline() -> None: """Run migrations in 'offline' mode.
This configures the context with just a URL and not an Engine, though an Engine is acceptable here as well. By skipping the Engine creation we don't even need a DBAPI to be available.
Calls to context.execute() here emit the given string to the script output.
""" url = config.get_main_option("sqlalchemy.url") context.configure( url=url, target_metadata=target_metadata, literal_binds=True, dialect_opts={"paramstyle": "named"}, )
with context.begin_transaction(): context.run_migrations()
def run_migrations_online() -> None: """Run migrations in 'online' mode.
In this scenario we need to create an Engine and associate a connection with the context.
""" connectable = engine_from_config( config.get_section(config.config_ini_section, {}), prefix="sqlalchemy.", poolclass=pool.NullPool, )
with connectable.connect() as connection: context.configure( connection=connection, target_metadata=target_metadata )
with context.begin_transaction(): context.run_migrations()
if context.is_offline_mode(): run_migrations_offline()else: run_migrations_online()12345678910111213141516171819202122232425262728"""${message}
Revision ID: ${up_revision}Revises: ${down_revision | comma,n}Create Date: ${create_date}
"""from typing import Sequence, Union
from alembic import opimport sqlalchemy as sa${imports if imports else ""}
# revision identifiers, used by Alembic.revision: str = ${repr(up_revision)}down_revision: Union[str, Sequence[str], None] = ${repr(down_revision)}branch_labels: Union[str, Sequence[str], None] = ${repr(branch_labels)}depends_on: Union[str, Sequence[str], None] = ${repr(depends_on)}
def upgrade() -> None: """Upgrade schema.""" ${upgrades if upgrades else "pass"}
def downgrade() -> None: """Downgrade schema.""" ${downgrades if downgrades else "pass"}12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758"""initial
Revision ID: adcdae776345Revises: Create Date: 2026-06-05 11:40:46.228344
"""from typing import Sequence, Union
from alembic import opimport sqlalchemy as sa
# revision identifiers, used by Alembic.revision: str = 'adcdae776345'down_revision: Union[str, Sequence[str], None] = Nonebranch_labels: Union[str, Sequence[str], None] = Nonedepends_on: Union[str, Sequence[str], None] = None
def upgrade() -> None: """Upgrade schema.""" # ### commands auto generated by Alembic - please adjust! ### op.create_table('users', sa.Column('id', sa.Integer(), nullable=False), sa.Column('email', sa.String(), nullable=False), sa.Column('password', sa.String(), nullable=False), sa.Column('created_at', sa.TIMESTAMP(timezone=True), server_default=sa.text('now()'), nullable=False), sa.PrimaryKeyConstraint('id'), sa.UniqueConstraint('email') ) op.create_table('posts', sa.Column('id', sa.Integer(), nullable=False), sa.Column('title', sa.String(), nullable=False), sa.Column('content', sa.String(), nullable=False), sa.Column('published', sa.Boolean(), server_default='TRUE', nullable=False), sa.Column('created_at', sa.TIMESTAMP(timezone=True), server_default=sa.text('now()'), nullable=False), sa.Column('owner_id', sa.Integer(), nullable=False), sa.ForeignKeyConstraint(['owner_id'], ['users.id'], ondelete='CASCADE'), sa.PrimaryKeyConstraint('id') ) op.create_table('votes', sa.Column('user_id', sa.Integer(), nullable=False), sa.Column('post_id', sa.Integer(), nullable=False), sa.ForeignKeyConstraint(['post_id'], ['posts.id'], ondelete='CASCADE'), sa.ForeignKeyConstraint(['user_id'], ['users.id'], ondelete='CASCADE'), sa.PrimaryKeyConstraint('user_id', 'post_id') ) # ### end Alembic commands ###
def downgrade() -> None: """Downgrade schema.""" # ### commands auto generated by Alembic - please adjust! ### op.drop_table('votes') op.drop_table('posts') op.drop_table('users') # ### end Alembic commands ###12345678910111213141516from pydantic_settings import BaseSettings
class Settings(BaseSettings): database_hostname: str database_port: str database_password: str database_name: str database_username: str secret_key: str algorithm: str access_token_expire_minutes: int
class Config: env_file = ".env"
setting = Settings()1234567891011121314151617from sqlalchemy import create_enginefrom sqlalchemy.ext.declarative import declarative_basefrom sqlalchemy.orm import sessionmakerfrom app.config import setting
SQLALCHEMY_DATABASE_URL=f"postgresql://{setting.database_username}:{setting.database_password}@{setting.database_hostname}:{setting.database_port}/{setting.database_name}"engine = create_engine(SQLALCHEMY_DATABASE_URL)SessionMaker = sessionmaker(autoflush=False,autocommit=False,bind=engine)
Base = declarative_base()
def get_db(): db = SessionMaker() try: yield db finally: db.close()1234567891011121314151617181920212223242526from fastapi import FastAPIfrom app.database import Base, enginefrom app.routers import post, user, auth, votefrom fastapi.middleware.cors import CORSMiddleware
app = FastAPI()
origins=["*"]
app.add_middleware( CORSMiddleware, allow_origins=origins, allow_credentials=True, allow_methods=["*"], allow_headers=["*"],)
app.include_router(post.router)app.include_router(user.router)app.include_router(auth.router)app.include_router(vote.router)
@app.get("/")def home(): return "FastAPI Project"123from app.models.posts import Postfrom app.models.users import Userfrom app.models.votes import Votes1234567891011121314from sqlalchemy import Column, ForeignKey, Integer, String, Boolean, TIMESTAMP, textfrom sqlalchemy.orm import relationshipfrom app.database import Base
class Post(Base): __tablename__ = "posts" id = Column(Integer, primary_key=True, nullable=False) title = Column(String, nullable=False) content = Column(String, nullable=False) published = Column(Boolean, server_default="TRUE", nullable=False) created_at = Column(TIMESTAMP(timezone=True), nullable=False, server_default=text("now()")) owner_id = Column(Integer, ForeignKey("users.id",ondelete="CASCADE"),nullable=False) owner = relationship("User") 123456789from sqlalchemy import Column, Integer, String, TIMESTAMP, textfrom app.database import Base
class User(Base): __tablename__ = "users" id = Column(Integer, primary_key=True, nullable=False) email = Column(String, nullable=False, unique=True) password= Column(String, nullable=False) created_at = Column(TIMESTAMP(timezone=True), nullable=False, server_default=text("now()"))1234567from sqlalchemy import Column, ForeignKey, Integerfrom app.database import Base
class Votes(Base): __tablename__= "votes" user_id= Column(Integer,ForeignKey("users.id",ondelete="CASCADE"),primary_key=True) post_id= Column(Integer,ForeignKey("posts.id",ondelete="CASCADE"),primary_key=True)123456789101112131415161718192021222324252627282930313233343536373839404142from datetime import datetime, timedeltafrom fastapi import Depends, HTTPException, statusfrom fastapi.security import OAuth2PasswordBearerfrom jose import JWTError, jwtfrom app.database import get_dbfrom app.models.users import Userfrom app.schemas.token import TokenDatafrom sqlalchemy.orm import Sessionfrom app.config import setting
oauth2_scheme=OAuth2PasswordBearer(tokenUrl="login")SECRET_KEY=setting.secret_keyALGORITHM=setting.algorithmACCESS_TOKEN_EXPIRE_MINUTES=setting.access_token_expire_minutes
def Create_Access_Token(data: dict): payload=data.copy() expire = datetime.utcnow() + timedelta(minutes=ACCESS_TOKEN_EXPIRE_MINUTES) payload.update({"exp": expire})
encoded_jwt=jwt.encode(payload,SECRET_KEY,algorithm=ALGORITHM) return encoded_jwt
def Verify_Access_Token(token: str, credentials_exception): try: payload=jwt.decode(token,SECRET_KEY,algorithms=[ALGORITHM]) id=payload.get("id") if id is None: raise credentials_exception token_data=TokenData(**payload) return token_data except JWTError: raise credentials_exception
def Get_Current_User(token: str = Depends(oauth2_scheme), db: Session = Depends(get_db)): credentials_exception=HTTPException(status_code=status.HTTP_401_UNAUTHORIZED, detail="Could not validate Credentials",headers={"WWW-Authenticate": "Bearer"}) token = Verify_Access_Token(token,credentials_exception) user=db.query(User).filter(User.id==token.id).first() return user 1from . import post, user, auth123456789101112131415161718192021222324252627from fastapi.security.oauth2 import OAuth2PasswordRequestFormfrom fastapi import APIRouter, Depends, HTTPException, statusfrom sqlalchemy.orm import Sessionfrom app.schemas import Tokenfrom app import utilsfrom app.database import get_dbfrom app.models import Userfrom app.oauth2 import Create_Access_Token
router = APIRouter(tags=["Authentication"])
@router.post('/login',response_model=Token)def login(user_credentials: OAuth2PasswordRequestForm = Depends(), db: Session = Depends(get_db)): user=db.query(User).filter(User.email == user_credentials.username).first()
if not user: raise HTTPException(status_code=status.HTTP_403_FORBIDDEN,detail="Invalid Credentials") if not utils.verify(user_credentials.password,user.password): raise HTTPException(status_code=status.HTTP_403_FORBIDDEN,detail="Invalid Credentials") access_token=Create_Access_Token(data={"id": user.id}) return { "access_token": access_token, "token_type": "bearer" }123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384from typing import Optionalfrom fastapi import APIRouter, HTTPException, Depends, status, Responsefrom sqlalchemy import Result, funcfrom sqlalchemy.orm import Sessionfrom app.database import get_dbfrom app.models import Post, User, Votesfrom app.oauth2 import Get_Current_Userfrom app.schemas import PostCreate, PostUpdate, PostResponse, PostVote
router = APIRouter(prefix="/posts", tags=["Posts"])
@router.get("/", response_model=list[PostVote])def get_posts(db: Session = Depends(get_db),current_user: User= Depends(Get_Current_User),limit: int = 10, skip: int = 0, search: Optional[str] = ""): results = ( db.query(Post, func.count(Votes.post_id).label("votes")) .join(Votes, Votes.post_id == Post.id, isouter=True) .group_by(Post.id) .filter(Post.title.contains(search)) .limit(limit) .offset(skip) .all() ) posts = [] for post, vote_count in results: post.votes = vote_count posts.append(post) return posts@router.post("/", response_model=PostResponse)def create_post(post: PostCreate, db: Session = Depends(get_db), current_user: User= Depends(Get_Current_User)): new_post = Post(owner_id=current_user.id,**post.model_dump()) db.add(new_post) db.commit() db.refresh(new_post) return new_post
@router.get("/{id}", response_model=PostVote)def get_post(id: int, db: Session = Depends(get_db),current_user: User= Depends(Get_Current_User)): result = ( db.query(Post, func.count(Votes.post_id).label("votes")) .join(Votes, Votes.post_id == Post.id, isouter=True) .group_by(Post.id) .filter(Post.id == id) .first()) if not result: raise HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail=f"Post with id {id} does not exist") post,vote_count=result post.votes=vote_count return post
@router.delete("/{id}")def delete_post(id: int, db: Session = Depends(get_db), current_user: User = Depends(Get_Current_User)): post_query = db.query(Post).filter(Post.id == id) post = post_query.first() if not post: raise HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail=f"Post with id {id} does not exist") if post.owner_id != current_user.id: raise HTTPException(status_code=status.HTTP_403_FORBIDDEN, detail="Not Authorized to Perform this Action") post_query.delete(synchronize_session=False) db.commit() return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.put("/{id}", response_model=PostResponse)def update_post(id: int, updated_post: PostCreate, db: Session = Depends(get_db), current_user: User = Depends(Get_Current_User)): post_query = db.query(Post).filter(Post.id == id) post = post_query.first() if not post: raise HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail=f"Post with id {id} does not exist") if post.owner_id != current_user.id: raise HTTPException(status_code=status.HTTP_403_FORBIDDEN, detail="Not Authorized to Perform this Action") post_query.update(updated_post.model_dump(), synchronize_session=False) db.commit() return post_query.first()
@router.patch("/{id}", response_model=PostResponse)def update_post_patch(id: int, updated_post: PostUpdate, db: Session = Depends(get_db), current_user: User = Depends(Get_Current_User)): post_query = db.query(Post).filter(Post.id == id) post = post_query.first() if not post: raise HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail=f"Post with id {id} does not exist") if post.owner_id != current_user.id: raise HTTPException(status_code=status.HTTP_403_FORBIDDEN, detail="Not Authorized to Perform this Action") post_query.update(updated_post.model_dump(exclude_unset=True), synchronize_session=False) db.commit() return post_query.first()1234567891011121314151617181920212223242526272829from fastapi import APIRouter, HTTPException, Depends, status, Responsefrom sqlalchemy.orm import Sessionfrom websockets import routefrom app.database import get_dbfrom app.schemas import UserCreate, UserResponsefrom app.models import Userfrom app.utils import Hash
router = APIRouter(prefix="/users", tags=["Users"])
@router.post("/",status_code=status.HTTP_201_CREATED,response_model=UserResponse)def create_user(user : UserCreate, db: Session = Depends(get_db)): user.password=Hash(user.password) new_user=User(**user.model_dump()) db.add(new_user) db.commit() db.refresh(new_user) return new_user
@router.get("/",response_model=list[UserResponse])def get_all_user(db: Session= Depends(get_db)): return db.query(User).all()
@router.get("/{id}",response_model=UserResponse)def get_user(id: int,db: Session = Depends(get_db)): user=db.query(User).filter(User.id == id).first() if not user: raise HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail=f"User with id {id} does not Exit") return user1234567891011121314151617181920212223242526272829303132333435363738from fastapi import APIRouter, HTTPException, Depends, status, Responsefrom sqlalchemy.orm import Sessionfrom app.database import get_dbfrom app.models import User, Votes, Postfrom app.oauth2 import Get_Current_Userfrom app.schemas import VoteBase
router = APIRouter( prefix="/vote", tags=["Votes"])
@router.post("/",status_code=status.HTTP_201_CREATED)def vote(vote: VoteBase, db: Session = Depends(get_db), current_user: User = Depends(Get_Current_User)): post = db.query(Post).filter(Post.id==vote.post_id).first() if not post: raise HTTPException(status_code=status.HTTP_404_NOT_FOUND,detail=f"Post with {vote.post_id} does not Exit") else: vote_query=db.query(Votes).filter(Votes.post_id==vote.post_id,Votes.user_id==current_user.id) found_vote=vote_query.first() if vote.dir==1: if found_vote: raise HTTPException(status_code=status.HTTP_409_CONFLICT,detail=f"User with id {current_user.id} has already voted on this Post") new_vote=Votes(post_id=vote.post_id,user_id=current_user.id) db.add(new_vote) db.commit() return{ "message": "Successfully Voted" } else: if not found_vote: raise HTTPException(status_code=status.HTTP_404_NOT_FOUND,detail="Vote does not Exit") vote_query.delete(synchronize_session=False) db.commit() return{ "message": "Vote Successfully Deleted" } 1234from .post import *from .user import *from .token import *from .vote import *12345678910111213141516171819202122232425262728from datetime import datetimefrom typing import Optionalfrom pydantic import BaseModelfrom app.schemas.user import UserResponse
class PostBase(BaseModel): title: str content: str published: bool = True
class PostCreate(PostBase): pass
class PostUpdate(BaseModel): title: Optional[str] = None content: Optional[str] = None published: Optional[bool] = None
class PostResponse(PostBase): id: int created_at: datetime owner_id: int owner: UserResponse class Config: from_attributes = True
class PostVote(PostResponse): votes: int12345678910from typing import Optionalfrom pydantic import BaseModel
class Token(BaseModel): access_token: str token_type: str
class TokenData(BaseModel): id: Optional[int] = None1234567891011121314151617from datetime import datetimefrom pydantic import BaseModel, EmailStr
class UserBase(BaseModel): email: EmailStr password: str
class UserCreate(UserBase): pass
class UserResponse(BaseModel): id: int email: EmailStr created_at: datetime class Config: from_attributes = True
1234567from typing import Literalfrom pydantic import BaseModel
class VoteBase(BaseModel): post_id: int dir: Literal[0, 1] 123456789from passlib.context import CryptContext # type: ignore
pwd_context = CryptContext(schemes=["bcrypt"], deprecated="auto")
def Hash(password: str): return pwd_context.hash(password)
def verify(plain_password,hashed_password): return pwd_context.verify(plain_password,hashed_password)12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758alembic==1.18.4annotated-doc==0.0.4annotated-types==0.7.0anyio==4.13.0certifi==2026.2.25cffi==2.0.0click==8.3.2colorama==0.4.6cryptography==47.0.0dnspython==2.8.0ecdsa==0.19.2email-validator==2.3.0fastapi==0.136.0fastapi-cli==0.0.24fastapi-cloud-cli==0.17.0fastar==0.11.0greenlet==3.4.0h11==0.16.0httpcore==1.0.9httptools==0.7.1httpx==0.28.1idna==3.11itsdangerous==2.2.0Jinja2==3.1.6Mako==1.3.12markdown-it-py==4.0.0MarkupSafe==3.0.3mdurl==0.1.2psycopg2==2.9.11pyasn1==0.6.3pycparser==3.0pydantic==2.13.2pydantic-extra-types==2.11.1pydantic-settings==2.13.1pydantic_core==2.46.2Pygments==2.20.0python-dotenv==1.2.2python-jose==3.5.0python-multipart==0.0.26PyYAML==6.0.3rich==15.0.0rich-toolkit==0.19.7rignore==0.7.6rsa==4.9.1sentry-sdk==2.58.0shellingham==1.5.4six==1.17.0SQLAlchemy==2.0.49starlette==1.0.0typer==0.24.1typing-inspection==0.4.2typing_extensions==4.15.0urllib3==2.6.3uvicorn==0.44.0watchfiles==1.1.1websockets==16.0passlib==1.7.4bcrypt==4.0.1.gitignoreAdded+5
DockerfileAdded+13
alembic.iniAdded+149
alembic/READMEAdded+1
alembic/env.pyAdded+81
alembic/script.py.makoAdded+28
alembic/versions/adcdae776345_initial.pyAdded+58
app/__init__.pyAdded
app/config.pyAdded+16
app/database.pyAdded+17
app/main.pyAdded+26
app/models/__init__.pyAdded+3
app/models/posts.pyAdded+14
app/models/users.pyAdded+9
app/models/votes.pyAdded+7
app/oauth2.pyAdded+42
app/routers/__init__.pyAdded+1
app/routers/auth.pyAdded+27
app/routers/post.pyAdded+84
app/routers/user.pyAdded+29
app/routers/vote.pyAdded+38
app/schemas/__init__.pyAdded+4
app/schemas/post.pyAdded+28
app/schemas/token.pyAdded+10
app/schemas/user.pyAdded+17
app/schemas/vote.pyAdded+7
app/utils.pyAdded+9
requirements.txtAdded+58