Code Monkey home page Code Monkey logo

dsufoodbank's Introduction

DAL Food Bank

1. Overview

The main idea behind this web application is to provide easy access to Dalhousie University's foodbank to all the Dalhousie community members. This application will be titled as "DSU Food Bank." It will be accessible not only by current students but all the staff and alumni of the Dalhousie University residing in the province. The primary purpose of this application is to digitalize the current system and make it more transparent. This system will make the work more efficient for the DSU authorities as everything will be available digitally. This application will efficiently work for the food bank to manage the demand and supply of food and all necessary items. Also, looking at the current scenario of such pandemics, this will provide essential food to the members and help to maintain social distancing.


1.1 Prerequisites

To have a local copy of assignment up and running on your local machine, you will first need to install the following software and environment.

  1. Node JS
  2. npm
  3. Angular CLI
  4. Editor (Preferred - Visual Studio Code)

See the following section for detailed step-by-step instructions on how to install this software / libraries / plug-ins

2.Application

2.1 Installing

It is assumed that you have installed all the tools required to run the application.

  1. Open terminal in root of the application directory.
  2. Install all the required npm packages. It may take some time to complete.
npm install
  1. Run the application in development server and open localhost:4200 in browser.
npm run dev

This command will run script ng serve configured in package.json.

  1. To build application for Production Server, run following command.
npm run build

2.2 Page Links

Other than these pages listed below all other links present in webpage will navigate to Home Page

  1. Home Page - https://dsufoodbank.herokuapp.com/home
  2. Login - https://dsufoodbank.herokuapp.com/login

Order and Order detail page will not be accessible without Login

  1. Order - https://dsufoodbank.herokuapp.com/orders
  2. Order Detail - https://dsufoodbank.herokuapp.com/orders/7542

Note:

Order Detail page can only be accesse using the view order button present in Order page table.

  1. 404 Error Page - https://dsufoodbank.herokuapp.com/404

2.3 About Pages

  1. Home Page - This page will be the landing page for the website. Some of the content provided in this page would be about the food bank. Services it provides and a small section for volunteers is present.
  2. Login - Login page is provided for authenticating the user. For current design for login email and password is required. For better user experience and avoiding the errors Login but will only get activated if both the feilds has valid input.
  3. Order - This page will contain all the order places by the user. All the orders are displayed in tabular form. Colums to this table are Order id, Order Date, Receive Date, Status, View Order Detail.
  4. Order Details - Order detail page will show the order and all the items given in particular order. This page can only be access using the order id. Along with the items it will show the progress bar having status of order.

2.4 Webpage Validation

  1. Login - For login I have validated both email and password field. For mail I have used Regular Expression for validating the Email Id entered by user. Even both the fields are required to be filled. Code of these validation is written in login.component.ts.
  2. Order & Order Details - These two pages will not be accessed usnless user has login. If the user is not logged into the system he/she will be navigated to the login page. User can not directly navigate to the order or order details page without login.

2.5 Technology Stack

Development, build and quality processes are based on angular-cli and NPM scripts, which includes:

  • Automatic code formatting with Prettier

For giving the website aesthetic feeling and making it more responsive some of the build should be generated which are listed below.


2.6 Reason Of Usage

  1. Dark Nav Bar - For Nav Bar I have used Material Bootstrap library. The reason behind using this clases is to make nav bar responsive. I have choose #5f5f5f color for background. This is because the dark nav bar would contrast with the main body which is light in color.
  2. Dark Footer - Footer used in this project is kept dark, same as the Nav bar. This is also kept because of the main body color.
  3. Light Background - Main reason keeping the background white in color is that it enhances the look and feel of the website. Also while using any colorful image it sharpens the image's color.
  4. Font - All the fonts used in this website is default font given by browser. Some of the fonts are changed and set acording to the webpage.
  5. Typography - Typography of the webpages is kept minimalistic and asthetically pleasing. All the fonts used in the website makes sure that user can read all the content easily.

2.7 Responsiveness Testing

  1. Screen Resolution (1920x1080) Normal laptop screen
  2. Screen Resolutoin (375x812) iphone X
  3. Screen Resolution (1024X1366) ipad pro

2.8 Libraries

3. Sources Used

orders.component.ts

Lines 13-25

export class OrdersComponent implements OnInit, OnDestroy {
  constructor(private router: Router) {}
  displayedColumns: string[] = ['Order Id.', 'placed_date', 'pickup_date', 'status', 'actions'];
  xyz = new MatTableDataSource<orders>(ORDERS);

  @ViewChild(MatSort, { static: true }) sort: MatSort;
  @ViewChild(MatPaginator, { static: true }) paginator: MatPaginator;

  ngOnInit() {
    this.xyz.paginator = this.paginator;
    this.xyz.sort = this.sort;
  }

The code above was created by adapting the code from Angular Material as shown below:

 displayedColumns: string[] = ['position', 'name', 'weight', 'symbol'];
 dataSource = new MatTableDataSource(ELEMENT_DATA);

 @ViewChild(MatPaginator, {static: true}) paginator: MatPaginator;

  ngOnInit() {
    this.dataSource.paginator = this.paginator;
  }
  
  @ViewChild(MatSort, {static: true}) sort: MatSort;

  ngOnInit() {
    this.dataSource.sort = this.sort;
  }

order-details.component.ts

Lines 12-21

  orderId: number;
  order: orders;

  ngOnInit() {
    this._route.params.subscribe((params) => {
      this.orderId = +params.id;
    });

    this.order = this.orderDetail.getItem(this.orderId);
  }

The code above was created by adapting the code from Range.io as shown below:

 id: number;
  private sub: any;

  constructor(private route: ActivatedRoute) {}

  ngOnInit() {
    this.sub = this.route.params.subscribe(params => {
       this.id = +params['id']; // (+) converts string 'id' to a number
  • The code used in order-details component is refered from the Range.io website.
  • This code is used for getting the order id from the route parameter passed from orders.html.

3.1 References

3.2 Image Refrences

Date Created

  • Date Created: 11 JUN 2020
  • Last Modification Date: 14 JUN 2020

Authors

dsufoodbank's People

Contributors

janimalav avatar

Watchers

Gabriella Mosquera 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.