2025-08-17 13:07:21 +00:00
2025-08-17 12:29:24 +00:00
2025-08-17 13:07:21 +00:00
2025-08-16 14:41:12 +02:00
2025-08-17 12:29:24 +00:00
2025-08-17 12:29:24 +00:00

CMT

Starting the application

cd backend
fastapi run --reload app/main.py

DB

MySQL

-- MySQL db setup
cat db_setup.sql | mysql -u root -p
-- table setup
cat db_table_setup.sql | mysql -u admin -p CMT

Postgresql

# Installation - Arch
sudo pacman -Syu postgresql

# Initialising db cluster
sudo -u postgres initdb -D /var/lib/postgres/data

# enable + start service
sudo systemctl enable --now postgresql

# Creating user
sudo -u postgres createuser -P appuser
# Creating db owned by this user
sudo -u postgres createdb -O appuser db_name

# Test
psql "postgresql://appuser:secret@localhost:5432/appdb"

Testing

cd backend
pytest app/test.py

# Curl POST command
curl -X POST "http://localhost:8000/clients/" -H "Content-Type: application/json" -d '{"tin_number": 100752121, "names": "Pax au Telemanus", "phone_number": "0788475021"}'

# Trying updating client details
curl -X PATCH "http://localhost:8000/clients/1" -H "Content-Type: application/json" -d '{"names": "John Wick"}'

# Deletion
curl -X DELETE http://localhost:8000/clients/2
S
Description
No description provided
Readme 250 KiB
Languages
Python 95.2%
Mako 4.5%
Dockerfile 0.3%