Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 26 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# python_projects_grocery_webapp
# Grocery Store X
In this python project, we will build a grocery store management application. It will be 3 tier application,
1. Front end: UI is written in HTML/CSS/Javascript/Bootstrap
2. Backend: Python and Flask
Expand All @@ -12,7 +12,31 @@ Download mysql for windows: https://dev.mysql.com/downloads/installer/

`pip install mysql-connector-python`

### Exercise
### Database Setup

1. **Install MySQL**: Download and install MySQL from [https://dev.mysql.com/downloads/installer/](https://dev.mysql.com/downloads/installer/).
2. **Create Database**: Create a database named `grocery_store`. You can do this using a MySQL client (like MySQL Workbench or the command line client) with the following command:
```sql
CREATE DATABASE grocery_store;
```
3. **User Permissions**: The application connects to MySQL using the username `root` and password `root` (as configured in `backend/sql_connection.py`). Ensure this user exists and has the necessary permissions on the `grocery_store` database. **Note:** For a production environment, it is strongly recommended to create a dedicated user with restricted permissions and use a more secure password management strategy.

### Running the Application

1. **Install Dependencies**:
```bash
pip install Flask mysql-connector-python
```
2. **Start the Backend Server**:
Navigate to the project's root directory in your terminal and run:
```bash
python backend/server.py
```
The server will start on `http://127.0.0.1:5000`.
3. **Access the Frontend**:
Open the `ui/index.html` file in your web browser.

### Exercise

The grocery management system that we built is functional but after we give it to users for use, we got following feedback. The exercise for you to address this feedback and implement these features in the application,
1. **Products Module**: In products page that lists current products, add an edit button next to delete button that allows to edit current product
Expand Down
4 changes: 2 additions & 2 deletions ui/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<!DOCTYPE html>
<html>
<head>
<title> GSMS </title>
<title>Grocery Store X</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
<meta name="apple-mobile-web-app-capable" content="yes"/>
Expand Down Expand Up @@ -44,7 +44,7 @@
<div class="body content rows scroll-y">
<form class="form-horizontal" action="">
<div class="box-info full" id="taskFormContainer">
<h2>Grocery Store Management System</h2>
<h2>Grocery Store X</h2>
<div class="panel-body pt-0">
<div class="row mb-4">
<div class="col-sm-12">
Expand Down
4 changes: 2 additions & 2 deletions ui/manage-product.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<!DOCTYPE html>
<html>
<head>
<title> GSMS </title>
<title>Grocery Store X</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
<meta name="apple-mobile-web-app-capable" content="yes"/>
Expand Down Expand Up @@ -43,7 +43,7 @@
<div class="right content-page">
<div class="body content rows scroll-y">
<div class="box-info full" id="taskFormContainer">
<h2>Manage Products</h2>
<h2>Grocery Store X - Manage Products</h2>
<div class="panel-body pt-0">
<div class="row mb-4">
<div class="col-sm-12">
Expand Down
4 changes: 2 additions & 2 deletions ui/order.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<!DOCTYPE html>
<html>
<head>
<title> GSMS </title>
<title>Grocery Store X</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
<meta name="apple-mobile-web-app-capable" content="yes"/>
Expand Down Expand Up @@ -43,7 +43,7 @@
<div class="body content rows scroll-y">
<form action="">
<div class="box-info full" id="taskFormContainer">
<h2>New Order
<h2>Grocery Store X - New Order
<input name="customerName" id="customerName" type="text" class="form-control" placeholder="Customer Name" style="max-width:230px; float: right;margin-top: -11px">
</h2>
<div class="row" style="margin-bottom: 5px;margin-top: -10px;">
Expand Down