Table of Contents
This project is a simple back-end implementation of the following exercice: https://www.notion.so/Back-Slowwwww-processing-times-a9f751385277466ca00e5ee0b69280dc
- Flask
- See
requirements.txtto read about specific tools required to build and run the project.
Be sure that python 3.9.6 and pip are installed on your system.
All required dependencies are listed in requirements.txt. See Installation for detailed steps on how to create your virtual environment.
Instructions displayed in this file assume you are running the app on a Windows OS. If your system is different, simply replace the commands with the corresponding Unix/macOS equivalent.
- Clone the repo:
git clone https://github.com/GeoffreyDlvl/SlowwwwwProcessingTimes.git- Create a new virtual environment:
py -m venv envThe environment is named
envand can be activated with the following command:.\env\Scripts\activateLeave the virtual environment with the
deactivatecommand.
- Automatically install all dependencies:
py -m pip install -r requirements.txt- Export required environment variables:
.\setenv_windows_dev.bat If you are running on a linux system, run
setenv_linux_dev.shinstead.
- Initialize / reset database:
flask init-db- Start the application:
flask runThis will start a lightweight local development server on your machine. The application runs on localhost:5000.
This project is a back-end implementation. As a result, requests must be sent over HTTP if you want to interact with it. To illustrate the different routes and features available, we will be using Postman. It is advised to download the client to bypass web-browser limitations.
- Route: http://127.0.0.1:5000/archive/upload
- Method: POST
- Body: multipart/form-data
- Route: http://127.0.0.1:5000/archive/info
- Method: POST
- Enctype: application/json
- key: filename
- value: name of the archive (extension included)
- Route: http://127.0.0.1:5000/crack/
- Method: POST
- Enctype: application/json
- key: filename
- value: name of the archive (extension included)
Mock behavior: waits for 10 seconds
- Route: http://127.0.0.1:5000/crack/jobs
- Method: GET
- Route: http://127.0.0.1:5000/crack/jobs
- Method: POST
- Enctype: application/json
- key: jobs_limit
- value: the new jobs limit
- Route: http://127.0.0.1:5000/processing/some_processing
- Method: POST
- Enctype: application/json
- key: filename
- value: name of the archive (extension included)
Mock behavior: waits for 10 seconds.
Multiple processing operations can be added in a queue.
Distributed under the MIT License. See LICENSE for more information.
Geoffrey Delval <geoffrey.dlvl@gmail.com>
Project Link: https://github.com/GeoffreyDlvl/SlowwwwwProcessingTimes





