Product search bar using the MELI API with NodeJS and React
Open the web page, search for a product to get some details and the price.
To get a local copy up and running follow these simple example steps.
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
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 dependencies
pnpm install
Start the server
pnpm dev
Open http://localhost:5173 with your browser to see the result.
pnpm test
For an e2e test, start the server pnpm run dev
and run the following command:
pnpm test:e2e
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
👤 Jorge Vargas
- GitHub: @jorgevrgs
- Twitter: @jorgevrgs1
- LinkedIn: LinkedIn
Contributions, issues, and feature requests are welcome!
Feel free to check the issues page.
Give a ⭐️ if you like this project!
- Hat tip to anyone whose code was used
- Inspiration
- etc
This project is MIT licensed.