This repository contains the JSON backend server for the FamilyNestWeb application. It is built with Flask and uses a simple JSON file for data storage, making it easy to set up and use for development and testing purposes.
- Simple Data Storage: Uses a single JSON file for storing family tree data.
- Basic API Endpoints: Implements the necessary endpoints to work with the FamilyNest frontend.
- Easy Setup: Quick and easy to set up for local development and testing.
- Backend: Flask
- Data Storage: JSON file for storing family tree data.
Here's an overview of the key files and directories in this project:
main.py: The main Flask application file. It contains all the API endpoints and serves the web pages.dev.py: This is an exemple server for development.fromdist.py: this is to easily update FamilyNest interface.tree/: This directory contains the JSON file used for tree storage.static/: Contains all static assets for the FamilyNest interface.templates/: This directory holds the HTML templates rendered by Flask.
- Python 3.8+
-
Clone the repository:
git clone https://github.com/PaulExplorer/FamilyNestServerJSON.git cd FamilyNestServerJSON -
Create and activate a virtual environment:
python -m venv venv # On Windows .\venv\Scripts\activate # On macOS/Linux source venv/bin/activate
-
Install the required dependencies:
pip install -r requirements.txt
-
Start the server:
python main.py
Once the server is running, you can access the application in your web browser (usually at http://127.0.0.1:5000).
By default, the server uses the trees/main.json file. To use a different tree file, you can use the tree query parameter in the URL:
-
To select a file in the
trees/directory: Append?tree=<filename>to the URL, without the.jsonextension. Example:?tree=my_other_treewill load the filetrees/my_other_tree.json. -
To select a file in a subdirectory of
trees/: Use the format?tree=<directory>:<filename>. Example:?tree=tests:adoption_and_remarriage_chainwill loadtrees/tests/adoption_and_remarriage_chain.json.
Contributions are welcome! Please feel free to submit a Pull Request or open an issue for any bugs or feature requests.
This project is licensed under the AGPLv3 License.