Open main menu

CDOT Wiki β

Changes

OSD & DPS909 Winter 2018 Release 0.1

6,342 bytes added, 15:36, 17 January 2018
Created page with "=0.1 Release= ==Introduction== You are asked to create an open source [https://stackoverflow.com/questions/671118/what-exactly-is-restful-programming RESTful API] web servic..."
=0.1 Release=

==Introduction==

You are asked to create an open source [https://stackoverflow.com/questions/671118/what-exactly-is-restful-programming RESTful API] web service that can find and extract phone numbers from submitted resources, and be used in a [https://en.wikipedia.org/wiki/Microservices microservice architecture]. See below for details about how the API should function.

Your first release is be due in multiple stages:

* Part A: Create an initial, partial implementation, due Date...
* Part B: Contribute to another student's implementation, due Date...

The goal of this first release is to practice, and make sure you are comfortable with common open source workflows, including:

* using git and GitHub
* managing GitHub repositories
* creating common project and build artifacts in an open source repo (e.g., LICENSE, Readme.md, automation, etc)
* working with third-party dependencies
* creating and responding to Issues
* creating Pull Requests
* reviewing and merging Pull Requests
* the differences between being a maintainer and a contributor in an open source project

==API Description==

Phone numbers seem like a simple thing to work with at first, but it gets [https://github.com/googlei18n/libphonenumber/blob/master/FALSEHOODS.md complicated quickly]. Thankfully, the problem of working with phone numbers anywhere on Earth has already been solved by Google, and the code made open source:

https://github.com/googlei18n/libphonenumber

You are asked to use libphonenumber to create a web service, using whatever programming language you want. Your web server must support the following API endpoints, which all return [https://en.wikipedia.org/wiki/JSON JSON formatted] responses:

1. <code>GET /api/phonenumbers/parse/text/{...string...}</code> to allow sending small snippets of text to be parsed.

For example, requesting <code>/api/phonenumbers/parse/text/nothing</code> should return an empty list <code>[]</code>. Whereas requesting requesting <code>/api/phonenumbers/parse/text/Seneca%20Phone%20Number%3A%20416-491-5050</code> should return a list with a single, formatted phone number <code>["(416) 491-5050"]</code>.

2. <code>POST /api/phonenumbers/parse/file</code> with the request's <code>Content-Type</code> being <code>text/plain</code> and the <code>body</code> containing a base64 encoded text file. This allows larger files to be processed, in addition to small bits of text.

All responses from the API should be given in JSON format, with the exception of errors, which can use HTTP status codes (e.g., [https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#4xx_Client_errors 4xx codes]).

Phone numbers returned from any of the endpoints above should not be duplicated. That is, if a given input includes a phone number more than once, you should only return one copy of it.

==Part A Requirements==

Create a new GitHub repo for your web service. Pick an open source license for your code, making sure it is compatible with <code>libphonenumber</code> and any other dependencies you use. Make sure your repo has both a LICENSE and README.md file, and that your README.md has clear instructions on how to use your code.

Using any programming language you like, write a server that implements the API described above. You must also include '''tests''' to prove that your server implements the API correctly. These tests need to be runnable from the command-line. You may use any testing framework, and test runner you like.

File some '''Issues''' in your repo for enhancements that you'd like to see done to your server. Here are some suggestions, but feel free to file anything you like for fixes/enhancements you need:

# Write more tests to deal with various edge cases
# Add support for parsing MS Word docs. There are lots of existing open source projects that can help parse a Word doc into Text, which can then be parsed by your earlier code
# Add support for parsing PDF files. There are lots of existing open source projects that can help parse a PDF into Text, which can then be parsed by your earlier code
# Add support for parsing images. Use an OCR (e.g., https://github.com/tesseract-ocr/tesseract or http://tesseract.projectnaptha.com/) tool to first extract text from the image, then parse it as you did earlier
# Add automatic linting to the code, using something like [https://eslint.org/ eslint]. Linters find bugs and style issues.
# Add an example client (e.g., web page) that can be used to manually test the API with various types of inputs
# Add support for running the server on a [https://devcenter.heroku.com/start cloud service like Heroku]
# Add automatic continuous integration (CI) via [https://travis-ci.org/ TravisCI], [https://circleci.com/ CircleCI], etc.

Make sure your repo has all your code and tests completed before moving to Part B.

==Part B Requirements==

Find another student's repo and pick '''two Issues''' you'd like to work on, or file your own to fix things you notice are broken. Leave a comment in the issues to let others know that you're working on this (NOTE: only 1 student can work on an issue at a time).

Fork this other student's repo, and create a clone of it. Make a branch for each of the issues you want to fix. For example, if you are fixing Issue 12, create a new branch named '''issue12''': <code>git checkout -b issue12 master</code>. Now fix the code and create a Pull Request to get your changes added.

==4. Submission==

{| class="wikitable"
! style="font-weight: bold;" | #
! style="font-weight: bold;" | Name
! style="font-weight: bold;" | Part A (GitHub Repo URL)
! style="font-weight: bold;" | Part B (GitHub PR URLs)
! style="font-weight: bold;" | Blog Post (URL)
|-
| 1
|
|
|
|
|-
| 2
|
|
|
|
|-
| 3
|
|
|
|
|-
| 4
|
|
|
|
|-
| 5
|
|
|
|
|-
| 6
|
|
|
|
|-
| 7
|
|
|
|
|-
| 8
|
|
|
|
|-
| 9
|
|
|
|
|-
| 10
|
|
|
|
|-
| 11
|
|
|
|
|-
| 12
|
|
|
|
|-
| 13
|
|
|
|
|-
| 14
|
|
|
|
|-
| 15
|
|
|
|
|-
| 16
|
|
|
|
|-
| 17
|
|
|
|
|-
| 19
|
|
|
|
|-
| 20
|
|
|
|
|-
| 21
|
|
|
|
|-
| 22
|
|
|
|
|-
| 23
|
|
|
|
|-
| 24
|
|
|
|
|-
| 25
|
|
|
|
|-
| 26
|
|
|
|
|-
| 27
|
|
|
|
|-
| 28
|
|
|
|
|-
| 29
|
|
|
|
|-
| 30
|
|
|
|
|-
| 31
|
|
|
|
|-
| 32
|
|
|
|
|-
| 33
|
|
|
|
|-
| 34
|
|
|
|
|-
| 35
|
|
|
|
|-
| 36
|
|
|
|
|-
| 37
|
|
|
|
|-
| 38
|
|
|
|
|-
| 39
|
|
|
|
|-
| 40
|
|
|
|
|}