The small Python Example of OOP FrontEnd - Back-End and Database PythonLibraryProject/ ├── backend/ │ ├── OOPbackend.py # FastAPI OOP Style backend code │ ├── database.py # Database connection and operations │ └── requirements.txt # Python dependencies for both backend and frontend ├── frontend/ │ ├── frontend.py # Flask frontend code │ ├── templates/ │ │ ├── index.html # List books (Frontend HTML) │ │ ├── create.html # Create a new book (Frontend HTML) │ │ ├── book.html # Book details (Frontend HTML) │ │ └── edit.html # Edit book (Frontend HTML) │ └── static/ │ └── styles.css # CSS styles for the frontend └── requirements.txt # Combined requirements for the project (both backend and frontend)
cd project/ python3 -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
cd backend/ uvicorn OOPbackend:app --reload # for OOP version
source venv/bin/activate # On Windows: venv\Scripts\activate cd frontend/ python frontend.py