Skip to content

Delphinep26/OpticStore-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

65 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitHub Logo

OpticStore API

=============

Online OpticStore API system using flask, flask-restful, sqlalchemy.

The project has been developed using Flask- A python Micro-web framework and others.

Github link for the project - https://github.com/Delphinep26/OpticStore-API

REST Endpoints

There are 4 major objects in the app:-

  • Users
  • Customers
  • Sales
  • Prescriptions

The endpoints and the corresponding REST operations are defined as follows:

  • Customer

    • /customers
      • GET : This method on above URL returns all the customers available in the database in json format
    • /customer/{int:_id}
      • GET : This method on above URL returns in json format the particular customer available in the database if the customer_id exists.
      • Delete : This method deletes the given customer if the customer_id exists.
    • /customer
      • POST : This method posts a new customer and accept application/JSON format for the operation with first_name and last_name as the only and the required parameter for the JSON.
      • PUT : Same as POST with additional feature of updating the customer object too.
  • Sales

    • /sales
      • GET : This method on above URL returns all the sales available in the database in json format
    • /sale/{int:_id}
      • GET : This method on above URL returns in json format the particular customer available in the database if the sale_id exists.
      • Delete : This method deletes the given sale if the sale_id exists.
    • /sale
      • POST : This method posts a new sale and accept application/JSON format for the operation with the required parameter for the JSON.
      • PUT : Same as POST with additional feature of updating the sale object too.
  • Prescription

    • /prescriptions
      • GET : This method on above URL returns all the prescriptions available in the database in json format
    • /prescription/{int:_id}
      • GET : This method on above URL returns in json format the particular prescription available in the database if the prescription_id exists.
      • Delete : This method deletes the given prescription if the prescription_id exists.
    • /prescription
      • POST : This method posts a new prescription and accept application/JSON format for the operation with the required parameter for the JSON.
      • PUT : Same as POST with additional feature of updating the prescription object too.
  • User

    • /login
      • POST : This method login with username and password if the user_name exists and the password is correct.
    • /register
      • POST : This method posts a new user and accept application/JSON format for the operation with username and password .
      • Delete : This method deletes the given user if the user_name exists.

Unit Testing Endpoints

The Tests for all the modules are located in tests directory and can be fired in two ways:-

Individually by running their individual test modules All at once by running TestAll module which look for all the available modules in the directory and fires the test cases one by one. The Flask's Unittest modules were used for developing the testcases.

Installation

How to Run the App?

Everything should be ready. In your browser open </>

About

No description, website, or topics provided.

Resources

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages