A simple web application for managing product inventory, customers, and orders.
- Flask and SQLAlchemy
- Server-side rendering
- Simple custom APIs
/Term_Project/
├── app.py # Main application entry point
├── manage.py # Database initialization script
├── models/ # SQLAlchemy models
├── routes/ # Route handlers
├── templates/ # HTML templates
├── static/ # CSS
├── csvs/ # CSV data files for database seeding
└── databases/ # SQLite database file
Dependencies
- Flask
- SQLAlchemy
- Flask-SQLAlchemy
-
Install dependencies using:
pip install flask SQLAlchemy Flask-SQLAlchemy -
Initialize the database with sample data:
python manage.py -
Run the application:
python app.py -
Open your browser and navigate to:
http://127.0.0.1:8888
The application uses CSV files located in the /csvs folder to populate the database:
Contains product information with the following columns:
name: Product nameprice: Product price (decimal)available: Available inventory (integer)category: Product category
Example:
name,price,available,category
Laptop,999.99,10,Electronics
Coffee Mug,12.99,50,Home
Contains customer information with the following columns:
name: Customer nameemail: Customer email address
Example:
name,email
John Smith,john@example.com
Sarah Johnson,sarah@example.com
GET /api/products: List all productsGET /api/products/{id}: Get specific product detailsPOST /api/products: Create new productPUT /api/products/{id}: Update product informationDELETE /api/products/{id}: Remove a product
GET /api/customers: List all customersGET /api/customers/{id}: Get specific customer detailsPOST /api/customers: Add new customerPUT /api/customers/{id}: Update customer information
GET /api/orders: List all ordersGET /api/orders/{id}: Get order detailsPOST /api/orders: Create new orderPUT /api/orders/{id}/status: Update order status
