Create a publication cluster factory: from import to presentation to the author, all through microservices and APIs.
Either with Docker
cd miniscience/src
make docker-init
# or (if no make)
cd miniscience
docker-compose up -d
docker exec web make init
Or without
make init run
# or (if no make)
python manage.py makemigrations
python manage.py migrate
echo "from django.contrib.auth.models import User; User.objects.filter(email='admin@example.com').delete(); User.objects.create_superuser('admin', 'admin@example.com', 'admin123')" | python manage.py shell
Either go to localhost
Or (if the server runs localy) run the test
python manage.py test
Base repo for microservices that will suppor the factory-chain to create cluster of publications.
See Trello board
Install pylint first (pip install pylint), and run
pylint miniscience publications
...
Your code has been rated at 1.78/10
URL: /api/authors
Method: GET
URL params: None
Data params: None
Response Codes: Success (200 OK)
URL: /api/authors/:id
Method: GET
URL params: id=[integer]
Data params: None
Response Codes: Success (200 OK), Failure (404 Not Found)
URL: /api/authors
Method: POST
URL params: None
Data params:
{
"first_name": "First name",
"last_name": "Last name",
"email": "name@provider.com"
}
Response Codes: Success (201 Created)
URL: /api/authors/:id
Method: PUT
URL params: id=[integer]
Data params:
{
"first_name": "First name",
"last_name": "Last name",
"email": "name@provider.com"
}
Response Codes: Success (201 Created)
URL: /api/authors/:id
Method: DELETE
URL params: id=[integer]
Data params: None
Response Codes: Success (204 No Content)
URL: /api/publications
Method: GET
URL params: None
Data params: None
Response Codes: Success (200 OK)
URL: /api/publications/:id
Method: GET
URL params: id=[integer]
Data params: None
Response Codes: Success (200 OK), Failure (404 Not Found)
URL: /api/publications
Method: POST
URL params: None
Data params:
{
"title": "Title",
"pub_date": "YYYY-mm-dd",
"author": [
"http://127.0.0.1:8000/publications/api/authors/<id>/",
"http://127.0.0.1:8000/publications/api/authors/<id>/"
]
}
Response Codes: Success (201 Created)
URL: /api/publications/:id
Method: PUT
URL params: id=[integer]
Data params:
{
"title": "Title",
"pub_date": "YYYY-mm-dd",
"author": [
"http://127.0.0.1:8000/publications/api/authors/<id>/",
"http://127.0.0.1:8000/publications/api/authors/<id>/"
]
}
Response Codes: Success (201 Created)
URL: /api/authors/:id
Method: DELETE
URL params: id=[integer]
Data params: None
Response Codes: Success (204 No Content)
URL: /api/authors/:id/publications
Method: GET
URL params: id=[integer]
Data params: None
Response Codes: Success (200 OK), Failure (404 Not Found)
URL: /api/authors/:id/publications
Method: POST
URL params: id=[integer]
Data params:
{
"title": "Title",
"pub_date": "YYYY-mm-dd"
}
Response Codes: Success (200 OK), Failure (404 Not Found)
URL: /api/authors/:id_author/publications/:id_publication
Method: GET
URL params: id_author=[integer], id_publication=[integer]
Data params: None
Response Codes: Success (200 OK), Failure (404 Not Found)
(c) All rights reserved. ECOLE POLYTECHNIQUE FEDERALE DE LAUSANNE, Switzerland, VPSI, 2017