Top Banner
A COMP8755 Project - presented by Dajie Yang (u6513788) Supervised by Dr Peter Strazdins Research School of Computer Science - Australia National University Student Research Project Management System Back-end & Deployment
19

Student Research Project Management System...Database Schema (Implementation) 7 • Implement with Django ORM (Object Relational Mapping) • Many-to-many determine relation on weak

Mar 29, 2020

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Student Research Project Management System...Database Schema (Implementation) 7 • Implement with Django ORM (Object Relational Mapping) • Many-to-many determine relation on weak

A COMP8755 Project - presented by Dajie Yang (u6513788)Supervised by Dr Peter Strazdins

Research School of Computer Science - Australia National University

Student Research Project Management System

Back-end & Deployment

Page 2: Student Research Project Management System...Database Schema (Implementation) 7 • Implement with Django ORM (Object Relational Mapping) • Many-to-many determine relation on weak

Background• Single page application v.s. multi-page application

– Much shorter to no loading time– Render on client side to render on server side– Search Engine Optimization (SEO)

• Decouple web application– Server send raw data, client render it on receive– Parallel development– Isolate bugs to one side– Much more easy to test– More scalability

2

Page 3: Student Research Project Management System...Database Schema (Implementation) 7 • Implement with Django ORM (Object Relational Mapping) • Many-to-many determine relation on weak

Background (cont.)

3

• Representational state transfer (REST) API as web service– Access and manipulate textual representations

(often in JSON) of resources– Use HTTP method to interact with the API– URL as API entries

• Continuous integration / continuous delivery– Merging works as often as possible– Perform all test on every push– Automatic pipeline for build, test, and deploy

Page 4: Student Research Project Management System...Database Schema (Implementation) 7 • Implement with Django ORM (Object Relational Mapping) • Many-to-many determine relation on weak

Background (cont.)• Dockerization / Containerization

– OS-level virtualization, share host system’s kernel– Environment / dependency problem free– Portability– Easy management– Efficiency– Security

4

Page 5: Student Research Project Management System...Database Schema (Implementation) 7 • Implement with Django ORM (Object Relational Mapping) • Many-to-many determine relation on weak

Normal Workflow

5

• Looks simple• Lots of

implications• Serious

permission issues

Page 6: Student Research Project Management System...Database Schema (Implementation) 7 • Implement with Django ORM (Object Relational Mapping) • Many-to-many determine relation on weak

Database Schema (Design)

6

Page 7: Student Research Project Management System...Database Schema (Implementation) 7 • Implement with Django ORM (Object Relational Mapping) • Many-to-many determine relation on weak

Database Schema (Implementation)

7

• Implement with Django ORM (Object Relational Mapping)• Many-to-many determine relation on weak entity

– Django ORM does not even support weak entity– Modify to diamond shape relation

Page 8: Student Research Project Management System...Database Schema (Implementation) 7 • Implement with Django ORM (Object Relational Mapping) • Many-to-many determine relation on weak

Why Django• Mostly, for convenient

– Team member background– Learning curve– Documentation & Tutorial– Django ORM– Just enough performance

• Django REST Framework– RESTful API don’t need to render HTML page– DRF provide a convenient way to quickly create API– Documentation– Browsable API support

8

Page 9: Student Research Project Management System...Database Schema (Implementation) 7 • Implement with Django ORM (Object Relational Mapping) • Many-to-many determine relation on weak

9

Page 10: Student Research Project Management System...Database Schema (Implementation) 7 • Implement with Django ORM (Object Relational Mapping) • Many-to-many determine relation on weak

Layered Architecture in Back-end• Database Model

– Create / update– Query

• Business Logic– Permission checking– Data manipulation– Create database transaction

• API Entry– HTTP methods– Data validation

10

Page 11: Student Research Project Management System...Database Schema (Implementation) 7 • Implement with Django ORM (Object Relational Mapping) • Many-to-many determine relation on weak

API Entries• <base url>/api/

– accounts/• users/• token/• token/refresh/• login/• logout/

– research_mgt/• users/

– <id>/set_course_convener/– <id>/set_formal_supervisor/

• courses/• assessment-templates/• contracts/

– export_csv– <id>/print/– <id>/submit/– <id>/approve/– <id>/supervise/

» approve/– <id>/assessments/– <id>/assessments/<id>/examine/

» approve/

11

Page 12: Student Research Project Management System...Database Schema (Implementation) 7 • Implement with Django ORM (Object Relational Mapping) • Many-to-many determine relation on weak

Authentication• Authentication back-end

– Support existing ANU credential login through ANU LDAP service

– Automatic user information popping from ANU LDAP– Also have own user database to support external

• Token authentication & session authentication

12

Page 14: Student Research Project Management System...Database Schema (Implementation) 7 • Implement with Django ORM (Object Relational Mapping) • Many-to-many determine relation on weak

Permissions• Check permission on every single API entry• Ensure the pre-condition and post-condition must be met• Different permission for different user• Restricted query for different user• AssessmentExamineViewSet as an example:

• ContractViewSet as an example:– Superuser sees all contracts– Convener sees all was submitted contracts– Other users, only display contracts that they involve

14

Page 16: Student Research Project Management System...Database Schema (Implementation) 7 • Implement with Django ORM (Object Relational Mapping) • Many-to-many determine relation on weak

Testing & Continuous Integration• Unit test for individual API• Integration test for the

entire workflow• 92% coverage• 160+ pipelines with 66%

success ratio

16

Page 18: Student Research Project Management System...Database Schema (Implementation) 7 • Implement with Django ORM (Object Relational Mapping) • Many-to-many determine relation on weak

Reference• Token Authentication: The Secret to Scalable User

Management• Docker vs Kubernetes – What Is the Difference?

18

Page 19: Student Research Project Management System...Database Schema (Implementation) 7 • Implement with Django ORM (Object Relational Mapping) • Many-to-many determine relation on weak

Thank you

19