Skip to content

About

A template repository for BAI Database Design Course Project

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

14 Commits

Folders and files

E-Commerce Database Project

A starter repository for the Database Course project. Design, implement, and evaluate a relational database for an e-commerce application.

Requirements

  • Docker with Docker Compose
  • Git
  • A PostgreSQL client (optional)

Quick Start

  1. Copy .env.example to .env.

  2. Change the database password in .env.

  3. Start PostgreSQL:

    docker compose up -d
  4. Connect to the database:

    docker compose exec db psql -U student -d ecommerce
  5. Stop PostgreSQL:

    docker compose down

A few important details

  • PostgreSQL 18: Uses the current major version specified in the image tag. For reproducible grading, the instructor can later pin an exact image version or digest.
  • Persistent storage: postgres_data keeps database files when the container is stopped or recreated.
  • Initialization scripts: SQL files in sql/init/ run only when PostgreSQL initializes an empty data directory.
  • Health check: pg_isready lets Docker report when PostgreSQL is ready to accept connections.
  • Environment variables: Compose reads the local .env file, which should not be committed to Git.

Important: PostgreSQL 18 uses /var/lib/postgresql as the recommended volume mount target for its official image. This differs from the mount path commonly used with older PostgreSQL image versions.

Starting the database

After creating .env from .env.example, run:

docker compose up -d
docker compose ps

Connect using:

docker compose exec db psql -U student -d ecommerce

To stop the database without deleting its data:

docker compose down

To delete the database and its persistent data, use docker compose down -v. This permanently removes the stored database, so students should use it only when they intentionally want a clean environment.

Project Structure

  • sql/ — schema, queries, and tests.
  • scripts/ — data generation and testing utilities.
  • docs/ — design documents, diagrams, and reports.

See the course assignment for project requirements.

Note: This repository provides the development environment, not a completed database implementation.

About

A template repository for BAI Database Design Course Project

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors