Page 1 of 8
COSC2674 & COSC2755 (PIoT) Semester 1, 2019
Assignment 2 Specification (Building a Smart Library)
Marks allocated: 100 (worth 25% of the total score)
Deadline: Sunday 26.05.2019 (11:59 pm AEST)
Submit via: Canvas
Work mode: In in a group of 4 (individual submissions discouraged)
Submission format: .zip (No other formats will be accepted)
Face to Face demo: Monday 27.05.2019- Friday 31.05.2019 (No Demo No marks)
0 READ THIS FIRST
The real-life projects that you will face in Industry never come with crystal clear, direct list of
instructions in a linear manner. In fact, the reality is far from that, the project requirements often
come in bits and pieces from often a confused client who thinks that they know everything.
It is the job of requirement engineers to elicit the requirements. Business Analysts then spend good
amount of time clarifying these requirements and creating more sensible, doable and negotiable list
of deliverables.
When you read the specifications for this assignment, you will realise that some of the ones may
have multiple ways of implementing them (just like in real life software development). So instead of
blaming it on the specifications, clarify the requirement(s) either
– via emailing to the lecturer or the head tutor (not your tutors) or,
– posting in discussion board for assignment 2
Do not start this assignment late, you have six weeks to complete it which is more than
enough time to do well and make sure that you use this time judiciously. Starting work at the
last minute will only lead to poor outcome(s).
There are certain specifications which will push you out of the comfort zone. This has been
done on purpose. There are certain parts of the assignment where you will need to do selfresearch as you will not find answers in lectures, tute/labs.
If you do a good job of this assignment, you can choose to add it as a part of portfolio for
future employers. You are being prepared for potential employability prospects.
School of Science / CS & IT
Page 2 of 8
1 Scenario
Your team has been contacted by the local council library to automate the Library Management
System (LMS). This system will be used to borrow, return and maintain the backend information.
You have been tasked create an application for two types of users: library user and library admin.
The details of LMS are mentioned later in this document.
For this assignment, you will be making extensive use of the Google Calendar API
(https://developers.google.com/calendar/v3/reference/) to work with your Raspberry Pi.
You will also be using Google Cloud IoT Platform (https://cloud.google.com/solutions/iot/).
In summary, the implementation of this assignment involves the following components:
• Python documentation tools such as Sphinx
• Unit testing in Python
• Socket Programming
• Writing your own API using Python’s microframework Flask
• AI features such as facial recognition, object detection and Voice detection
• Programming with Cloud databases and,
• Selected Software Engineering Project Management/Tools
As you can see and were told in advance, that this is a longer assignment.
The tasks will be divided into four parts: Pass (PA), Credit (CR), Distinction (DI) and High
Distinction (HD). Decide how much of the assignment you want to attempt, plan accordingly
and do a great job of it.
Remember to start earlier rather than later.
2 Important
You must adhere to the following requirements:
a. Only Raspberry Pi model 3 should be used
b. You must use Python 3.* to complete the tasks. Older versions must not be used.
c. You must use a version control system of some sorts such as GitHub, Bitbucket, etc. A
private repository is to be used ONLY.
d. You must stick to the standard style guide for your Python code:
(https://www.python.org/dev/peps/pep-0008/)
e. You must attend a 20 minutes demo session to get the assignment 2 marked during week
12. A schedule and a booking document will be published later. You must submit the
assignment prior to demo. No submission  No demo  No marks.
School of Science / CS & IT
Page 3 of 8
3 Detail(s) of LMS
3.1 High level architecture diagram
Local d/b on Reception Pi

(Reception Pi)

Python console Facial
authentication Recognition

username logout message
(Master Pi)
Python CONSOLE application Flask W
on Master Pi

(Cloud d/b on GCP IoT platform)
Trained image dataset on
Reception Pi

SOCKETS
Flask WEBSITE
Admin application
On Master Pi
1. Search Book catalogue
2. Borrow
3. Return
4. Logout
1. Get report
2. Add books
3. Remove
books
Data is retrieved Flask based API
from Cloud d/b
School of Science / CS & IT
Page 4 of 8
3.1 LMS features
NOTE: You do not need to implement all these features for the PASS part of the requirements, the
following is a description of all the features:
For library users: The library user arrives at the reception. It is not manned by any person. The
RECEPTION PI (RP) provides two options available for logging into the system:
– using console-based system which allows them to type in the user credentials or,
– using a facial recognition system
The user registration is required for the first-time user. Upon registration the details are stored in a
local database installed on RP. You may use sqlite3 or MySQL.
Upon logging in, a success message along with the username is sent from RP to the MASTER PI
(MP) via sockets.
The user is now presented with another console-based application:
– search for book catalogues based on ISBN/Author name/Book name
– option for borrowing a book/books
– option for returning a book/books
– logout
The business rules for these are described along with the requirements.
Upon logging out a message is sent via sockets from MP to RP.
For library admin: This is a separate website application that runs on MP. It can only be accessed
by admin personnel. For simplicity purposes YOU CAN ASSUME that there is only one admin
(credentials: username = jaqen, password = hghar).
Admin website makes use of an API to
– Add books to catalogue
– Remove books and
– Generate a data visualisation report for books borrowed (day and week wise)
The book database is stored on a cloud environment namely the Google’s GCP IoT platform
(Google Cloud Platform).
YOU ARE NOT ALLOWED TO USE ANY OTHER PLATFORM WITHOUT PRIOR
PERMISSION FROM THE LECTURER/HEAD TUTOR.
You have been provided with a database schema for the books catalogue.
School of Science / CS & IT
Page 5 of 8
4 Tasks
IMPORTANT: Please read
1. You MUST
– complete all the part PA tasks before you proceed to part CR 
– all of part CR tasks before you proceed to DI part 
– all the part DI tasks before you proceed on to HD part.
2. If you wish to attempt only PA and CR parts, you may write procedural Python

3. However, if you want to attempt DI and HD parts, all the code from PA HD must be
object-oriented.
4. Please read rubric on Assignment 2 page for detailed marking guide.
PA part (50 marks)
You will now implement a console menu- based systems on RP & MP. Please note that this part of
the system is not web based.
i. (3 marks) An option to register a new user on RP. The username, password and other
necessary details (first name, last name and email) must be stored on a local database. The
password must be stored in an encrypted (you may hash and salt) format.
ii. (2 marks) An option to login into the system and gain access to the application on MP.
iii. (5 marks) Develop and implement a robust input validation scheme.
iv. (5 marks) Use of sockets (not REST API) to send a login success message and username
from RP to MP.
v. (15 marks) Once MP receives the login information, it should display a menu-based
console application which will allow the user to access library functions:
search a book | borrow a book | return a book | logout
YOU WILL RECEIVE ZERO for storing data in a local database.
All the book related information is stored a Cloud-based database hosted on Google Cloud
IoT Platform (GCP). It is your responsibilities to make sure that you do not exceed the free
tier limit on the GCP.

School of Science / CS & IT
Page 6 of 8
Search a book:
Be able to search by any of the book’s properties and display fields neatly (e.g.,
column’s aligned) in the console.
Borrow a book:
When borrowed the book’s return due date is 1 week from today. A book that is
borrowed cannot be borrowed again until returned. Note when borrowed an event
should be added to a Google Calendar on the return due date detailing the book,
who borrowed the book and that it’s due to be returned. Google calendar will be tied
to the Google login of the user.
User is able to borrow multiple books.
Return a book:
Only a book that is borrowed can be returned. At this prototyping phase of the
system there will be no penalties for a book being returned late. When the book is
returned the event created above in the Google Calendar (detailing when the
borrowed book should be returned) is removed. Google calendar will be tied to the
Google login of the user.
User is able to return multiple books.
You have also been provided with an SQL script
(Assignment2_CreateTables.sql) to create the database in Google Cloud, however
you are
– under no obligation to use it
– feel free to make changes to the schema
Of course, some additions and/or modifications would be needed to do some parts of the
assignment.
But make sure that the database is normalised- this means if you only have one table, you
will lose marks.
vi. (2 marks) Sending logout message via sockets from MP to RP
vii. (8 marks) Complete documentation using Sphinx
viii. (10 marks) Professional use of
• GitHub from day 1 of the development
• Trello board for the development cycle
Proceed to next page
School of Science / CS & IT
Page 7 of 8
CR part (20 marks)
You will now implement a web dashboard for admin implemented via Python microframework
Flask
ix. (5 marks) All of the admin features available via a web dashboard.
x. (5 marks) Create your own RESTful API to talk to the cloud database
xi. (5 marks) Add an extra feature where the admin can generate a visual representation of the
all book lending and return statistics (daywise and weekwise).
xii. (5 marks) Complete documentation using Sphinx, Trello board and Git Hub for this part
Note: If you want to proceed any further, all your code for PA HD part must be object-oriented.
We will cover some parts of these specifications in the course material, but at various places you
will need to do your own research.
If you want to attempt these parts, YOUR GROUP will be issued this equipment:
Microsoft Life Cam
(https://cplonline.com.au/cameras/webcam/microsoft-lifecam-3000-t3h-00014.html)
DI part (10 marks)
xiii. (10 marks = 8 + 2) Implement the facial recognition requirement of the system using
OpenCV. This applies to the user who enters the library and chooses to use facial
recognition authentication instead of console-based authentication. The trained set of
images must be stored in RP.
You must also complete Sphinx documentation and GitHub, Trello board for this part.
HD part (20 marks) : challenging part
xiv. (8 marks) Add the voice/search feature to search the textbooks. This is for the normal user
who is looking to borrow a book. You must use the Google’s Assistant SDK to complete
this part.
xv. (5 marks) Add an object-detection feature to the system, while returning a book, a QR
code can be scanned instead of manually entering the details. You may have to use
OpenCV and other QR related frameworks (ZBar etc.)
xvi. (7 marks) Complete unit test suite for the whole project (ie PA, CR, DI and HD parts).
This is where you can decide what kind of unit tests are required.
You must also complete Sphinx documentation and GitHub, Trello board for this part.
School of Science / CS & IT
Page 8 of 8
5 Late submission and Extension
a. A penalty of 10% per day of the total marks will apply for each day late, including both
weekend and weekdays.
b. After five days, you will receive a zero for the whole assignment.
c. Extension requests should only be emailed to the lecturer (shekhar.kalra@rmit.edu.au)
d. Look out for the Assignment feedback sessions – these will be held during week(s) 9-11. In
the meantime, please bring questions/doubts to weekly consultation sessions held by the
head tutor on Fridays and/or post in the discussion board Assignment 2 folder.
6 Plagiarism
All assignments will be checked with plagiarism-detection software; any student found to have
plagiarised would be subject to disciplinary action. Plagiarism includes
• submitting work that is not your own or submitting text that is not your own
• allowing others to copy your work via email, printouts, social media etc.
• posting assignment questions (in full or partial) on external technical forums
• copying work from/of previous/current semester students
• sending or passing your work to your friends
• posting assignment questions on technical forums to get them solved
• someone else writing your code (ie contract cheating)
A disciplinary action can lead to
• a meeting with the disciplinary committee
• a score of zero for the assignment
• a permanent record of copying in your personal university records and/or
• expulsion from the university, in some severe cases
All plagiarism will be penalised. There are no exceptions and no excuses. You have been warned.
ONCE AGAIN:
Do not start this assignment late, you have six weeks to complete it which is more than enough
time to do well and make sure that you use this time judiciously. Starting work at the last minute
will only lead to poor outcome(s).
There are certain specifications which will push you out of the comfort zone. This has been done on
purpose. There are certain parts of the assignment where you will need to do self-research as you
will not find answers in lectures, tute/labs.
If you do a good job of this assignment, you can choose to add it as a part of portfolio for future
employers. You are being prepared for potential employability prospects.

~~~For this or similar assignment papers~~~