mediabros_apis
is a serverless application built with Python using the Chalice and FastAPI frameworks. It provides a set of APIs for various functionalities, including currency exchange rate lookups, integration with the OpenAI API and Telegram messaging for APIs error reporting. The project is configured for deployment on AWS Lambda using the Serverless Framework. It's used as a backend API for Telegram and WhatsApp BOTs.
- Features
- Technologies
- Getting Started
- Usage
- API Endpoints
- Test API
- Production API
- License
- Contributing
- Serverless architecture with AWS Chalice
- API endpoints for currency exchange (Crypto, USD/COP, USD/VEB, etc.)
- Integration with OpenAI's API
- Telegram messaging for APIs error reporting
- JWT-based authentication
- Comprehensive test suite with
pytest
- Backend: Python, Chalice, FastAPI, Pydantic
- Serverless: AWS Lambda, Serverless Framework
- Database/Cache: MongoDB
- Testing:
pytest
,pytest-chalice
- Dependencies:
boto3
,python-jose
,requests
- Node.js: Used for development tools and scripts.
- Python 3.9 - 3.13
- Node.js v20
- Pipenv
- Git
- Make
- Optional (and recommended): Pyenv
- An AWS account and configured credentials
-
Clone the repository:
git clone https://github.com/mediabros/mediabros_apis.git cd mediabros_apis
-
Set up environment variables:
Copy the example environment file and fill in your credentials.
cp .env-example .env
-
Install dependencies:
Use the
Makefile
to install both Python and Node.js dependencies.make install
This project uses a Makefile
to streamline common development tasks.
-
Run the application locally:
make run
-
Run tests:
make test
-
Deploy to QA:
make deploy
-
Deploy to production:
make deploy_prod
-
Clean up project files:
make clean
-
Update dependencies:
make update
For a full list of commands, you can inspect the Makefile
.
usdcop
: USD to Colombian Pesos (COP)usdveb
: USD to Venezuelan Bolívar (Bs)usdveb_monitor
: USD to Venezuelan Bolívar (Bs) with Monitor rateusdveb_full
: USD to Venezuelan Bolívar (Bs) with official BCV and Monitor ratecopveb
: COP to Bsvebcop
: Bs to COPbtc
: Bitcoin to USDeth
: Ethereum to USDcrypto/{symbol}
: Any crypto currency to USDai
: Question to OpenAI's ChatGPTcodex
: Question to OpenAI's Codex
USD to Venezuelan Bolívar (Bs):
http://127.0.0.1:5001/usdveb
http://127.0.0.1:5001/usdveb/1
USD to Venezuelan Bolívar (Bs) with Monitor (non official) rate:
http://127.0.0.1:5001/usdveb_monitor
http://127.0.0.1:5001/usdveb_monitor/1
USD to Venezuelan Bolívar (Bs) with Monitor (non official) and official BCV rate:
http://127.0.0.1:5001/usdveb_full
http://127.0.0.1:5001/usdveb_full/1
USD to Colombian Pesos (COP):
http://127.0.0.1:5001/usdcop
http://127.0.0.1:5001/usdcop/1
COP to Bs:
http://127.0.0.1:5001/copveb
http://127.0.0.1:5001/copveb/{debug}
Bs to COP:
http://127.0.0.1:5001/vebcop
http://127.0.0.1:5001/vebcop/{debug}
Bitcoin to USD:
http://127.0.0.1:5001/btc
http://127.0.0.1:5001/btc/{debug}
Ethereum to USD:
http://127.0.0.1:5001/eth
http://127.0.0.1:5001/eth/{debug}
Any crypto currency to USD:
http://127.0.0.1:5001/crypto/{symbol}
http://127.0.0.1:5001/crypto/{symbol}/{debug}
Question to OpenAI's ChatGPT:
http://127.0.0.1:5001/ai?q=xxx
The production API URL when deployed to Vercel project named mediabros-apis
:
https://mediabros-apis.vercel.app
This project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! Please feel free to submit a pull request or open an issue.
This project is developed and maintained by Carlos J. Ramirez. For more information or to contribute to the project, visit Mediabros APIs.
Happy Coding!
mediabros_apis
es una aplicación serverless construida con Python usando los frameworks Chalice y FastAPI. Provee un conjunto de APIs para varias funcionalidades, incluyendo consultas de tasas de cambio, integración con la API de OpenAI y mensajería con Telegram para el reporte de errores de las APIs. El proyecto está configurado para despliegue en AWS Lambda usando el Serverless Framework. Es usado como un API backend para BOTs de Telegram y WhatsApp.
- Características
- Tecnologías
- Cómo Empezar
- Uso
- Endpoints de la API
- API de Prueba
- API de Producción
- Licencia
- Contribuciones
- Arquitectura Serverless con AWS Chalice
- Endpoints de API para cambio de moneda (Crypto, USD/COP, USD/VEB, etc.)
- Integración con la API de OpenAI
- Mensajería con Telegram para reporte de errores de las APIs
- Autenticación basada en JWT
- Suite de pruebas completa con
pytest
- Backend: Python, Chalice, FastAPI, Pydantic
- Serverless: AWS Lambda, Serverless Framework
- Base de Datos/Cache: MongoDB
- Pruebas:
pytest
,pytest-chalice
- Dependencias:
boto3
,python-jose
,requests
- Node.js: Usado para herramientas de desarrollo y scripts.
- Python 3.9 - 3.13
- Node.js v20
- Pipenv
- Git
- Make
- Opcional (y recomendado): Pyenv
- Una cuenta de AWS y credenciales configuradas
-
Clona el repositorio:
git clone https://github.com/mediabros/mediabros_apis.git cd mediabros_apis
-
Configura las variables de entorno:
Copia el archivo de ejemplo y rellena tus credenciales.
cp .env-example .env
-
Instala las dependencias:
Usa el
Makefile
para instalar las dependencias de Python y Node.js.make install
Este proyecto usa un Makefile
para agilizar las tareas comunes de desarrollo.
-
Ejecutar la aplicación localmente:
make run
-
Ejecutar pruebas:
make test
-
Desplegar a QA:
make deploy
-
Desplegar a producción:
make deploy_prod
-
Limpiar archivos del proyecto:
make clean
-
Actualizar dependencias:
make update
Para una lista completa de comandos, puedes inspeccionar el Makefile
.
usdcop
: USD a Pesos Colombianos (COP)usdveb
: USD a Bolívar Venezolano (Bs)usdveb_monitor
: USD a Bolívar Venezolano (Bs) con tasa Monitorusdveb_full
: USD a Bolívar Venezolano (Bs) con tasa oficial BCV y Monitorcopveb
: COP a Bsvebcop
: Bs a COPbtc
: Bitcoin a USDeth
: Ethereum a USDcrypto/{symbol}
: Cualquier criptomoneda a USDai
: Pregunta a ChatGPT de OpenAIcodex
: Pregunta a Codex de OpenAI
USD a Bolívar Venezolano (Bs):
http://127.0.0.1:5001/usdveb
http://127.0.0.1:5001/usdveb/1
USD a Bolívar Venezolano (Bs) con tasa Monitor (no oficial):
http://127.0.0.1:5001/usdveb_monitor
http://127.0.0.1:5001/usdveb_monitor/1
USD a Bolívar Venezolano (Bs) con tasa Monitor (no oficial) y oficial del BCV:
http://127.0.0.1:5001/usdveb_full
http://127.0.0.1:5001/usdveb_full/1
USD a Pesos Colombianos (COP):
http://127.0.0.1:5001/usdcop
http://127.0.0.1:5001/usdcop/1
COP a Bs:
http://127.0.0.1:5001/copveb
http://127.0.0.1:5001/copveb/{debug}
Bs a COP:
http://127.0.0.1:5001/vebcop
http://127.0.0.1:5001/vebcop/{debug}
Bitcoin a USD:
http://127.0.0.1:5001/btc
http://127.0.0.1:5001/btc/{debug}
Ethereum a USD:
http://127.0.0.1:5001/eth
http://127.0.0.1:5001/eth/{debug}
Cualquier criptomoneda a USD:
http://127.0.0.1:5001/crypto/{symbol}
http://127.0.0.1:5001/crypto/{symbol}/{debug}
Pregunta a ChatGPT de OpenAI:
http://127.0.0.1:5001/ai?q=xxx
La URL de la API de producción cuando se despliega en el proyecto de Vercel llamado mediabros-apis
:
https://mediabros-apis.vercel.app
Este proyecto está bajo la Licencia MIT. Consulta el archivo LICENSE para más detalles.
¡Las contribuciones son bienvenidas! No dudes en enviar un pull request o abrir un issue si tienes alguna sugerencia o encuentras algún error.
Este proyecto es desarrollado y mantenido por Carlos J. Ramirez. Para más información o para contribuir al proyecto, visite Mediabros APIs.
¡Sé Feliz Programando!