Skip to content

3. Technical Docs

Tamer Hamad Faour edited this page Nov 25, 2024 · 1 revision

Technical Documentation

This document provides an overview of the technical aspects of the project, including API usage and Dockerfile configuration.


API Usage

You can interact with the FastAPI app via the following endpoints:

1. Retrieve All Items

  • Endpoint: GET /items
  • Description: Fetches a list of all available items.

2. Create a New Item

  • Endpoint: POST /items
  • Description: Allows the creation of a new item by sending the required data in the request body.

Dockerfile Explanation

The application uses a Dockerfile to configure and initialize a PostgreSQL database. Below is a breakdown of its setup:

Dockerfile Content

FROM postgres:15
ARG POSTGRES_USER=postgres
ARG POSTGRES_PASSWORD=postgres
ARG POSTGRES_DB=postgres

ENV POSTGRES_USER=$POSTGRES_USER \
    POSTGRES_PASSWORD=$POSTGRES_PASSWORD \
    POSTGRES_DB=$POSTGRES_DB

COPY db/init.sql /docker-entrypoint-initdb.d/
Clone this wiki locally