A RESTful Flask API which uses redis to expose oceanography data with a visualizer. The visualizer was build using create-react-app and the react-three-renderer.
- Install repository and submodule:
git clone --recursive https://github.com/hardinthepaints/ocean-app-server
- Install requirements:
pip3 install -r requirements.txt
- Install redis:
brew install redis
- In app/db, run
redis-server redisdb.conf
to start the redis server. - To run the flask development server:
python3 run.py
- If the redis server is not running, in app/db, run
redis-server redisdb.conf
to start the redis server. - Start the flask server:
python3 run.py
in the root directory.python3 run.py -d
to run in debug mode. - To run from command line in debug mode:
$ export FLASK_APP=run.py
$ export FLASK_DEBUG=1
$ flask run
- Go to http://localhost:5000/oceanapp/v1.0/app/static/react-ocean-app/build/index.html to view the visualizer.
- For documentation of API endpoints, go to http://localhost:5000/oceanapp/v1.0/doc/.
- Make sure the redis db is running.
- in /test_app, run
python3 -m unittest discover
to run all the tests.
The scripts app/db/setup_data.py
, app/db/db_functions
and app/forcastdownloader.py
are for downloading the data in netCDF4 format and culling out relevant data to be compressed and stored in the database. As it is now, the redis db contains 72 hours' worth of temp and salinity data. To download the data, run python3 setup_data.py
.
- Create RESTful API reference
- Unit Tests
- Fix tests/python_test.py
- Add streaming capability
- Send time-based range of frames
- Require username + password
- Compression with gzip
- Compression by altering json float precision
- Database
MIT