Scales-Nature-Park / start-native-app

MERN based full stack data entry mobile application and admin desktop application for the START project.
MIT License
1 stars 1 forks source link

Data Entry App

A MERN based data entry system that consists of a mobile data entry app and an administrator windows app for managing user credentials and data entry features.

Contributing

Please read our CONTRIBUTING.md to learn about our development process, how to propose bug fixes and improvements, and how to join us in the development of this project.

Features

Components

Project Chart

Dynamic Components

The system uses a set of JSON files and database collections to dynamically execute required tasks.

Fields

fields.json is located at ./app/utils/json/fields.json for the mobile app and ./admin/utils/json/fields.json for the admin app. It specifies all the fields which the Data Entry screen is dependent on.

This file is the secondary source for data entry fields and is statically pushed with the app releases. The primary source is the fields collection in the START-Project database on our mongo deployment. The fields collection can be updated manually through the database or through the admin app to change the displayed fields in the data entry screens on both apps.

Changing the fields doesn't affect old submitted data in the database but hides the deleted fields when searched from the mobile app or entry is opened in the admin app. Exporting the data to google drive will include all hidden fields.

Format:

[
    {
        "Category": "required string", // "All" makes fields appear under any category
        "conditionalFields":  [
            {
                "name": "required string", 
                "dropDown": true,
                "values": ["string", "string"], // undefined if !dropDown
                "initId": 0, // index of default value from values list
                "autoFill": {
                    "dependencies": [
                            "dependent field 1 name", 
                            "dependent field 2 name",
                            "etc."
                    ],
                    "arguments": "dependencies", // above array is argument
                    "body": "return <expression using dependencies argument>;"
                },
                "dataValidation": {
                    "isNumber": false, // true || false
                    "arguments": "input",
                    "body": "return <expression using input>;",
                    "error": "string" // error message if returned false
                },

                // supports nested conditional fields
                "conditionalFields": [ 
                    {
                        "condition": "required string",
                        "name": "required string",
                        "dropDown": false,
                        "defaultValue": "string", // dropDown == false, initialValue
                        "autoFill": {...},
                        "dataValidation": {...}
                    }
                ] 
            }
        ]
    }
]

Search.json

search.json is located at ./app/utils/json/search.json. It specifies all the search criteria fields which the Search screen is dependent on.

Format:

[
    {
        "Category": "required string",
        "ConditionalFields":  [
            {
                "name": "required string",
                "dropdown": true,
                "values": ["string", "string"],
                "Subfields": [
                    {
                        "name": "required string",
                        "dropdown": false
                    }
                ] 
            }
        ]
    }
]

License

This project is MIT licensed, as found in the LICENSE file.