diff --git a/README.md b/README.md index 59f6d1c2..68b40cf4 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Miniature Inventory +# Miniature Inventory ## Description @@ -10,6 +10,16 @@ a [Slim4 PHP backend](https://www.slimframework.com/docs/v4/) (due to server res ![Inventory page](./app/public/assets/images/screenshots/dark/collections.png) *Inventory page inside the application* +## Table of contents + +* [Feature Highlights:](#feature-highlights) +* [Using the application](#using-the-application) +* [Contributing](#contributing) + * [Instructions](#instructions) +* [Running the project locally](#running-the-project-locally) + * [The API & Database](#the-api--database) + * [API Client](#api-client-postman) + ## Feature Highlights: - Creating a custom (painting) workflow that fits you best @@ -46,3 +56,31 @@ We welcome any and all contributions! Here are some ways you can get started: 4. Commit and push 5. Submit a pull request 6. Wait for pull request to be merged + +## Running the project locally + +The application is build up into 3 main parts; The webapp, an API and a database. Each of these component can be run +locally which allows you to make some changes and test these before commiting / submitting a pull request. + +### The API & Database + +The API and database can be started locally using [Docker](https://www.docker.com/). There is a Dockerfile inside +the /api folder which can be used to create an image containing the required environment to run the Slim4 API. Since the +API is connecting to a database and a connection is required between its easier to spin everything up using +docker compose. + +```shell +# from the root directory: +docker compose up +``` + +> Note: Running the api container automatically creates/overwrites your .env file with the local database credentials. + +#### API Client (Postman) + +After the containers are started you can open up an API client like [Postman](https://www.postman.com/) +or [Thunder Client](https://www.thunderclient.com/). There is a postman collection in the repository you can +use if you decide on using Postman. + +> Note: Each request must have an Authorization header consisting a bearer token. For development, it's not necessary to +> have a valid token (as its being mocked in the [$tokenMiddleware](./api/src/middleware/token-verification.php#L34)). \ No newline at end of file