Skip to content

Latest commit

 

History

History
315 lines (193 loc) · 14.4 KB

Assignment-3_documentation.md

File metadata and controls

315 lines (193 loc) · 14.4 KB

Laundry Management System IITGN

This is Laundry Management System specially designed for IIT-GN

You can watch the demo of our design here : https://drive.google.com/file/d/17QOLflzjDd_zoCRmfvy6YPpxtyquLg8S/view?usp=share_link

// There is one more directory called "Lib" which we can't able to add but here is the link of it https://drive.google.com/drive/folders/1UvqVq010p6MVA9xQRRCGjeJ7TCmVewXF?usp=share_link

Problem Statement & Requirements

  1. Based on the teams formed, each team is supposed to create a web application of the proposed functionalities in the previous assignments. Each team can be divided into Group G1 and Group G2; G1 is supposed to work on the front-end and G2 on the back-end sections, respectively. You can use Flask + MySQL for developing your WebApp.

  2. The web app should support the dynamic execution (The changes done by the user through the web app shall be reflected in the main database and web page also) of the following functions on your database :

  • INSERT
  • UPDATE
  • DELETE
  • RENAME
  • WHERE
  1. Push it to GitHub and share the link for submission

  2. Login page with authentication of users and stakeholders.

Tasks

Responsibility of G1 :

G1 is supposed to design the front end and beautify accordingly using HTML/CSS/JS, you may use any other libraries for the front end, such as Bootstrap or jQuery. But flask is mandatory.

Screenshots

Users Side

  • Sign-In Page : Users will use this page to Sign-In to their account, using their corresponding Email-Id and Password.

Sign-In

  • Sign-Up Page : New users will be redirected to this page, to create a new account for Laundry Service.

Sign-Up

  • Homepage : Users will be greeted with this homepage. With 4 options on the top ribbon.

Student_Homepage

  • Clothes-Status : Users can check the status of their clothes, by clicking on the option, Clothes-Check from the top ribbon. This page shows the status of the submitted clothes of respective users.

Cloth_Status

  • Complaint : Users can register their complaint for the clothes they have submitted for washing. Users can access this page by clicking on the link here from the Clothes-Status Page

Cloth_Complaint

  • Complaint Status Check : Users can check their status of the complaint issued. Wheather Pending or Resolved

Complaint_Status_Page

  • Laundry-Schedule : Users can check their schedule for their laundry submission, of their respective hostels.

Laundry_Schedule

Admin Side

  • Admin Page : Users with administrative priviledges will be greeted with this homepage, with access to certain actions.

Admin

  • List of Clothes : Admins can access the list of clothes that have been submitted by the users, by clicking on the option Clothes from the top ribbon. Furthermore the admins can change the statuses of the clothes gone for Washing or Washed or Arrived.

List_of_clothes

  • Clothes Add : Admins can add clothes manually through this option, available from the top ribbon.

Cloth_Add

  • Complaint Page : Admins can check the complaints and its statuses (With any remarks) registered by the users through this page.

Complaint_Page

  • Students : Admins can check each users submission through the option Students from the top ribbon.

List_of_Student

Responsibility of G2 :

G2 has to work on integrating MySQL in WebApp. This group works on the proper working of the backend.

Screenshots

  • Query for Login Authentication, for both User side and Admin side.

WhatsApp Image 2023-03-20 at 23 10 31

  • Query for Sign-Up for the New users.

WhatsApp Image 2023-03-20 at 23 10 57

  • Query to check the Status of the Clothes, i.e. Washed, Washing and Arrived

3

  • Query for the Admin side, which will let some previledged users to add clothes for taking into account for washing.

4

  • Query for the Admin side which will display all users who have submitted their clothes for washing.

5

  • Query for the Admin side which will display all the currently raised complaints by the users.

6

  • Query to delete the account of a perticular user.

7

  • Query to update status of the clothes date wise, i.e. it changes the status of all clothes (Washing to Washed) which are from a slot which has been completely washed.

8

  • Query to delete a particular selected cloth's entry.

9

  • Query to register any complaint, raised by users.

10

  • Query to check the Status of complaint from a perticular user

11

Responsibility of G1 and G2 :

(a). Web App with Flask and MySQL Integration

This is a web app that integrates Flask and MySQL and allows for dynamic execution of database functions such as INSERT, UPDATE, DELETE, RENAME, and WHERE clause. The app also includes a login page with user authentication.

Initial Setup

1. Clone the repository from GitHub to your local machine.: git clone https://github.com/yourusername/your-repository.git

