Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

Repository files navigation

GoodStudents Flask API

This project is a simple Flask-based API for managing and querying order data.

Prerequisites

  • Python 3.7 or higher
  • pip (Python package manager)

Setup Instructions

1. Clone the Repository

If you haven't already, clone this repository and navigate to the project directory:

git clone <repository-url>

2. Create a Python Virtual Environment

It is recommended to use a virtual environment to manage dependencies:

python3 -m venv venv

Activate the virtual environment:

  • On Linux/macOS:
    source venv/bin/activate
  • On Windows:
    venv\Scripts\activate

3. Install Requirements

Install the required Python packages using pip:

pip install -r requirements.txt

4. Run the Application

Start the Flask server:

python server.py

The API will be available at http://0.0.0.0:5000/.

API Endpoints

  • / — Root endpoint
  • /orders — Get all orders
  • /orders/count — Get the number of orders
  • /orders/<order_id> — Get order by ID
  • /orders/sum — Get the sum of all products in all orders
  • /orders/<order_id>/sum — Get the sum of all products in a specific order
  • /orders/most_bought — Get the most bought product

Notes

  • The API reads data from orders_mock.json by default.
  • Make sure orders_mock.json is present in the project directory.

Feel free to modify and extend the API as needed.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages