ExpireEye-backend/
├── 📁 app/
│ ├── 📁 core/ # Core settings, config, security
│ ├── 📁 db/ # Database session & configuration
│ ├── 📁 models/ # SQLAlchemy ORM models
│ │ ├── user_model.py # User database model
│ │ ├── product_model.py # Product database model
│ │ └── user_product.py # User-Product relationship model
│ ├── 📁 routers/ # FastAPI route handlers
│ │ ├── auth.py # Authentication endpoints
│ │ ├── warehouse.py # Product management endpoints
│ │ └── user_inventory.py # User inventory endpoints
│ ├── 📁 schemas/ # Pydantic request/response models
│ │ └── auth_schema.py # Authentication schemas
│ ├── 📁 utils/ # Utility functions
│ │ ├── jwt.py # JWT token utilities
│ │ └── errors.py # Custom error handlers
│ ├── main.py # FastAPI application entrypoint
│ └── dependencies.py # Dependency injection
├── 📁 alembic/ # Database migrations
├── requirements.txt # Python dependencies
├── .env.example # Environment variables template
├── alembic.ini # Alembic configuration
└── README.md # Project documentation
- Python 3.8+
- MySQL/PostgreSQL database
- Virtual environment (recommended)
git clone https://github.com/adgator101/ExpireEye-backend
cd ExpireEye-backend
# Create virtual environment
python -m venv venv
source venv/bin/activate
# Install dependencies
pip install -r requirements.txtCreate a .env file from the template:
cp .env.example .env# Run database migrations
alembic upgrade headuvicorn app.main:app --reloadYour server is now running!
- API Base URL: http://localhost:8000/api
- Interactive Docs: http://localhost:8000/docs
- Alternative Docs: http://localhost:8000/redoc
For handling database migrations Alembic is used here. Below are the command and steps:
alembic init alembicAutogenerate migration scripts based on your models:
alembic revision --autogenerate -m "Migration message"Upgrade your database to the latest revision:
alembic upgrade headRevert the last migration:
alembic downgrade -1- Edit
alembic.inifor DB connection settings if needed. - Edit
alembic/env.pyto set up model imports and metadata.