GithubHelp home page GithubHelp logo

cafeteria-management-system's Introduction

Hi 👋, I'm Peeyush Goyal

A passionate developer who loves to build software creating value in other people's lives

peeyush14goyal

  • 👨‍💻 All of my projects are available on Github

  • 💬 Ask me about ReactJS

  • 📫 How to reach me [email protected]

Connect with me:

peeyush-goyal154 rkapoor1401 peeyush14goyal

Languages and Tools:

cplusplus css3 cypress express html5 javascript mongodb nodejs postgresql rails react ruby sass typescript

 peeyush14goyal

cafeteria-management-system's People

Contributors

peeyush14goyal avatar

Watchers

 avatar  avatar

cafeteria-management-system's Issues

Code Review

  1. Naming conventions. In Ruby we use snake_case. The codebase uses camelcase. For eg: Order#pendingOrders should be Order#pending_orders. Please make this change for all identifiers across the codebase. While this does not functionally affect the system at all, there is a strong consensus in Ruby and Rails communities on using snake_case.

  2. Do not check for current_user_role == “admin”. Instead, create ApplicationController methods like is_admin? so we can avoid spreading the internal details of how we store user roles across the system. So in future if we have to make a change to how we do role management, then we need to look only in a few localized places.

  3. Use the domain terminology in our code. current_orders is better called as cart_orders, or something similar as long as it clearly indicates that it is for the shopping cart. This approach is called “Ubiquitous language” in Domain driven design. Read more: https://martinfowler.com/bliki/UbiquitousLanguage.html

  4. Move logic into model. Controllers should be thin. The purpose of a controller is to simply parse the params and call the appropriate model methods. Think of it as an orchestrator. But why do we do this? This is the core principle behind MVC - Model, View, Controller. The reason we want to centralize all the domain logic in the model is that we might need to use it from different parts of the application. Different controllers might want to use the same behavior. Or we might want to write an external Rake task that will need this same functionality. If we don’t do this grouping of logic together in the model, then over time the codebase will become difficult to work with. If we have to change some behavior, then we wouldn’t know exactly where to look. Logic would be spread out across the codebase and it will become a “tangled mess”.

    A few instances where logic should move into model methods:
    a) UsersController#cart - it removes items that are no longer available. You could try creating a CurrentOrder#self.available_items method to do this.
    b) OrdersController#update
    c) Actions in MenusController
    d) CurrentOrdersController#update

  5. Please implement the reports as well (see “Reports” in https://www.pupilfirst.school/targets/2316)

User Experience (UX) Review

How it works

  1. In shopping cart, When I add a quantity to an item, it shows “Quantity is 0” in the flash. I didn’t understand it. Can you make it more descriptive?
  2. Can you show the current quantity for each item in the cart in that page? Right now it is not possible to know how many items I have in the cart until I confirm the order.

How it looks

  1. The opening menu (Go To) is quite clear and nicely done.
  2. Do give a highlight to all buttons when hovering. You can do something like: .divButton:hover { background-color: darkblue; } This way we get more visual feedback on clickable buttons.
  3. In /orders/new, when hovering over an item, it changes the size. That’s a little disorienting for the user. Instead of transforming the size, you could simply change the background color. Or you could give a border. eg:
  		.CurrentOrderItems { border: 1px solid transparent; } 
		  .CurrentOrderItems:hover { border: 1px solid white; } 

By giving a 1px transparent border when not hovered, we are able to avoid the div changing its size on hover.

  1. In orders/new, each of the item takes a lot of space to see. Can you make it so that it doesn’t take say more than 50px per item? For this you would have to make the picture smaller. You would also want to bring the Quantity entry in the same row as the description, price, and button.
  2. In orders/new, the Quantity entry is too small. It is difficult to click on it and increase/decrease. Do make it larger so users have an easier time using it.
  3. In orders/new, try to limit the width of the item bar. Right now it is spread over 1300px in a large monitor. So to click on Add I have to move the mouse a lot. Ideally put a max-width of around 700 px.
  4. In /menus, the menu name is at the extreme left, and its contents are in the center. It is difficult to parse and understand what is going on. Can they be moved so they are closer together? Same for /users/all and other pages that have this layout.
  5. In /menus, the information density in the page is quite low because of a lot of whitespace. I’d recommend reducing the height of each menu item so more content can be packed together. Another option is to make it into a 3 column grid (like how app icons are arranged in Android home screens).

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.