Skip to content

jorgevrgs/meli-react

Repository files navigation

MercadoLibre Products API

Product search bar using the MELI API with NodeJS and React

screenshot

Open the web page, search for a product to get some details and the price.

Built With

Live Demo

Live Demo Link

Getting Started

To get a local copy up and running follow these simple example steps.

Prerequisites

Install NodeJS downloading the installer from the official website. Optionally, you can use volta to manage the NodeJS version.

curl https://get.volta.sh | bash

Install pnpm

npm install -g pnpm

Clone or download the repository

git clone git@github.com:jorgevrgs/meli-react.git
cd meli-react

Setup

Create a .env.local file in the root of the project and add the following variables:

SITE_ID=MCO
DEFAULT_PAGINATION_LIMIT=4
AUTHOR_FIRST_NAME=Jorge
AUTHOR_LAST_NAME=Vargas

Find the SITE_ID in the MELI API sites and copy one of the id values. To simplify the search, the DEFAULT_PAGINATION_LIMIT is set to 4, but you can change it to any number you want.

To create a copy of the .env.example file you can run the following command instead of creating the file manually:

cp .env.example .env.local

Install

Install dependencies

pnpm install

Usage

Start the server

pnpm dev

Open http://localhost:5173 with your browser to see the result.

Run tests

pnpm test

For an e2e test, start the server pnpm run dev and run the following command:

pnpm test:e2e

Deployment

To deploy the app to Vercel, you need to create a new project and link it to the repository. Then, you can deploy the app using the Vercel CLI or the Vercel dashboard.

Additionally, a Dockerfile and docker-compose.yml are included to deploy the app using Docker. To build the image, run the following command:

docker build -t meli-react .

To run the app using Docker, run the following command:

docker run -p 8080:8080 meli-react

Or, use docker-compose:

docker-compose up

Authors

👤 Jorge Vargas

🤝 Contributing

Contributions, issues, and feature requests are welcome!

Feel free to check the issues page.

Show your support

Give a ⭐️ if you like this project!

Acknowledgments

  • Hat tip to anyone whose code was used
  • Inspiration
  • etc

📝 License

This project is MIT licensed.