Download and install Docker Desktop.
- MySQL Database.
- PhpMyAdmin application to be able manually inspect database.
- MailPit application to be able to intercept emails sent by main API-application.
- Main API-application with Swagger UI documentation to be able to explore available API endpoints.
- Open terminal in your projects directory.
- Download GIT-repository:
git clone https://github.com/andrei-kochetygov/training-ground-online-shop.git
. - Enter project directory:
cd training-ground-online-shop
. - Copy
.env.example
file into.env
file:cp .env.example .env
. - Make sure that variable
FRONTEND_URL
(in.env
file) is directed to URL which you are using for you FE-application.
- You can specify path of your FE-application on which user able to reset password via
FRONTEND_RESET_PASSWORD_PATH
variable which is/reset-password
by default. This means that user will receive email with link like${FRONTEND_URL}${FRONTEND_RESET_PASSWORD_PATH}
, which with default configuration will behttp://localhost:3000/reset-password
.
- Open your terminal in this project directory.
- Run
docker compose up --detach --build
command. - Run
docker compose logs --follow api
command and wait until you will seeServer running on [http://0.0.0.0:8000]
message in console, after it you can exit from logs. - Open URL
${APP_URL}
in browser, which by default ishttp://localhost:8000
. - Select service you wanna interact with by clicking on the related link.
First of all go to Swagger UI and under Database
section execute /api/database/refresh
endpoint and provide credentials for the supervisor. You must pass credentials for the supervisor of you database (basically user which can do everything in the system).
- Open your terminal in this project directory.
- Run
docker compose down
command.
On Swagger UI page you can find special endpoints under Database
section which can be used to:
- Refresh database by dropping all tables and execute migration again.
- Seed database with fake data, to be able to perform quickly test you application behavior and improve API endpoints exploration.