Vue Storefront is now Alokai! Learn More
Testing local

Integration test

In this section you will find everything you need to build our entire environment to do a deeper test on Alokai + ODOO and make sure if our integration is what you has been looking for. We hope it is 😇

Video tutorial

Now you can watch and follow the steps in this video tutorial. Take your time :thumbsup:

Before you start

Pre-requisites: Docker, Node.js (>=14.19.0), npm or similar and Git.

Last odoo version released: Clone the repo from (https://github.com/odoogap/vuestorefront-docker)

Inside the repo

Its really convenient to test all the ecosystem Vuestorefront - Odoo Integration working in your local machine. We have prepared a docker-compose file that will help you to get started in a few minutes.

Inside the repo downloaded you can find the 17.0 package that contains a startup file startup.sh bash script. It basically detects if mount/extra-addons/graphql_vuestorefront exists or not then its going to clone the odoo alokai modules that you can also find at https://github.com/odoogap/storefront-ui

Installation

First of all we should understand what's inside the docker-compose file. We have 4 services: 🎯 You can go deeper Configuration > docker-compose .

  • Redis: Redis is an open source (BSD licensed), in-memory data structure store, used as a database, cache and message broker. It's used by Alokai to store the cache.
  • db: PostgreSQL database used by Odoo.
  • odoo: Odoo service. This is our backend service that you could use to manage your products, orders, etc.
  • Alokai: Here is our front end integrated to Alokai Storefront.
docker-compose up --build -d
# You might want to check what happens under the hood
docker-compose logs -f

🎯 If you use Docker Desktop on Windows, some .sh files are executed during instalation, so we recommend you to read Docker Desktop Documentation .

After installation

Now just open http://localhost:3000 for Alokai and http://localhost:8069 for local Odoo (credentials admin/admin)

You might not see the top categories (MEN/WOMEN) until the Odoo server is initialized (database init takes time to install all modules)

Tips

How to stop the services?

docker-compose stop

How to clear Odoo database?

Running this command below it will stop all docker services and clears the Odoo local database.

docker-compose down -v

Handle caching with Redis

The REDIS_ENABLED=true into .env file ensure that Redis is enabled to be used. It is used to cache all odoo datas that has been accessed by the browser. Running this command below it will clear the Redis database.

docker exec -it redis redis-cli
127.0.0.1:6379> flushall
OK