Coder Social home page Coder Social logo

exam-pg6300's Introduction

Exam - Web Development and API Design Build Status

About the application

Before delivering:

  • explicitly state that I am aming for A and every extra effort I have done.
  • report coverage in readme
  • assert test coverage
  • remove unused stuff (like graphql, perhaps)
  • test alle scritps
  • clean up after wallaby
  • optimaliseri mports
  • assert that no part of exercise is forgotten
  • test every feature manually
  • test the app without internet connection
  • deploy most recent version to heroku with "git push heroku master"

Admin user

  • When running in development mode, it is possible to log in with:

Extras

  • I have added styling with Reactstrap. This required adding css-loaders to webpack.config.js.
  • To ensure consistent code-style, I have used ESlint. This is also configured as an extra script.
  • Although not required, I have set up Travis to automatically run tests
  • The app is deployed to Heroku

Assumptions and coices

  • The API
    • The endpoint for accepting/denying friend requests is at DELETE /api/friendRequests/ID. The use of DELETE may seem slightly unintuitive. However, the request is removed from the database when accepted or denied, thus the choice seems appropriate. Arguably, I could have used PUT instead, as the state of a user is updated/modified.
  • Sockets
    • As mentioned in a file from the course repo, using passport for authentication has some limitations with websockets. Another, token-based approach is used. In the timeline.jsx, I use something akin to this token-approach. In conversations.js, however, I use the passport-session to compare emails. My assumption is that for the purposes of this exam, showing two ways of doing something is better than showing one (or none).

General notes

  • Modifications to yarn scripts:
    • configuring yarn start to set environment variable. It indicates wether the server is running in development mode or not. This way, I may add demo data only when application is not in production.
  • notes about copying from course repo
    • Some files are completely copied. Others are copied, and later modified. This is differentiated in the comment.
    • JSON-format does not support comments. package.jsonis partially copied from this file
  • dependencies not used in course
    • eslint and related plugins. This is to create lint-config appropriate for the project (like support for React)
  • nanoid is used for generating random IDs. The library was updated recently, takes minimal amount of space, and has 700k weekly downloads.
    • cross-env is used for setting environment variables. I have access to a Mac. This should make sure that environment variable is working fine on non-UNIX systems as well
    • style-loader for loading styles to reactsrap.
  • on general style
    • I could have written some functional components. In particular, smaller components with no state. However, I chose to stick with class based components for the sake of consistency. By "functional" and "class based", I am referring to the first and second example on this page, respectively.

exam-pg6300's People

Contributors

dependabot[bot] avatar olaven avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.