Giter VIP home page Giter VIP logo

codestroke-backend's Introduction

About

This is the backend repository for Code Stroke - an app designed to streamline stroke management.

API Documentation

The API documentation is located in api.html. Download and open the file on your computer to view it.

Getting Started

At the moment, the setup process requires a number of configuration steps. In the future, we plan to automate the setup process and provide a clean configuration interface.

Prerequisites

You will need to have a working installation of Python 3 and MySQL 5.6 or 5.7. If you are using MySQL 8, you must choose Legacy Authentication Method as your Authentication method at startup.

It is recommended you use a virtual environment, especially when developing.

You may also require a Visual Studio C++ redistributable to successfully install the required pip modules.

Basic Setup

First, download or git clone this repository.

git clone https://github.com/code-stroke/codestroke-backend.git codestroke-backend

Navigate to the cloned directory. If you are using a virtual environment, make sure it is activated; otherwise, install the pip modules globally.

cd codestroke-backend
pip install -r requirements.txt

Next, you will need to create an app.conf file in this directory. There is a template, template.conf in resources which you can fill in, rename and move to this directory. It is important to get the configuration details right at this stage, otherwise the app will not run correctly. At some point, we hope to move this configuration into a more convenient interface.

Next, from this directory, run:

python quick_setup.py

This will create a test database and a deployment database and will prompt you for details to add the first (and only!) administrator. This administrator account is important, as it is the only way to add clinician users to the app.

Next, try:

python app.py

This starts the development server in debug mode. If all is well, you should be able to navigate to http://localhost:5000 and see a message saying something along the lines of "You cannot access this page directly." This is good as a sanity check.

Stop the development server with Ctrl-c, then run the tests with:

pytest

You should then see whether all the tests pass or not. Hopefully, they'll all pass - if not, you'll have to check which test failed and why.

If you are a developer, you can stop here - however if you want to deploy the server, you will need to undergo a few further steps to set it up. You should refer to your specific server's docs to find out how - for example, if you are using IIS on Windows, you will need to add a web.config file to this directory, configure wfastcgi.py with handler mappings and configure the PYTHON_PATH and WSGI_HANDLER (app.app) values.

Demo Backend

A demo backend API is available on PythonAnywhere and can be accessed at http://codefactor.pythonanywhere.com/.

You will need to be added as a user to demo this API. If you are part of the development team, please speak to one of the development members.

Contributing

API Document Generation

The API documentation is written in the OpenAPI specification. Part of the API documentation (the definitions) are generated from resources/schema.sql using the scripts/scan_schema.py script and should be rerun if changes are made to the schema.

TODOs

The following API changes are suggested for future releases. To avoid breaking the current API, they will be kept on hold for now.

  • Change all timestamp/date-time values to format 2012-04-23T18:25:43.511Z (currently takes string of form 2012-04-23T18:25:43)

codestroke-backend's People

Contributors

moeburney avatar mphan365 avatar wjmn avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.