From d1894556f7db3ad01fd38bab34bc49ca709a244f Mon Sep 17 00:00:00 2001 From: Xander Bil Date: Tue, 20 Feb 2024 22:41:33 +0100 Subject: [PATCH] Add setup instructions --- backend/README.md | 43 ++++++++++++++++++++++++++++++++++++++++ backend/requirements.txt | 22 ++++++++++---------- frontend/README.md | 30 +++++++--------------------- 3 files changed, 61 insertions(+), 34 deletions(-) create mode 100644 backend/README.md diff --git a/backend/README.md b/backend/README.md new file mode 100644 index 00000000..f06cd41a --- /dev/null +++ b/backend/README.md @@ -0,0 +1,43 @@ +## Run the backend api + +### Setup + +#### In this directy execute the following command to create a python environment: + +```sh +python -m venv venv` +``` + +#### Activate the environment: + +```sh +source venv/bin/activate +``` + +#### Install the dependencies: + +```sh +pip install -r requirements.txt +``` + +### Usage + +#### Activate the environment: + +```sh +source venv/bin/activate +``` + +#### Run the web server: + +```sh +python app.py +``` + +It will start a local development server on port `5000` + +#### To format the python code in place to conform to PEP 8 style: + +```sh +autopep8 -ri . +``` diff --git a/backend/requirements.txt b/backend/requirements.txt index 5d656837..52f0cf0e 100644 --- a/backend/requirements.txt +++ b/backend/requirements.txt @@ -1,11 +1,11 @@ -autopep8==2.0.4 -blinker==1.7.0 -click==8.1.7 -Flask==3.0.2 -gunicorn==21.2.0 -itsdangerous==2.1.2 -Jinja2==3.1.3 -MarkupSafe==2.1.5 -packaging==23.2 -pycodestyle==2.11.1 -Werkzeug==3.0.1 +autopep8 == 2.0.4 +blinker == 1.7.0 +click == 8.1.7 +Flask == 3.0.2 +gunicorn == 21.2.0 +itsdangerous == 2.1.2 +Jinja2 == 3.1.3 +MarkupSafe == 2.1.5 +packaging == 23.2 +pycodestyle == 2.11.1 +Werkzeug == 3.0.1 diff --git a/frontend/README.md b/frontend/README.md index 045e7d37..342d0329 100644 --- a/frontend/README.md +++ b/frontend/README.md @@ -1,27 +1,5 @@ -# Ugent -This template should help get you started developing with Vue 3 in Vite. - -## Recommended IDE Setup - -[VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur) + [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin). - -## Type Support for `.vue` Imports in TS - -TypeScript cannot handle type information for `.vue` imports by default, so we replace the `tsc` CLI with `vue-tsc` for type checking. In editors, we need [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin) to make the TypeScript language service aware of `.vue` types. - -If the standalone TypeScript plugin doesn't feel fast enough to you, Volar has also implemented a [Take Over Mode](https://github.com/johnsoncodehk/volar/discussions/471#discussioncomment-1361669) that is more performant. You can enable it by the following steps: - -1. Disable the built-in TypeScript Extension - 1) Run `Extensions: Show Built-in Extensions` from VSCode's command palette - 2) Find `TypeScript and JavaScript Language Features`, right click and select `Disable (Workspace)` -2. Reload the VSCode window by running `Developer: Reload Window` from the command palette. - -## Customize configuration - -See [Vite Configuration Reference](https://vitejs.dev/config/). - -## Project Setup +## Setup the frontend ```sh npm install @@ -44,3 +22,9 @@ npm run build ```sh npm run lint ``` + +### Format with prettier + +```sh +npm run format +```