Giter Club home page Giter Club logo

brodaoj56 / hng_internship_crud_api Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 20.89 MB

The Person REST API Project is a simple API that provides CRUD (Create, Read, Update, Delete) operations for managing information about individuals. This project demonstrates how to develop a REST API using Django and Django REST framework, allowing you to interact with a PostgreSQL database to create, retrieve, update, and delete person records.

Home Page: https://hngperson.onrender.com/api/

License: MIT License

Python 93.93% PowerShell 0.05% Shell 0.02% CSS 2.15% JavaScript 2.67% HTML 1.18%
api-rest crud-api crud-operation python

hng_internship_crud_api's Introduction

Person API Task

Contributors Forks Stargazers Issues MIT License Twitter

Person REST API Task


Table of Contents
  1. Overview
  2. Features
  3. Technology Stack/a>
  4. How to run the project on Local
  5. API Endpoints
  6. li>Modelling Diagram
  7. Contributions
  8. License
  9. Connect With Me

back to top


Overview

The Person REST API Project is a simple API that provides CRUD (Create, Read, Update, Delete) operations for managing information about individuals. This project demonstrates how to develop a REST API using Django and Django REST framework, allowing you to interact with a PostgreSQL database to create, retrieve, update, and delete person records.

back to top

Features

  • Create: Add new person records with their name.
  • Read: Fetch details of a person by their unique ID or name.
  • Update: Modify the details of an existing person.
  • Delete: Remove a person from the database.
  • Dynamic Parameter Handling: Perform operations on persons by specifying their name.
  • Input Validation: Ensures that the "name" field only accepts string values.

Technology Stack

  • Django: A high-level Python web framework.
  • Django REST framework: A powerful and flexible toolkit for building RESTful Web APIs.
  • PostgreSQL: A popular open-source relational database.
  • Gunicorn: A production-ready WSGI HTTP server.
  • Render: A cloud platform for hosting web applications.

How to run the project on Local and on Live Server

  1. Clone the repository:
https://github.com/BrodaOJ56/HNG_INTERNSHIP_CRUD_API.git
  1. Create and activate a virtual environment (optional but recommended):
 python3 -m venv venv
source venv/bin/activate
  1. Install the dependencies:
pip install -r requirements.txt
  1. Set up the database:
  • Create a PostgreSQL database.
  • Update the database configuration in the setting.py file(Person_api).
  1. Start the development server using
python manage.py runserver
  1. Access the API in your web browser or using tools like Postman:
  • On local
http://127.0.0.1:8000/api
  • On live Server
https://hngperson.onrender.com/api/

API Endpoints

  • GET /api: Retrieve a list of all persons.
  • GET /api/{id}: Retrieve details of a person by their ID.
  • GET /api/?name={name}: Retrieve details of a person by their name.
  • POST /api: Create a new person record.
  • PUT /api/{id}: Update details of an existing person by their ID.
  • DELETE /api/{id}: Delete a person by their ID.

Modelling Diagram

Person is primary model with two attributes: id (primary key) and name (str).

+--------------------------+ | Person | +--------------------------+ | - id: int (PK) | | - name: str | +--------------------------+ | | +--------------------------+

The Person class performs CRUD methods: create(POST), read(GET), update(PUT) and delete(DELETE). These methods represent the basic CRUD operations one can perform on a Person resource.

+-------------------------+ | | | + create(POST) | | + read(GET) | | + update(PUT) | | + delete(DELETE) | | | +-------------------------+

Contributions

Contributions to the project are welcome, and users are encouraged to report any issues or provide suggestions for improvement. The project is open-source and licensed under the MIT License, allowing for further development and customization.

back to top



Connect With Me

OLUBUNMI OLUWATOBI JAMES - @ItzOfficialOJ

back to top


hng_internship_crud_api's People

Contributors

brodaoj56 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.