https://github.com/bforbilly24/radiographpanoramic-fastapi-backend-restapi
Backend REST API of Radiograph Panoramic
https://github.com/bforbilly24/radiographpanoramic-fastapi-backend-restapi
fastapi h5 panoramic postgresql radiograph restapi segmentation sqlalchemy
Last synced: about 2 months ago
JSON representation
Backend REST API of Radiograph Panoramic
- Host: GitHub
- URL: https://github.com/bforbilly24/radiographpanoramic-fastapi-backend-restapi
- Owner: bforbilly24
- License: mit
- Created: 2024-12-31T13:58:49.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2025-06-19T12:26:42.000Z (about 1 year ago)
- Last Synced: 2025-10-10T22:44:14.098Z (9 months ago)
- Topics: fastapi, h5, panoramic, postgresql, radiograph, restapi, segmentation, sqlalchemy
- Language: Python
- Homepage:
- Size: 83.4 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
venv:
using python
```bash
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
```
or if using python3
```bash
python3 -m venv .venv
source .venv/bin/activate
pip3 install -r requirements.txt
```
Setup Database:
### Open alembic.ini and adjust sqlalchemy.url to match the PostgreSQL/MySQL database
_sqlalchemy.url = postgresql://dbusername:dbpassword@localhost:5432/yourdatabase_
or
_sqlalchemy.url = mysql+pymysql://dbusername:dbpassword@localhost:3306/yourdatabase_
Migrate:
### make migration
```bash
alembic revision --autogenerate -m "name_your_table"
```
### if there are changes in the SQLAlchemy model (e.g. adding new columns, changing data types, or adding tables), you need to perform a new migration and run the upgrade.
```bash
alembic revision --autogenerate -m "add column phone into users"
```
This will create a new migration file in migrations/versions/ with the format
_migrations/versions/xxxxxxxxxxxx_add_phone_column.py_
```bash
alembic upgrade head
```
alembic command:
### init alembic
```bash
alembic init migrations
```
### showing history
```bash
alembic history
```
### see a list of all commits (revision IDs) that have been made in the folder
```bash
alembic history --verbose
```
### view migration status in database
```bash
alembic current
```
### see if there are any migrations that have not been applied
```bash
alembic heads
```
### rollback
```bash
alembic downgrade -1
```
or by id
```bash
alembic downgrade
```
### rollback
```bash
alembic heads
```
Compile :
### src/main.py
```bash
uvicorn src.main:app --reload
```
# Folder Structure
```
βββ πmigrations
βββ πversions
βββ 951cd5d7639e_initial_migration.py
βββ abb10ccaa8b5_add_tokenblacklist_table.py
βββ cc893fd61fb5_add_expires_at_to_token_blacklist.py
βββ e4eb2e45db20_initial_migration.py
βββ env.py
βββ README
βββ script.py.make
βββ πsrc
βββ πapp
βββ πv1
βββ api.py
βββ πendpoints
βββ auth.py
βββ category.py
βββ radiograph.py
βββ πcore
βββ config.py
βββ security.py
βββ πdb
βββ base.py
βββ session.py
βββ πhandlers
βββ response_handler.py
βββ πml_models
βββ unet_gigi_100.h5
βββ unet_gigi_penyakit.h5
βββ πmodels
βββ category_model.py
βββ radiograph_model.py
βββ token_blacklist_model.py
βββ user_model.py
βββ πschemas
βββ category_schema.py
βββ radiograph_schema.py
βββ user_schema.py
βββ πseeds
βββ category_seeder.py
βββ run_seeder.py
βββ user_seeder.py
βββ πservices
βββ radiograph_service.py
βββ πutils
βββ dependencies.py
βββ .DS_Store
βββ main.py
```