Ayamigah16 / person_api

A simple REST API capable of CRUD operations on a "person" resource

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Personify API

A simple REST API capable of CRUD operations on a "person" resource

Table of Contents

Getting Started

Prerequisites

All dependencies are in the requirements.txt file

Installation

Use the steps below to run the personif-api locally

  • Clone the repository git clone hngx-person-api
  • Navigate to the Project Directory cd **person_api"
  • Activate the virtualenv venv\Scripts\activate
  • Install Dependencies pip install -r requirements.txt
  • Apply Database Migration python manage.py migrate
  • Create a Superuser (optional) python manage.py createsuperuser
  • Run the Development Server: python manage.py runserver

API Endpoints

These are the list of the endpoints

  • GET /api/: List all persons.
  • POST /api/: Create a new person.
  • GET /api/user_id/: Retrieve details of a person by name.
  • PUT /api/user_id/: Update details of a person by name.
  • DELETE /api/user_id/: Delete a person by name.

Sample Request

http
GET /api/persons/Alice/

Sample Response

    "id": 1,
    "name": "Alice",
    "dob": "1990-01-15",
    "email": "alice@example.com",
    "phone_number": "+1234567890",

Contributing

Contributions are warmly welcomed. You can fork the repo and add some features, as well as report bugs.

About

A simple REST API capable of CRUD operations on a "person" resource


Languages

Language:Python 99.7%Language:Procfile 0.3%