Git Product home page Git Product logo

appointments-api's Introduction

Installation and Setup

Create a virtual environment

python -m venv venv

Activate the virtual environment

source venv/bin/activate    # For Linux
venv/Scripts/activate       # For Windows

Install dependencies. If installation fails, please ensure you have Python 3.10.

pip install -r requirements.txt

Run a local instance of the backend server

cd technical_assessment
python manage.py runserver

Usage

There are currently two apps being used

  • appointments - handles CRUD for actual appointments
  • patients - handles CRUD for patients (mostly just their names)

Appointments

Model

image

The Appointment object contains 4 fields:

  • start_time - a DateTimeField() for when the appointment will start
  • end_time - a DateTimeField() for when the appointment will end
  • patients - a ManyToManyField() linking to the patients included in the appointment
  • comments - a TextField() containing comments for the appointment

API Endpoints

image

  • GET /appointments/ - list out the appointments that currently exist
    • Query parameters:
      • start_date - a date of the format YYYY-MM-DD. Only appointments on or later than this date will be included
      • end_date - a date of the format YYYY-MM-DD. Only appointments on or earlier than this date will be included
  • POST /appointments/ - create a new appointment
  • GET /appointments/{id}/ - retrieve details for one specific appointment
  • PUT /appointments/{id}/ - update an existing appointment with new data
  • DELETE /appointments/{id}/ - delete an existing appointment

Patients

Model

image

The Patient object contains 1 field:

  • name - a CharField() representing the patient's name

API Endpoints

image

  • GET /patients/ - list out the patients that currently exist
  • POST /patients/ - create a new patient
  • GET /patients/{id}/ - retrieve details for one specific patient
  • PUT /patients/{id}/ - update an existing patient with new data
  • DELETE /patients/{id}/ - delete an existing patient

appointments-api's People

Contributors

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