What You’ll Build
By the end of this quickstart, you’ll have:- A running PostgreSQL database with Docker
- The complete BD Scan Face database schema deployed
- A working Prisma Client ready to query your data
- Example queries for managing users and access logs
Clone and Install
First, clone the repository and install the dependencies:
The project uses TypeScript and includes Prisma ORM with PostgreSQL adapter for optimal performance.
Configure Environment
Create a
.env file in the project root with your database connection:.env
The default credentials match the Docker Compose configuration. If you’re using an existing PostgreSQL instance, update the connection string accordingly.
Start PostgreSQL with Docker
Launch the PostgreSQL database using Docker Compose:Verify the database is running:You should see the
postgres:15 container running on port 5432.Run Database Migrations
Apply the database schema migrations to create all tables:This creates the following tables:
user_types- User classification (admin, employee, visitor, etc.)users- User profiles with identification and contact infofaces- Face encodings for recognitiondevices- Access control devicesaccess_logs- Complete audit trail of all access attempts
Generate Prisma Client
Generate the type-safe Prisma Client:The client will be generated in
./generated/prisma/ as configured in your schema.Prisma generates a fully type-safe database client based on your schema, providing autocomplete and type checking for all queries.
Understanding the Schema
BD Scan Face uses a relational database schema optimized for face recognition and access control:Core Models
Next Steps
Database Schema
Explore the complete database schema and relationships
Prisma Client Guide
Learn all available Prisma Client methods
Docker Setup
Configure Docker for your environment
API Reference
Browse the model API reference