feat: implement complete CMT backend with API endpoints and test suite

- Add 7 core API endpoints: users, transactions, partners, products, inventory, payments, credit
- Implement role-based authentication (admin/write/read-only access)
- Add comprehensive database models with proper relationships
- Include full test coverage for all endpoints and business logic
- Set up Alembic migrations and Docker configuration
- Configure FastAPI app with CORS and database integration
This commit is contained in:
2025-09-14 21:04:07 +02:00
parent 49c813778b
commit c086f64363
48 changed files with 6992 additions and 126 deletions
-34
View File
@@ -1,35 +1 @@
# CMT
### Starting the application
```bash
cd backend
fastapi run --reload app/main.py
```
### DB
MySQL
```sql
-- MySQL db setup
cat db_setup.sql | mysql -u root -p
-- table setup
cat db_table_setup.sql | mysql -u admin -p CMT
```
Postgresql
```bash
# Installation - Arch
sudo pacman -Syu postgresql
sudo dnf install postgresql-server postgresql-contrib # fedora
# Initialising db cluster
sudo -u postgres initdb -D /var/lib/postgres/data # Arch
sudo postgresql-setup --initdb # fedora
# 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 user + db creation
psql "postgresql://appuser:secret@localhost:5432/appdb"
```