available api at https://iplvr.it.ntnu.no
- Ensure that git is installed on your machine. Download Git
- Docker is used for the backend and database setup. Download Docker
git clone https://github.com/vr4vet/chat-service.git
cd chat-serviceIt’s best to install dependencies inside a virtual environment:
1. Create a Virtual Environment
Run the following command to create a virtual environment named venv:
python -m venv venv
2. Activate the Virtual Environment
Before installing or updating packages, activate the virtual environment.
On windows:
source venv/Scripts/activate
On linux and mac:
source venv/bin/activate
3. Install Existing Dependencies
follow manual for updating requirements
pip install -r requirements.txtCreate a .env file in the root directory of the project and add the following environment variables:
Run the following command:
uvicorn src.main:app --reloadThe service will now be available at:
Docs UI: http://127.0.0.1:8000/docs API Root: http://127.0.0.1:8000
Check if the service is running:
The /ping endpoint is used to check if the backend is running.
curl http://127.0.0.1:8000/ping✅ Expected response:
{"status":"I AM ALIVE!"}This service can be containerized using Docker for easy deployment.
Run the following command to build the Docker image:
docker build -t chat-service .Once the image is built, start the container:
docker run -p 8000:8000 chat-serviceThe service should now be running at http://127.0.0.1:8000.
Test if the service is running by making a request to the /ping endpoint:
curl http://127.0.0.1:8000/pingExpected Response: {"status":"I AM ALIVE!"}
To stop the running container:
docker ps # Get container ID
docker stop <container_id>If the service is not running as expected:
Check running containers:
docker psView logs:
docker logs <container_id>Make sure Docker is installed and running before executing these commands. The Dockerfile is designed to expose port 8000, so ensure no other service is using this port.
Create a .env file in the root directory by following the .env.example
without docker:
pytest --cov=src --cov-report=term-missingDocker:
docker compose build
docker compose up -d
docker compose run chat-service pytest
docker compose down##Test endpoint with mock data
curl -X POST "http://localhost:8000/api/progress"
-H "Content-Type: application/json"
-d '{
"task_name": "Daily Exercise Routine",
"status": "start",
"user_id": "user123",
"subtask_progress": [
{
"subtask_name": "Warm Up",
"description": "Prepare muscles for workout",
"completed": false,
"step_progress": [
{
"step_name": "Jumping Jacks",
"repetition_number": 30,
"completed": false
},
{
"step_name": "Arm Circles",
"repetition_number": 20,
"completed": false
}
]
},
{
"subtask_name": "Main Workout",
"description": "Intense exercise session",
"completed": false,
"step_progress": [
{
"step_name": "Push Ups",
"repetition_number": 50,
"completed": false
}
]
}
]
}
curl -X POST "http://localhost:8000/api/progress"
-H "Content-Type: application/json"
-d '{
"task_name": "Daily Exercise Routine",
"status": "complete",
"user_id": "user123",
"subtask_progress": [
{
"subtask_name": "Warm Up",
"description": "Prepare muscles for workout",
"completed": true,
"step_progress": [
{
"step_name": "Jumping Jacks",
"repetition_number": 30,
"completed": true
},
{
"step_name": "Arm Circles",
"repetition_number": 20,
"completed": true
}
]
},
{
"subtask_name": "Main Workout",
"description": "Intense exercise session",
"completed": true,
"step_progress": [
{
"step_name": "Push Ups",
"repetition_number": 50,
"completed": true
}
]
}
]
}'
curl -X GET "http://localhost:8000/api/progress"
![]() Tobias Fremming |
![]() Halvor Heien Førde |
![]() Peter Olai Johnsen |
![]() Hallvard Vatnar Olsen |
![]() Erik Le Blanc Pleym |
![]() Selin Yuki Øzkan |
![]() Erik Olsen Bøhle |






