COMEM+ Web Services course
The goal of this course is to teach the generic concept of web service, focusing on RESTful APIs as one way to expose such a service. You will:
- Learn the core principles of the REST architectural style.
- Learn how to implement a RESTful API in JavaScript.
- Learn how to manage your source code on a collaborative platform.
- Learn how to deploy your RESTful API on a cloud application platform.
This course is a COMEM+ web development course taught at HEIG-VD.
Plan
-
Tooling
-
Basics
- JavaScript
- Node.js JavaScript runtime
- npm Node.js package manager
- RESTful APIs
-
Creating a web service
-
Deploying your web service
- Heroku cloud application platform
-
Enriching your web service
- RESTful API conventions
- Express best practices
- Utilizing Mongoose in Express (filtering, pagination, aggregation)
- Express Authentication
- RESTful API documentation with apiDoc
What you will need
- A Unix CLI (Git Bash is included with Git on Windows)
- Git
- A free GitHub account
- Google Chrome (recommended, any browser with developer tools will do)
- Node.js 6+
- Postman (recommended, any tool that makes raw HTTP requests will do)
- MongoDB
- A free Heroku account
- The Heroku CLI
Useful links
- Architecture & source code management diagrams
- Demonstration REST API implemented with Express (documentation)
- Command line cheatsheet
- Git cheatsheet
- Project suggestions
Evaluation
Web Service
Your REST API must be developed with the Express framework and use a MongoDB database. It must provide (at least):
- The API must provide user management:
- New users must be able to register.
- Existing users must be able to authenticate (to allow users to log in).
- The API must provide at least 2 other types of resources:
- Both types must be linked together (e.g. aggregation or composition).
- At least one of the types must be linked to users.
- The API must provide minimal CRUD operations to manage and use those types in a mobile application.
- The API must use the knowledge learned during the course:
- At least one resource must be a paginated list.
- At least one resource must be a list with optional filters.
- At least one resource must provide aggregated data from other resources using a MongoDB aggregation pipeline (e.g. the number of items created by a user).
- The API must be developed as a backend to a mobile application
using at least 2 mobile hardware features, for example:
- At least one resource must be geolocated.
- At least one resource must have one or multiple pictures (it is sufficient to store a picture URL or URLs in the database).
- Sensitive operations must be protected by requiring valid authentication.
- Authentication must be provided in the form of a JWT token or an equivalent mechanism.
Infrastructure
- The source code of your REST API must be in a repository on GitHub.
- Your REST API must be deployed on Heroku.
Documentation
- Your REST API must be documented.
Quality of the implementation
- You must follow REST best practices:
- Your REST resources must use appropriate HTTP methods, headers and status codes.
- Your REST resources must have a consistent URL hierarchy and/or naming structure.
- Your asynchronous code must be correct.
- Your Express routes must handle asynchronous operation errors.
- You must avoid excessive code duplication (e.g. using Express middleware).
- Your API must have basic validations on user input (e.g. using Mongoose validations).
- Your API must validate the existence of linked resources (e.g. when creating an item linked to a user).
Delivery
Send an e-mail no later than November 5th 2018 to Simon Oulevay with:
- The list of group members.
- The link to your source code repository on GitHub.
- The to your deployed REST API on Heroku.