eManager - Data Centric Development Milestone Project 3
-
The idea of developing this web application is a result of a discussion I had with a friend of mine, about his need to use a tool to organize the flow in the activity of his restaurant. We've sketched on paper some ideas and we concluded to a simple application, for the beginning, to see how it would work in real life. Basically the app should perform as a tool both for the employees in their daily duties, but also for the managers, which could verify daily reports of the events had place during the day.
-
Being a web application would allow any active employee to access it with just a smartphone, tablet or a laptop and proceed with his tasks. The access to the dashboard would be done though a login page.
I designed three main levels of Role-based Access Control:
-
System Administrator
- 'sysadmin'(super-user):
- Is the owner of the app providing the services to its clients (restaurant owners in our case)
- This user can't be deleted.
- As a backup solution, there are two special ways of preventing removing this super-user:
- a function called once at the application starting. This functions checks the database if this super-user exists. If not, it will be created with default credentials [hard-coded un: 'sysadmin, pw: '1111'], which may be updated at a later date.
- in the users list, when deleting an existing user, there is a check and then a redirect to the Register page if trying to delete this user.
- Has the right to C.R.U.D.:
-
- He can do 'admin' and 'manager' Users database operations
- Can edit his details, except for the 'username' and 'role'.
- any other 'admin' can manipulate the Users' database (admins and managers), but can't delete himself or 'sysadmin'.
- 'sysadmin'(super-user):
-
Restaurant Manager or 'manager' role:
- Has the right to CRUD:
- Restaurant's employees: managers and employees
- Daily tasks and access Dashboard
- Create new forms
- Has the right to CRUD:
-
Employee or 'user' role:
- Has the right to:
- Read:
- Daily Tasks
- Submit/Fil Daily Tasks Predefined Forms
- Read:
- Has the right to:
-
Obviously, the application has the potential to be developed even further to match other business models or to incorporate even more capabilities, but in future releases.
'Restaurant Manager' is a tool designed to simplify and improve daily tasks, practical and user-friendly, that simplifies and streamlines daily tasks for restaurant managers and their employees. With its intuitive interface and useful features, it offers a feasible solution for managing specific aspects of a restaurant's operations, from employee task assignments to hazard procedures and daily reports management.
- KanBan style Project board
- For better organization of the project, I have used the GitHub Project Board with an Agile methodology and Kanban-style approach. The Project Board provides a visual representation of the project's progress and allows to track tasks and issues in a transparent and progressive manner.
- The board is divided into columns that represent the various stages of the project, from 'Backlog' to 'Done', and I've used cards to represent individual tasks and issues. Each card contains a brief description of the task or issue, as well as any relevant labels, description, steps and assignee.
- By using this approach, I could easily prioritize and schedule work, track progress, and identify any issues or roadblocks that needed to be addressed. This helped me to work more efficiently and effectively, and ensures that the project is moving forward smoothly and in a timely manner.
- The
env.py
file is read using thedotenv
library in Python. This library allows you to load environment variables from a file named .env located in the same directory as your Python script.pip install python-dotenv
To install all dependencies listed in the requirements.txt type in terminal: pip install -r requirements.txt
The two choices for a database were MongoDB and PostgreSQL. While I would have preferred the SQL, specifically for this project the MongoDB had some advantages that I needed more, so I decided to use it.
- In a future release of the project's code, I shall approach the object oriented paradigm to represent the database persistence in objects/classes. This way the necessary code will be less.+
- When a Manager is being downgraded to an Employee or vice-versa,
- In a future release of this project, I shall approach the object oriented paradigm to represent the database persistence in objects/classes. This way the necessary code will be less.
- Also, since this will become a real-world application, I will include some features which they were in plan, but the time didn't allow me to implement them:
- Reports and Forms pages for other features:
- Stock Reception (The process of checking the order and inventorying the items)
- Count Inventory (The process of checking the stock and inventorying the items to ensure accuracy and completeness)
- Cleaning and Sanitization (Maintaining a clean and sanitary environment - reports which involve regularly scheduled tasks such as sweeping, mopping, and wiping down surfaces, as well as periodic deep cleaning of equipment and facilities)
- Reports and Forms pages for other features:
- Quite often in my code I have had a SonarLint error telling that I should refactor the code reduce the Cognitive Complexity. - This has been achieved by applying simple refactoring to the existing code, by refactoring the code into smaller, more modular functions that are easier to reason about. For example the code that handles the form submission has been moved in two separate blocks: - One function containing the business logic to retrieve and process the form data. - The older router and function which would keep the GET and POST methods requests, but on POST method request, there would be a call for the functions processing the form data.
- Tilig's password generator
- Materialize Library
- MongoDB Compass
- MongoDB Shell
- Materialize Register Page Sample
- Flask flash() method – How to Flash Messages in Flask?
- Used registration and login procedures from Code Institute Flask Mini Project
- materialize CSS
- User access in Flask
- Hide Flash Flash messages
- Favicon source
- Remove unnecessary whitespace from Jinja rendered template
- Jinja Whitespace
- Web Dev - Using Flask to Show Which Navbar Link is Active
- Get the values of the selected radio inputs in Flask
- SonarSource - Cognitive Complexity
- Flask Error Handling
- Cards:
- Home page template layout
- Admin template elements:
- Images: