Skip to content

feat: added fastapi-mongo sample - #93

Open
syedali237 wants to merge 2 commits into
keploy:mainfrom
syedali237:sample-fastapi-mongo
Open

feat: added fastapi-mongo sample#93
syedali237 wants to merge 2 commits into
keploy:mainfrom
syedali237:sample-fastapi-mongo

Conversation

@syedali237

Copy link
Copy Markdown

Issue Number

Fixes#3599

Description
This PR adds a FastAPI + MongoDB sample that demonstrates Keploy’s API Test Generator workflow

Other Info:
It shows a runnable Quiz backend and documentation showing how to record real API traffic with Keploy and replay it as an automated test suite, making it easy for users to generate comprehensive API tests for Mongo-backed FastAPI services.

Signed-off-by: Syed Ali Ul Hasan <syedaliulhasan19@gmail.com>
CopilotAI review requested due to automatic review settings January 21, 2026 17:54

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a FastAPI + MongoDB sample application that demonstrates Keploy's API Test Generator workflow. The application implements a quiz backend system where users can create, manage, and take quizzes with AI-generated questions using the Gemini API.

Changes:

  • Added complete FastAPI backend with MongoDB integration for a quiz application
  • Implemented JWT-based authentication and user management system
  • Integrated Gemini AI API for automatic quiz question generation
  • Added content discovery features using YouTube and DuckDuckGo APIs

Reviewed changes

Copilot reviewed 14 out of 16 changed files in this pull request and generated 32 comments.

Show a summary per file
FileDescription
fastapi-mongo/utils/jwt.pyJWT token creation and verification with OAuth2 authentication
fastapi-mongo/utils/gemini.pyGemini AI integration for generating quiz questions
fastapi-mongo/routes/quiz.pyQuiz CRUD operations, quiz-taking flow, and leaderboard endpoints
fastapi-mongo/routes/parent.pyUser registration and login endpoints with password hashing
fastapi-mongo/routes/content.pyArticle and YouTube video search endpoints
fastapi-mongo/models/quiz.pyPydantic models for quiz data structures
fastapi-mongo/models/parent.pyPydantic models for parent/user data
fastapi-mongo/main.pyFastAPI application setup with CORS middleware
fastapi-mongo/db/mongodb.pyMongoDB async client configuration
fastapi-mongo/core/config.pyPydantic settings for environment configuration
fastapi-mongo/auth/jwt_handler.pyDuplicate JWT handling implementation (unused)
fastapi-mongo/DockerfileDocker container configuration for deployment
fastapi-mongo/.gitignoreGit ignore patterns for Python files
fastapi-mongo/keploy-api-test-generator/README.mdDocumentation for Keploy integration

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment threadfastapi-mongo/utils/jwt.py
Comment threadfastapi-mongo/routes/quiz.py
Comment threadfastapi-mongo/.gitignore
Comment threadfastapi-mongo/main.py
Comment threadfastapi-mongo/routes/quiz.py
Comment threadfastapi-mongo/main.py
Comment threadfastapi-mongo/routes/quiz.py
Comment threadfastapi-mongo/routes/content.py
Comment threadfastapi-mongo/routes/content.py
Comment threadfastapi-mongo/routes/content.py
@AkashKumar7902

Copy link
Copy Markdown
Contributor

@syedali237 could you please add the readme for this app ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you please move the relevant content from this folder to the new readme file to be created at the project root ?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AkashKumar7902 Under this root README?

Screenshot 2026-01-27 at 8 36 34 PM

Signed-off-by: Syed Ali Ul Hasan <syedaliulhasan19@gmail.com>
@syedali237

Copy link
Copy Markdown
Author

@AkashKumar7902 I have updated the PR based on your last feedback. Could you please take another look?

@syedali237

Copy link
Copy Markdown
Author

@amaan-bhati can you take a look at this?

@syedali237

Copy link
Copy Markdown
Author

@AkashKumar7902 Checking in on this PR, if more context or adjustments to be made, let me know!

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[sample-python]: Add a FastAPI + MongoDB sample for test suite using Keploy API Test Generator

3 participants

@syedali237@AkashKumar7902