diff --git a/README.md b/README.md new file mode 100644 index 0000000000000000000000000000000000000000..0b1ddb28a6276042ac0de0432a86b9fc1cb7e81b --- /dev/null +++ b/README.md @@ -0,0 +1,32 @@ +# Welcome to Zesje + +Zesje is an online grading system for written exams. + +## Development + +### Setting up a development environment +Make sure you have `npm`, `webpack` (installed via `npm`), and Python 3.5 installed. + +Install the necessary `npm` dependencies: + + npm install + +We will keep the Python dependencies in a virtual environment: + + virtualenv venv + source venv/bin/activate + pip install -r requirements.txt + +### Running a development server +First build all the client-side assets: + + webpack --watch + +the `--watch` flag tells webpack to rebuild the frontend code +whenever files in `client/` change. + +Then, in a separate terminal, run the development server: + + python server + +This will also re-load the code when you make modifications in `server/`. diff --git a/server/__init__.py b/server/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..39fb975e9bfb72491656d5a6da9624458d945324 --- /dev/null +++ b/server/__init__.py @@ -0,0 +1,8 @@ +from flask import Flask + +app = Flask('zesje', static_folder='dist') + +@app.route('/') +@app.route('/<file>') +def index(file=None): + return app.send_static_file(file or 'index.html') diff --git a/server/__main__.py b/server/__main__.py new file mode 100644 index 0000000000000000000000000000000000000000..0051402292aae56f7b074fd584fb344477060ebd --- /dev/null +++ b/server/__main__.py @@ -0,0 +1,2 @@ +from __init__ import app +app.run(debug=True) diff --git a/server/main.py b/server/main.py deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000