This is a project made for Walmart Chile's challenge. Implemented by Camilo Castro <[email protected]>.
30 June 2020.
You can watch the Example Video that showcase the main functionality.
The project must have:
-
Product Search API (using provided products mongo collection).
-
Palindrome Special Discount.
-
Website with Search and Product Display.
Also:
-
Docker files.
-
Good docs.
-
Good code.
-
Good tests.
-
The Make commands are defined in the Makefile.
-
The Docker configuration is defined in docker-compose.yml.
-
Docker is the main environment where the servers runs.
-
There is a MongoDB server that is the initial service.
-
The backend depends on the MongoDB. Uses the port 3333.
-
The frontend is built and served using NGINX. Uses the port 8080.
The .env
file inside backend/
is ready to be used.
Just in case. The following is the recommended configuration for development environments.
HOST=0.0.0.0 # 0.0.0.0 is needed for accessing from outside the container
PORT=3333
NODE_ENV=development
APP_NAME=Walmart Challenge
APP_URL=http://${HOST}:${PORT}
CACHE_VIEWS=false
APP_KEY=cusYyCYCPpUf2HdOgqSlkyjqJcHeQ2eK
DB_CONNECTION=mongodb
DB_HOST=database # defined in docker-compose.yml in links section
DB_PORT=27017
DB_USER=productListUser
DB_PASSWORD=productListPassword
DB_AUTH_SOURCE=admin
DB_DATABASE=promotions
DB_DEBUG=true
HASH_DRIVER=bcrypt
The command make install
will execute docker-compose up -d --build
and provision the database.
Wait a few moments and you will be able to navigate localhost.
This app can be used as a Website or as an API.
The following query will return the results for the palindrome sadfdas
. The rate has been limited to 1000
requests per minute.
Pagination is possible using the page
query param.
The documentation is available at
Can be accessed using the following connection string:
-
mongodb://productListUser:productListPassword@localhost:27017/promotions?authSource=admin