Conversation
|
requriments.txt? |
|
ok , after integrating the db, anyhow all the db.py functions also require pydantic schemas in orm_mode for clean validation , i will add them and test the api routes and update the branch sir if you could assign this schema validation issue to me , I would wait for the db integration too. thank you for reviewing the pr |
…of get_db at routes
…added db:Session as dependency injection
…y injections for any future routes
d449e45 to
97d178a
Compare
|
I made the existing code more enhanced and industry standard sir @Harish-2003 key improvements:
I used postman to verify the routes and created a Twilio service to test all function, screenshots below with a one line description will helps you to understand the testing.
FastAPI server side log
used a local .db file for quick testing and the visualization of db table is from api side it all clean and clear to merge this pull request sir, as it is SQL Alchemy if we just change the database url to neon db , it works the same ! could you please look into this. |








issue #19
Added Pydantic Schemas
Created app/schemas/otp.py and app/schemas/token.py to define strong request and response models for the OTP API. These schemas enforce input validation, make endpoint contracts clear, and improve the OpenAPI documentation.
Centralized Configuration with BaseSettings
Introduced app/config.py using BaseSettings (from the pydantic-settings package, as required by Pydantic v2+). This consolidates all configuration, such as Twilio credentials and JWT secrets into a single, type-safe location.
Twilio Verify v2 Migration
Updated Twilio API calls to use client.verify.v2.services(...) instead of the deprecated v1 version. This aligns with the latest Twilio library and resolves PyCharm deprecation warnings.
Improved API Documentation
Added response_model and status_code to each endpoint, and provided concise docstrings. This enhances the autogenerated API docs and makes responses and behaviors more predictable for consumers.
Added init.py to All Folders
Included empty init.py files in all subfolders (app/, app/routers/, app/schemas/, etc.) to ensure Python treats them as packages. This allows for absolute imports (e.g., from app.schemas.otp import OTPRequest) and resolves module import issues in editors and during deployment.
improved requirements.txt with versions
frozen the requirements for clean installations of pydantic-settings and new twilio versions