This project is a Node.js application that fetches benefits and discounts from various Argentine banks and stores them in MongoDB. It also provides a REST API to access the collected data.
- Fetches benefits from multiple banks:
- BBVA
- Banco Ciudad
- ICBC
- Banco Santander
- Supervielle
- Personal
- Stores data in MongoDB
- Provides REST API endpoints
- Rate limiting and retry mechanism
- CORS enabled
- Node.js (v14 or higher)
- MongoDB
- pnpm (recommended) or npm
- Clone the repository:
git clone https://github.com/AndresImach/benefits-fetcher.git
cd benefits-fetcher- Install dependencies:
pnpm install
# or using npm
npm install- Create a
.envfile in the root directory with the following variables:
MONGO_URL=your_mongodb_connection_string
PORT=3000
npm startThe server will start on port 3000 (or the port specified in your .env file).
GET /api/benefits- Get benefits from all banksGET /api/benefits/:bank- Get benefits from a specific bank (e.g., /api/benefits/bbva)
To fetch benefits from a specific bank:
node src/[BankName]/fetcher.jsExample:
node src/BBVA/fetcher.jssrc/server.js- Main API serversrc/[BankName]/fetcher.js- Individual bank fetcherssrc/[BankName]/test.js- Test files for bank fetchers
This application is deployed on Vercel. To deploy your own instance:
- Install Vercel CLI:
npm i -g vercel- Login to Vercel:
vercel login- Deploy the application:
vercel- Add environment variables in Vercel Dashboard:
- Go to your project settings
- Add
MONGO_URLwith your MongoDB connection string
The deployment is configured via vercel.json in the root directory.
- Create an account on Railway
- Connect your GitHub repository
- Add the following environment variables in Railway:
MONGO_URL: Your MongoDB connection stringPORT: 3000 (Railway will automatically assign a port)
- Deploy the application
- Create an account on Render
- Create a new Web Service
- Connect your GitHub repository
- Set the following:
- Build Command:
npm install - Start Command:
npm start
- Build Command:
- Add environment variables:
MONGO_URL: Your MongoDB connection stringPORT: 3000
- Install Heroku CLI
- Login to Heroku:
heroku login- Create a new Heroku app:
heroku create your-app-name- Add environment variables:
heroku config:set MONGO_URL=your_mongodb_connection_string- Deploy:
git push heroku main- Fork the repository
- Create your feature branch
- Commit your changes
- Push to the branch
- Create a new Pull Request
ISC