2. Open a terminal window and navigate to the root folder of the project.

3. Create a virtual environment using the command python3 -m venv env_flask

4. Activate the virtual environment using the command source env_flask/bin/activate

5. Install the required packages using the command pip3 install -r requirements.txt

6. Set up your MySQL database and update the config.yml file with your database credentials.

You can create a MySQL database named laundry_db with the following credentials:

  • Username : root
  • Password : password
  • Host : localhost
  • Port : 3306

7. Import the laundry_db.sql file into the database to create the required tables and dummy data.

Running the App

8. Navigate to the root directory of the project and run the app by running the following command: python app.py

9. Open a web browser and enter the following URL: http://127.0.0.1:5000/
[Might be different based on which port you are running the localhost]

(b). Screenshots of successful execution of the dynamic operations:

We are directly show the before and after changes reflected in our concerned table in the web app in this README file.

1. Insert:

Before Adding Clothes: Insert Before adding clothes

After Adding clothes: After Adding clothes

Before Adding complaint: Before Adding complaint

After adding complaint:\

  • After inserting complaint, it got reflected in admin complaint page.

After inserting complaint Similarly there are several insertions that can happen in our system.

2. Delete:

Before Deleting the account of alfredcomcastnet at admin side

-After deleting "alfred@comcast.net" it is not showed in list of students.

After deleting alfred@comcast net it is not showed in list of students

-Before deleting the record of clothes of student "24110077"

Before deleting the record of clothes of student 24110077

-After deleting "24110077", it's record got deleted from list.

After deleting 24110077 , it's record got deleted from list

3. Update:

-Before updating status:

After deleting 24110077 , it's record got deleted from list

After updating the status of clothes

-After Updating :
The status got changed for the record of date "2023-03-19"

Finally washed

4. Rename:

-Our system doesn't require any rename operation to do so we haven't implemented/shown it and there is no point to rename table, database or column.

Dummy Rename Query

  • Before Rename

WhatsApp Image 2023-03-20 at 23 48 16

Rena

  • After Rename

WhatsApp Image 2023-03-20 at 23 48 31

WhatsApp Image 2023-03-20 at 23 48 32

5. For where clause:

-Login Page looks like:

login page In login page where clause is used to validate user and to signed in user and store the session of user

@app.route('/', methods=['GET', 'POST'])
def login():
    if request.method == 'POST':
        # Fetch form data
        userDetails = request.form
        password = userDetails['password']
        email = userDetails['email']
        cur = mysql.connection.cursor()
        cur.execute("select * from user where email_id = % s and password=% s ",(email,password))
        account = cur.fetchone()
        if account:
            session['loggedin'] = True
            session['id_number'] = account[3]
            session['email_id'] = account[0]
            session['hostel_no'] = account[4]
            return redirect('/homepage_student')
        else:
            cur.execute("select * from college_management where email_id = % s and password=% s",(email,password))
            account = cur.fetchone()
            if account:
                session['loggedin'] = True
                session['email_id'] = account[0]
                session['p_level'] = account[3]
                return redirect('/homepage_admin')
            else:                
                msg = 'Incorrect username / password !'

        return render_template('index.html')
        
    return render_template('index.html')

Where clause 2:

-In cloth status page of student , where clause is used to only show the status of cloth of that particular user.

Student Clothes status

@app.route('/add_clothes', methods=['GET', 'POST'])
def add_clothes():
    if request.method == 'POST':
        # Fetch form data
        clotheDetails = request.form
        today = date.today()
        cur = mysql.connection.cursor()
        cur.execute("INSERT INTO clothes (id_number, room_no, no_of_clothes, date, status) VALUES (%s, %s, %s, %s, %s)", (clotheDetails['id'], clotheDetails['room_no'], clotheDetails['no_of_clothes'], today, "Washing"))
        mysql.connection.commit()
        
        return redirect('/homepage_admin')
        
    return render_template('add_clothes.html')

Contribution :

  • G1 :

  • Login/ Register : Denish Trivedi

  • Homepage Student: Zeal Shah

  • Cloth status: Denish Trivedi

  • Complaint Add page: Simran

  • Hostel schedule page: Dishant Patel

  • Complaint status check page : Dishant Patel

  • Homepage Admin: Zeal Shah

  • List of clothes page: Argha

  • Add Clothes: Denish Trivedi

  • Complaints page: Dishant Patel

  • Student list page: Denish Trivedi

  • README.md : Simran, Argha

  • G2 : Zeal Shah

  • G3 : Zeal Shah, Simran, Argha