Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions Back-End/API/.dockerignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
__pycache__
.env
env
tests
migrations/
tests
6 changes: 5 additions & 1 deletion Back-End/API/migrations/setup.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env python3

import os
import enum
import uuid
import sqlalchemy
Expand All @@ -9,7 +10,10 @@
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.dialects.postgresql import UUID

engine = create_engine('postgresql://root:password@localhost:5432/koic_detections', echo = True)
engine = create_engine(
os.getenv("DATABASE_URI", "postgresql://root:password@localhost:5432/koic_detections"),
echo = True
)
Base = declarative_base()

class Animals(enum.Enum):
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ And save.
Check that the above steps have been carried out.
If you would test without pi run his command:
```bash
python3 -m pip install -r ./RPIProducer/requirements.txt
./RPIProducer/tests/fake_producer.py
```

Expand Down
3 changes: 3 additions & 0 deletions RPIProducer/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
kafka-python==2.0.2
numpy==1.22.2
opencv-contrib-python==4.5.5.62
2 changes: 1 addition & 1 deletion launch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ fi

sleep 2

if ./Back-End/API/migrations/setup.py &> /dev/null; then
if docker-compose --file Back-End/docker-compose.yml run api migrations/setup.py &> /dev/null; then
printf "${GREEN}[ DONE ]${NC} Create table in DB\n"
else
printf "${RED}[ CRASH ]${NC} Create table in DB\n"
Expand Down