-
Notifications
You must be signed in to change notification settings - Fork 0
Getting Started Inventory
Setting up the Inventory Service involves several steps that ensure the service is ready for development and deployment.
Ensure you have the following tools installed before you begin:
- Visual Studio Code (VSCode) - Preferred editor for managing and editing the code.
- Docker - Essential for creating and managing containers.
- Docker Compose - Used for defining and running multi-container Docker applications.
- Docker and Dev Containers Extensions for VSCode - Enhances the ability to work with Docker from within VSCode.
Follow these steps to set up the Inventory Service:
Start by cloning the repository to your local machine:
git clone https://github.com/SoftwareEngineering-E-Complish/inventory.gitOpen the project folder in VSCode. If you are using the Dev Containers extension, VSCode may prompt you to reopen the project in a container, which you should accept.
In the terminal within VSCode, run the following command to build and start the Docker container. This command also detaches the container, allowing it to run in the background:
docker-compose up --build -dOnce the container is running, use the Attach to Running Container feature of VSCode to connect your editor to the Docker container. This step allows you to develop directly within the container environment.
With the Docker container up and running, the service is accessible via local development endpoints. The Inventory Service's API can be interacted with through:
- Swagger UI: http://localhost:7200/docs
- OpenAPI Specification: http://localhost:7200/openapi.json
To stop the Docker container and clean up the service, use the following command:
docker-compose downThe service's database (DynamoDB) is initialized automatically via the start.sh script included in the Docker setup. This script runs every time the Docker container is started.
While attached to the container, you may install additional VSCode extensions that enhance the development experience, such as the Python extension pack.
To ensure that the Inventory Service functions correctly:
Run automated tests using:
pytestGenerate a code coverage report to assess test coverage:
coverage run -m pytest
coverage report -mFollowing these steps will help you set up and begin working with the Inventory Service efficiently.