A Python Flask web app using an SQLite database.
If requested I'll create an environment to include this app and a requirements.txt. The moudles required by this app are as follows:
- python 3 (I used version 3.7.0)
- flask
- flask_wtf
- wtforms
- json
- sqlite3
- pathlib
- os
- sys
- To run the app, navigate to the source directory and type: python app.pys
- If running locally, use URL localhost:5000 (127.0.0.1@5000)
This contains two folders:
- source // the Python solution.
- tests // pytest test for the source code.
- The Flask app to run using Python
- Handles http requests, rendering templates
- Provides an interface to the database
- Creates/deletes the database; creates a 'paths' table
- A single interface for the App.py to call the logic to create the database from the text file and query its contents
- Constructs a tree from the supplied text file and each node to write to the database. Creates a tree from the nodes stored in the database (that are returned in response to a query) and produces a list of the full path of each node.
- Provdes a base html file for the others to extend. Includes the navigation bar (so it does not need to be repeated on each page).
- The base url page, proving information on the features provided by this web application
- A REST API to query the database and output results as JSON
- Provides the main search page (web form), allowing the user to search the directory structure and present the results
- Calls into the path_interface.py, to delete and then create the database, from text file. Query's the database and tests for the expected results.
- To run tests, navigate to the test directory and type: pytest test_recursive_file_structure.py
- A text file containing the recursive file structure which is read by this application.
- An SQLite databse file, created and populated by this application.
- Neil Vine 2020