In n-back task you need to remember n previous spatial or auditory stimuli. N-back is a memory test where n refers on how many previous stimuli must be remembered. Dual means that verbal auditory stimulus and spatial visual stimulus are presented at the same time and must be remembered separately.
Back-End: Django
Front-End: React with TypeScript
-
Download and Install Python 3.8.10 (https://www.python.org/)
-
Create a virtual enviroment.
-
Install Virtual Env:
Python3:pip3 install virtualenv
Python2:pip install virtualenv
-
Windows:
- Create Virtual Env:
python -m venv myVirtualEnvName
- Activate Virtual Env:
myVirtualEnvName\Scripts\activate
(activate.bat if it doesn't work) - Remember that to deactivate Virtual Env later just type:
deactivate
(deactivate.bat if it doesn't work)
- Create Virtual Env:
-
Linux:
- Create Virtual Env:
virtualenv myVirtualEnvName
- Activate Virtual Env:
source myprojectenv/bin/activate
- Remember that to deactivate Virtual Env later just type:
deactivate
- Create Virtual Env:
-
-
Clone this project:
git clone https://github.com/TheLittleMister/dualnback.git
-
Install dependencies:
- Inside the project folder (Project root):
pip install -r requirements.txt
- Inside the project folder (Project root):
-
Set project DEBUG mode:
- Open up /dualnback/dualnback/settings.py:
- Change Line 19 with:
DEBUG = True
- Change Line 19 with:
- Open up /dualnback/dualnback/settings.py:
-
Install front-end dependencies and start react project:
- Go to /dualnback/front-end:
- Run:
npm install
to install dependencies - Run:
npm start
to start the project inhttp://127.0.0.1:3000/
- Run:
- Open up /dualnback/front-end/src/utils/utils.tsx:
- Change Line 4 with:
export const urlAPI: string = "http://127.0.0.1:<your backend port>/api/";
- Change Line 4 with:
- Go to /dualnback/front-end:
-
Migrations and Run server:
- Inside the project folder (Project root):
-
- Make Database migrations:
python manage.py makemigrations <app>
- Make Database migrations:
-
- Migrate:
python manage.py migrate <app>
- Migrate:
-
- Run server:
python manage.py runserver
- Run server:
-
- If you want to change server port:
python manage.py runserver <your backend port>
e.gpython manage.py runserver 8080
- If you want to change server port:
-
- Inside the project folder (Project root):
-
To see the changes made before pull request:
- Run
npm run build
in /dualnback/front-end and go to your browser and open:http://127.0.0.1:8000/
orhttp://127.0.0.1:<your backend port>/
- Run
Remember to keep our requirements.txt and package.json files up to date and clean if you contribute to the project:
- Inside the project folder (Project root):
pip freeze > requirements.txt
Before making a pull request:
-
Open up /dualnback/dualnback/settings.py:
- Change Line 19 with:
DEBUG = False
- Change Line 19 with:
-
Open up /dualnback/front-end/src/utils/utils.tsx:
- Change Line 4 with:
export const urlAPI: string = "https://dualn-back.com/api/";
- Change Line 4 with: