Skip to content

PaulExplorer/FamilyNestServerJSON

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FamilyNest JSON Server

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.

Features

  • 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.

Technologies

  • Backend: Flask
  • Data Storage: JSON file for storing family tree data.

Project Structure

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.

Getting Started

Prerequisites

  • Python 3.8+

Installation

  1. Clone the repository:

    git clone https://github.com/PaulExplorer/FamilyNestServerJSON.git
    cd FamilyNestServerJSON
  2. Create and activate a virtual environment:

    python -m venv venv
    # On Windows
    .\venv\Scripts\activate
    # On macOS/Linux
    source venv/bin/activate
  3. Install the required dependencies:

    pip install -r requirements.txt
  4. Start the server:

    python main.py

Usage

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 .json extension. Example: ?tree=my_other_tree will load the file trees/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_chain will load trees/tests/adoption_and_remarriage_chain.json.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request or open an issue for any bugs or feature requests.

License

This project is licensed under the AGPLv3 License.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published