GithubHelp home page GithubHelp logo

pikawika / vub-sa-assignment-2 Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 34.38 MB

Assignment 2 for the Software Architectures course @ vub 2020-2021

Scala 24.93% HTML 19.55% CSS 5.44% TeX 16.82% PostScript 33.25%

vub-sa-assignment-2's Introduction

Assignment 2 of Software Architecture course

This is the GitHub repository for the second assignment of the Software Architecture course @ VUB 2020-2021. This assignment was made in the second examination period.

Table of contents

Student info

  • Name: Bontinck Lennert
  • Email: [email protected]
  • StudentID: 568702
  • Affiliation: VUB - Master Computer Science: AI

Important files and folders

Notes on the code

  • The code has been developed on macOS Big Sur by using the IntelliJ IDEA 2021.1.3 Ultimate Edition and the "Scala" plugin by JetBrains.

    • It was validated to work on a Windows 10 machine as well using the same software.
  • For this project, the following version of base software are used (same as WPOs)

    • JRE and JDK 1.8.291
    • sbt 1.3.13
  • The sbt build will provide the Scala Play dependencies.

Running the code

  • Open the build.sbt file available under code\Lennert-Bontinck-SA2\build.sbt with the IntelliJ IDEA.
  • Select Open as Project and select Trust Project.
  • The IntelliJ IDEA should build the build.sbt file providing the dependencies. If all base software was installed with the same versions as used for this assignment, it should provide the correct SDKs as well.
  • By default, the Scala Play compiler is disabled in the IntelliJ IDEA, enable it via the IDEA settings: Languages & Frameworks -> Play2 -> Use Play2 compiler for this project. Press Apply followed by OK
  • Rebuilt the project.
  • Using the terminal inside the IntelliJ IDEA, execute sbt run.
  • Using your internet browser, navigate to localhost:9000.

Default accounts

Some users are loaded in by default, you can see these under users variable in the UserDao class under models. Due to the visibility settings of some of the preloaded posts, SnellenEddy and JohnyBravo will see some posts that Lennert does not.

  • Usernames: Lennert | SnellenEddy | JohnyBravo
  • Password: AmazingPassword

Validated output

Below are some screenshots of the application running, showing the required functionality is there.

Custom titles and favicon in tab

notice that the text before | CarLovers can be passed to the main template which provides the header + nav and footer.

Pages only visible to logged-in users

The custom classes AuthenticatedUserActionand AuthenticatedUserActionWithMessageRequestensure provide actions for pages that are only visible to logged-in users, if not logged in the following screen will be shown.

Register and login capabilities with validation and flash

As per the requirement the user can register and log in. For registration a unique username (ignoring casing) is required, appropriate error handling is provided. Upon successful creation of a user, (s)he can log in and is forwarded to the login screen with a flash provided infobox.

Home page with sorting capabilities and different menu for logged in users

As per the requirement of the assignment, the logged-in user has a different menu (dropdown icon with required options of adding a post, viewing profile and logging out). On the home page, the user can select to view posts in the most recent or most liked order, both are shown below. Notice that the heart like icon is a button and will be coloured pink if the user has liked the post and has an appropriate message below it. Also, notice the Delete and Change visibility are only visible on posts of whom the logged-in user is the author. The CarLovers logo functions as the home button. Also, notice the amount of shown comments is limited to 3 on the home page as well as the length of the description and comment is limited to not cause overflow.

Different posts are shown for different users

As per the requirement of allowing a user to share his posts with a specific list of users, different users have different home views. Notice below that "SnellenEddy" sees a post that user "Lennert" does not. Also, notice that the Delete and Change visibility buttons are not visible for "SnellenEddy" as he is not the author of the post.

Post page allows for commenting

The post page, reachable by clicking Read more or clicking on the post image, allows for a user to place a comment. The same like button as the overview page is also visible. Again notice that only the author of the post will see the delete and edit buttons, which are also reused from the overview page. Also notice that the post page does show the full description and all comments.

Viewing profiles

When clicking on a username (anywhere you find one; comments or post author) or visiting your account from the drop-down menu, the same style of list from the home overview is shown with only the selected user's posts. Visibility is respected and custom messages are shown if the user has no posts etc.

Add post

When adding a post the user must provide 1 JPG/JPEG image and a non-empty description. He can also decide to share the post with everyone or a select list of users. Notice that the author can always see his posts thus his username is not available in the list of users. After adding the post the user is forwarded to the newly added post and shown a flash message.

Edit visibility of a post

As per the requirement of the assignment, one can edit the visibility of a post. When loading this edit page the previous settings are loaded in (compare it with the add post page above!).

Delete post

Deleting the post will also delete the likes, comments and visibility object. It is as simple as clicking the Delete button. The user is forwarded to his profile page and shown an appropriate flash message.

vub-sa-assignment-2's People

Contributors

pikawika avatar

Watchers

 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.