Giter Site home page Giter Site logo

mindspace_angular_django's Introduction

Clone this project to your computer (After installing git)

git clone https://github.cs.adelaide.edu.au/MCI-Projects-2021/Team-024.git

Push to github

  1. Commit the current work

    git add .
    git commit -m โ€œ(message)โ€

  2. Push to github

    git push

P.S. It is always good to first run "git pull" first before working on your changes and pushing that into github

Start and run the backend server

  1. With docker installed and update, navigate to the folder /MindSpaceApi and run:

    docker-compose build
    docker-compose up

  2. After that, you can go to http://127.0.0.1:8000/admin to access the admin page of the Django server

Access the database with Django admin page

  1. You can access the server with the following admin account with the database pushed into the current github project:

    Uid: a1
    Password: 123456

  2. If you want to start the Django server with an empty database, after the backend server is built and running, you can run the following command to create a new superadmin user:

    docker-compose run --rm app sh -c "python manage.py createsuperuser"

Import sample data

  1. Data of emotion records has to be saved as mindspace_dataset.csv in the directory /MindSpaceApi/app/. Each row of the csv file is in the format of[UserName, Emotion, PostedDate, Post]. Note that the UserName field has to be either "U1" or "U2" in the current demo. This will allow mapping each entry to the user with "U1_UID" or "U2_UID" specified as environment variables in the file /MindSpaceApi/docker-compose.yml. Also, the PostedDate field has to be in the format of "YYYY-MM-DD" for the following import_data command to work.

  2. Definition of trigger keywords has to be saved as trigger_keywords.csv in the directory /MindSpaceApi/app/. Each row of the csv file is in the format of [Emotion, Trigger keywords]. Trigger keywords field has to be a comma separated list of trigger keywords that maps to the corresponding emotion.

  3. With the data of emotion records and trigger keywords on place. The processed data can be saved into database using the following command after the backend server is built and running:

    docker-compose run --rm app sh -c "python manage.py import_data"

Troubleshooting for running the backend server

  1. Problem: "app" service starts to initiate before "db" service completes its initialization, which causing the "app" service fails to connect to the database

    Solution: Open a new command window and run "docker-compose up" again to let the "app" service to attempt the database connection again

  2. Problem: "app" service fails to connect to the database because of incompatiable innoDB version number (Or any other problems related to the existing database)

    Solution: Delete all the images and building cache of Docker in your local machine with the following command.

    docker image prune -a
    docker builder prune -a

    After that, try to build and run the docker container with "docker-compose build" and "docker-compose up" again

How to run the ionic project

  1. Navigate to the folder /MindSpace, run:

    ionic serve

Testing user accounts

  1. In the current demo, the email and password of the two testing accounts (U1 and U2) are:

    Email: [email protected], Password: 123456
    Email: [email protected], Password: 123456

mindspace_angular_django's People

Contributors

emilylu123 avatar

Stargazers

 avatar

Watchers

 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.