A modern biometric access control system built with Python, FastAPI, and SQLAlchemy.
- Python 3.9 or higher
- pip package manager
- Virtual environment module (venv)
- Clone the repository:
git clone <repository-url>
cd biometric-control-access
- Create and activate virtual environment:
python3 -m venv .venv
source .venv/bin/activate # On Windows use: .venv\Scripts\activate
- Install dependencies:
pip install -r requirements.txt
- Set up environment variables:
- Download the
.env
file from the Google Drive - Place it in the project root directory
- Download the
- Initialize Alembic:
# First, backup the existing env.py file
cp alembic/env.py /path/to/backup/env.py
# Remove existing alembic files
rm -rf alembic/
rm alembic.ini
# Initialize new alembic configuration
alembic init alembic
# Restore the custom env.py file to the new alembic directory
cp /path/to/backup/env.py alembic/env.py
- Generate and apply migrations:
# Generate initial migration
alembic revision --autogenerate -m "Creacion de modelos y sus tablas"
# Apply migrations
alembic upgrade head
Load initial data using the provided scripts:
# Load seed data (if available)
python -m app.db.seed_script
# Generate test data (optional)
python -m app.db.test-data-generator
Start the development server:
uvicorn app.main:app --reload
The API will be available at http://localhost:8000
.
├── alembic/ # Database migrations
│ ├── env.py
│ ├── README
│ ├── script.py.mako
│ └── versions/
├── alembic.ini # Alembic configuration
├── app/
│ ├── api/ # API endpoints and dependencies
│ │ ├── deps.py
│ │ ├── __init__.py
│ │ └── v1/
│ │ ├── api.py
│ │ ├── endpoints/
│ │ │ ├── access.py
│ │ │ ├── auth.py
│ │ │ ├── biometric.py
│ │ │ ├── __init__.py
│ │ │ └── reports.py
│ │ └── __init__.py
│ ├── core/ # Core functionality
│ │ ├── config.py
│ │ ├── __init__.py
│ │ ├── security.py
│ │ └── validation_utils.py
│ ├── db/ # Database modules
│ │ ├── __init__.py
│ │ ├── seed_script.py
│ │ ├── session.py
│ │ └── test-data-generator.py
│ ├── __init__.py
│ ├── main.py # FastAPI application entry point
│ ├── models/ # Database models
│ │ ├── access_log.py
│ │ ├── base_class.py
│ │ ├── base.py
│ │ ├── __init__.py
│ │ └── user.py
│ ├── schemas/ # Pydantic schemas
│ │ ├── access_log.py
│ │ ├── __init__.py
│ │ └── user.py
│ └── services/ # Business logic services
│ ├── biometric.py
│ ├── fingerprint_service.py
│ └── __init__.py
├── docker-compose.yml # Docker configuration
├── __init__.py
├── PENDING_README.md
├── README.md # Project documentation
├── requeriments.txt # Project dependencies
└── scripts/ # Utility scripts
├── create_admin.py
└── __init__.py
graph TD
A[Setup Virtual Environment] --> B[Install Dependencies]
B --> C[Configure Environment]
C --> D[Initialize Database]
D --> E[Run Migrations]
E --> F[Load Test Data]
F --> G[Start Development Server]
G --> H{Development Loop}
H --> I[Make Changes]
I --> J[Update Migrations]
J --> H
graph LR
A[Client] --> B[FastAPI Server]
B --> C[SQLAlchemy ORM]
C --> D[Database]
B --> E[Biometric Processing]
E --> F[Access Control]
[...]
For more information or support, please contact the development team at [email protected].