GithubHelp home page GithubHelp logo

customer-information-api's Introduction

Customer Business Management API

The Customer Business Management API is a Django project that will allow you to manage customer and business information efficiently.

Features

  • Customer Management: Add, update, and delete customer details including name, contact information, date of birth, and nationality.

  • Business Management: Manage business information, including business name, registration date, and associated customer details.

  • Location Management: Track business locations by specifying county, sub-county, ward, building name, and floor.

Technologies Used

  • Django: A high-level Python web framework for building web applications.

  • Django Rest Framework: A powerful and flexible toolkit for building Web APIs.

Setup Instructions

Prerequisites

  • Python 3.x
  • pip

Installation

  1. Clone the repository:

    git clone https://github.com/your-username/customer-business-management.git
    
  2. Navigate to the project directory:

    cd customer-business-management

  3. Create a virtual environment (optional but recommended):

    python -m venv venv

  4. Activate the virtual environment:

    • On Windows:

      venv\Scripts\activate

    • On macOS/Linux:

      source venv/bin/activate

  5. Install dependencies:

    pip install -r requirements.txt

  6. Apply database migrations:

    python manage.py migrate

  7. Run the development server:

    python manage.py runserver

    The application will be accessible at http://127.0.0.1:8000/api/.

API Endpoints


  • Customer List: http://127.0.0.1:8000/api/customers/ (GET, POST)
  • Customer Detail: http://127.0.0.1:8000/api/customer-detail/<int:pk>/ (GET, PUT, DELETE)
  • Business Category List: http://127.0.0.1:8000/api/categories/ (GET, POST)
  • Business Category Detail: http://127.0.0.1:8000/api/category-detail/<int:pk>/ (GET, PUT, DELETE)
  • Business List: http://127.0.0.1:8000/api/businesses/ (GET, POST)
  • Business Detail: http://127.0.0.1:8000/api/business-detail/<int:pk>/ (GET, PUT, DELETE)

Creating and Updating Home

{
        "name": "Customer Name",
        "customer_phone": "0712345678",
        "customer_email": "[email protected]",
        "date_of_birth": "2001-1-1",
        "nationality": "Kenyan",
        "customer_details_url": "http://127.0.0.1:8000/api/customer-detail/3/"
    
}

Creating and Updating Business

You can use this example format while creating and updating businesses

{
  "name": "My New Business",
  "category": 1,  # Replace with the ID of the desired business category
  "customer": null,  # Set to null if there is no associated customer
  "registration_date": "2023-03-08",
  "location": {
    "county": "Nairobi",
    "sub_county": "Westlands",
    "ward": "Kitisuru",
    "building_name": "ABC Plaza",
    "floor": 3
  }
}

Admin Panel You can use the admin panel to access and manipulate the APIs data as well http://127.0.0.1:8000/admin username: josh password: adminadminuser

Run Tests

`python manage.py test`

Usage

  1. Access the provided API endpoints using tools like curl, httpie, or your preferred API testing tool.
  2. Use the provided Django Rest Framework frontend by visiting http://localhost:8000/ in your web browser.
  3. Integrate the API into your own frontend application by making HTTP requests to the defined endpoints.

Database Design Diagram

Database Design Diagram

customer-information-api's People

Contributors

joshwaoti 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.