datalordstephen / hngx-stage-2

Repo containing code for stage 2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

HNGX Stage Two Task

CRUD REST API

For the stage two task, we were tasked to create a REST API capable of CRUD operations, and dynamically handling parameters.

I built this API with python, making use of the fastapi library and a postgresql database.

Setup

The following steps are necessary to get the API up and running

  • Ensure you have version 3.10.0 (or above) of python installed. Locate the suitable file for your OS, download and install. When installing, ensure that you click the add to PATH option at the bottom left corner when installing.

  • Clone this repo using this command:

    git clone https://github.com/datalordstephen/hngx-stage-2.git
  • Change your directory into the cloned project and create a virtual environment

    cd hngx-stage-2
    py -m venv venv
  • Enter into your virtual environment

    For bash:

    source venv/Scripts/activate

    For powershell and command prompt:

    venv\Scripts\activate.bat
  • Download the requirements:

    pip install -r requirements.txt
  • Start the server:

    uvicorn main:app

That's it!

The server is now running locally at http://127.0.0.1:8000 and can receive requests. Note that the database is hosted remotely, so an internet connection would be needed to successfully run queries.

About

Repo containing code for stage 2


Languages

Language:Python 100.0%