- python3
- redis
- mysql
Clone the repo and run these steps:
virtualenv venv -p python3
source venv/bin/activate
source ppath.sh
pip install -r requirements.txt
mysql -u root
CREATE DATABASE nuscloud;
CREATE USER nuscloud;
GRANT ALL PRIVILEGES ON nuscloud.* TO nuscloud;
You need to add tokens.ini
under nuscloud/helpers/
.
Do check the wiki for a template to get started.
sh rundevserver.sh
cd
inside nuscloud
first then:
celery -A nuscloud worker -l DEBUG -E
celery -A nuscloud beat -l info
cd
inside nuscloud\api
first then:
Create a file named client_secrets.yaml following the template in the wiki, configure the client secret and client id only
Create a file named credentials.json and JUST COPY AND PASTE the template in the wiki
After you login, you need to get the CSRF token (x-csrftoken
) and the JWT
token (JWT token
) and send them on every request.
POST: api-token-auth/
Request example:
{
"ivle_token": "Your IVLE token here"
}
Response example:
{
"token": "Your JWT token here"
}
GET: profile/
Response example:
{
"profile": {
"ivle_id": "e0001234",
"name": "JOHN SMITH",
},
"modules": [
{
"name": "PROGRAMMING IN EXCEL",
"code": "CS1234",
"sync": true
},
{
"name": "SOFTWARE PRODUCT ENGINEERING FOR DIGITAL MARKETS",
"code": "CS3216",
"sync": true
}
],
"storages": {
"dropbox": false,
"gdrive": false
},
"status": {
"sync_status": true,
"last_updated": "2018-10-21 03:39:59.114118"
}
}
POST: storages/
Fields
type
must be eitheradd
orremove
storage
must bedropbox
orgdrive
orbox
oronedrive
token
is only required whenadd
ingrefresh_token
is required only whenadd
ing for:box
,onedrive
Request example:
{
"type": "add",
"token": "Your cloud storage token",
"refresh_token": "Your cloud storage refresh token",
"storage": "dropbox"
}
Response example:
{
"status": "Successfully added dropbox token"
}
POST: modules/
Fields:
type
must be eitheradd
orremove
Request example:
{
"type": "add",
"module_code": "CS3216"
}
Response example:
{
"status": "Successfully added CS3216 to be synced for user"
}