"The API that lies to you."
ImpostAPI is a high-performance, asynchronous Mock API generator built with FastAPI and MongoDB. It allows developers to design and deploy custom JSON endpoints in seconds, streamlining the workflow when the real backend isn't available yet.
ImpostAPI solves the classic "chicken and egg" problem in software development: How does the Frontend team advance if the Backend isn't ready yet?
This project allows you to:
- Unblock Frontend: Create "contracts" (agreed-upon JSON responses) instantly to start building interfaces without dependencies.
- Test the Hard Stuff (Unhappy Paths): Simulate server errors (500), resources not found (404), or long timeouts in a controlled way.
- Rapid Prototyping: Ideal for Hackathons or demos where you need a functional API without writing complex business logic.
- Frontend Developers: Who need immediate data to work on their components.
- QA Engineers: Who require deterministic test scenarios for their automated tests.
- Fullstack Developers: Who want to validate an architecture idea before coding the final backend.
- Students & Teachers: To practice consuming REST APIs in a controlled environment.
- 🚀 Native Asynchronous Core: Built with FastAPI and the modern PyMongo (Async) driver for non-blocking operations.
- 🔀 Dynamic "Catch-All" Routing: An engine that intercepts any request under
/mock/{path}and looks up the corresponding configuration in the database. - ⏱️ Network Simulation: Configurable latency per endpoint to test loading states and skeletons on the client side.
- 🛡️ Contract Testing: Define custom JSON responses and Status Codes (200, 201, 400, 500).
- 💎 Pydantic v2: Robust data validation using the latest industry standards.
- Framework: FastAPI
- Database: MongoDB (via native PyMongo Async)
- Validation: Pydantic v2
- Environment: Python 3.10+
- Server: Uvicorn (ASGI)
- Python 3.10+
- MongoDB Instance (Local or Atlas)
git clone https://github.com/YarielZC/impostapi-back.git
cd impostapi-backpython -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activatepip install -r requirements.txtCreate a .env file in the root directory, using .env.template as a guide.
fastapi dev index.pyThe API will be available at: http://localhost:8000
FastAPI automatically generates interactive documentation. Visit:
- Swagger UI:
http://localhost:8000/docs - ReDoc:
http://localhost:8000/redoc
Contributions are what make the open source community such an amazing place to learn and inspire.
- Fork the project.
- Create your feature branch (
git checkout -b feature/AmazingFeature). - Commit your changes (
git commit -m 'Add some AmazingFeature'). - Push to the branch (
git push origin feature/AmazingFeature). - Open a Pull Request.
"La API que te miente."
ImpostAPI es un generador de Mock APIs asíncrono y de alto rendimiento construido con FastAPI y MongoDB. Permite a los desarrolladores diseñar y desplegar endpoints JSON personalizados en segundos, agilizando el flujo de trabajo cuando el backend real aún no está disponible.
ImpostAPI resuelve el problema clásico del "huevo y la gallina" en el desarrollo de software: ¿Cómo avanza el equipo de Frontend si el Backend aún no está listo?
Este proyecto permite:
- Desbloquear al Frontend: Crea "contratos" (respuestas JSON acordadas) instantáneamente para empezar a maquetar interfaces sin dependencias.
- Probar lo difícil (Unhappy Paths): Simular errores de servidor (500), recursos no encontrados (404) o tiempos de espera largos de forma controlada.
- Prototipado Rápido: Ideal para Hackathons o demos donde necesitas una API funcional sin escribir lógica de negocio compleja.
- Frontend Developers: Que necesitan datos inmediatos para trabajar en sus componentes.
- QA Engineers: Que requieren escenarios de prueba deterministas para sus tests automatizados.
- Fullstack Developers: Que quieren validar una idea de arquitectura antes de codificar el backend final.
- Estudiantes y Profesores: Para practicar el consumo de APIs REST en un entorno controlado.
- 🚀 Núcleo Asíncrono Nativo: Construido con FastAPI y el driver moderno de PyMongo (Async) para operaciones no bloqueantes.
- 🔀 Enrutamiento Dinámico "Catch-All": Un motor que intercepta cualquier petición bajo
/mock/{path}y busca la configuración correspondiente en la base de datos. - ⏱️ Simulación de Red: Latencia configurable por endpoint para probar estados de carga y skeletons en el cliente.
- 🛡️ Testing de Contratos: Define respuestas JSON y Códigos de Estado (200, 201, 400, 500) personalizados.
- 💎 Pydantic v2: Validación de datos robusta utilizando los últimos estándares de la industria.
- Framework: FastAPI
- Base de Datos: MongoDB (vía PyMongo Async nativo)
- Validación: Pydantic v2
- Entorno: Python 3.10+
- Servidor: Uvicorn (ASGI)
- Python 3.10+
- Instancia de MongoDB (Local o Atlas)
git clone https://github.com/YarielZC/impostapi-back.git
cd impostapi-backpython -m venv venv
source venv/bin/activate # En Windows: venv\Scripts\activatepip install -r requirements.txtCrea un archivo .env en la raíz, guiarse por .env.template:
fastapi dev index.pyLa API estará en: http://localhost:8000
FastAPI genera documentación interactiva automáticamente. Visita:
- Swagger UI:
http://localhost:8000/docs - ReDoc:
http://localhost:8000/redoc
Las contribuciones son lo que hacen a la comunidad de código abierto un lugar increíble para aprender e inspirar.
- Haz un Fork del proyecto.
- Crea tu rama de funcionalidad (
git checkout -b feature/MejoraIncreible). - Haz Commit de tus cambios (
git commit -m 'Add some MejoraIncreible'). - Haz Push a la rama (
git push origin feature/MejoraIncreible). - Abre un Pull Request.
Distribuido bajo la Licencia MIT. Ver el archivo LICENSE para más información.