top of page

Python Flask Project Help | Python Web Development Help

Milestone 1 (9):

1. User will be able to register a new account

  • Form Fields

- Username, email, password, confirm password(other fields

optional)

- Email is required and must be validated

- Username is required

- Confirm password’s match

  • Users Table

- Id, username, email, password (60 characters), created, modified

  • Password must be hashed (plain text passwords will lose points)

  • Email should be unique

  • Username should be unique

  • System should let user know if username or email is taken and allow the user to correct the error without wiping/clearing the form

- The only fields that may be cleared are the password fields


2. User will be able to login to their account (given they enter the correct

credentials)

  • Form

- User can login with email or username

- This can be done as a single field or as two separate fields

- Password is required

  • User should see friendly error messages when an account either doesn’t exist or if passwords don’t match

  • Logging in should fetch the user’s details (and roles) and save them into the session.

  • User will be directed to a landing page upon login

- This is a protected page (non-logged in users shouldn’t have access)

- This can be home, profile, a dashboard, etc


3. User will be able to logout

  • Logging out will redirect to login page

  • User should see a message that they’ve successfully logged out

  • Session should be destroyed (so the back button doesn’t allow them access back in)

4. Basic security rules implemented

  • Authentication:

- Function to check if user is logged in

- Function should be called on appropriate pages that only allow logged in users

  • Roles/Authorization:

- Have a roles table (see below)


5. Basic Roles implemented

  • Have a Roles table (id, name, description, is_active, modified, created)

  • Have a User Roles table (id, user_id, role_id, is_active, created, modified)

  • Include a function to check if a user has a specific role (we won’t use it for this milestone but it should be usable in the future)

6. Site should have basic styles/theme applied; everything should be styled

  • I.e., forms/input, navigation bar, etc

7. Any output messages/errors should be “user friendly”

  • Any technical errors or debug output displayed will result in a loss of points

- User will be able to see their profile

  • Email, username, etc

8. User will be able to edit their profile

  • Changing username/email should properly check to see if it’s available before allowing the change

  • Any other fields should be properly validated

  • Allow password reset (only if the existing correct password is provided)

- Hint: logic for the password check would be similar to login



Milestone 2 (11):

1. User with an admin role or shop owner role will be able to add products to

inventory

  • Table should be called Products (id, name, description, category, stock, created, modified, unit_price, visibility [true, false])

2. Any user will be able to see products with visibility = true on the Shop page

  • Product list page will be public (i.e. doesn’t require login)

  • For now limit results to 10 most recent

  • User will be able to filter results by category

  • User will be able to filter results by partial matches on the name

  • User will be able to sort results by price

  • All filters are additive

3. Admin/Shop owner will be able to see products with any visibility

  • This should be a separate page from Shop, but will be similar

  • This page should only be accessible to the appropriate role(s)

4. Admin/Shop owner will be able to edit any product

  • Edit button should be accessible for the appropriate role(s) anywhere a product is shown (Shop list, Product Details Page, etc)

  • Edit name, description, category, stock, unit_price, visibility

5. User will be able to click an item from a list and view a full page with more info about the item (Product Details Page)

  • Name, description, unit_price, stock, category

6. User must be logged in for any Cart related activity below

7. User will be able to add items to Cart

  • Cart will be table-based (id, product_id, user_id, desired_quantity, unit_price, created, modified)

- Choose one and cross out which one you won’t support

- If a user can have only 1 cart product_id and user_id should be

a composite unique key

- If a user can have more than 1 cart, add a field called cart_id and

cart_id, user_id, and product_id will be a composite unique key

  • Adding items to Cart will not affect the Product's quantity in the Products table


9. User will be able to see their cart

  • List all the items

  • Show subtotal for each line item based on desired_quantity * unit_price (from the cart)

  • Show total cart value (sum of line item subtotals)

  • Will be able to click an item to see more details (Product Details Page)

10. User will be able to change quantity of items in their cart

  • Quantity of 0 should also remove from cart

  • A negative Quantity is not valid

11. User will be able to remove a single item from their cart via button click

12. User will be able to clear their entire cart via a button click


Milestone 3 (4):

1. User will be able to purchase items in their Cart

  • Create an Orders table (id, user_id, created, total_price, address, payment_method, money_received)

- Payment method will simply record (Cash, Visa, MasterCard, Amex, etc)

We will not be recording CC numbers or anything of that nature, this is

just a sample and in real world projects you’d commonly use a third party payment processor

- Hint: This must be inserted first before you can insert into the Order

Items table

  • Create an OrderItems table (id, order_id, product_id, quantity, unit_price)

- Hint: This is basically a copy of the data from the Cart table, just persisted as

a purchase


  • Checkout Form

- Ask for payment method (Cash, Visa, MasterCard, Amex, etc)

- Do not ask for credit card number, this is just a sample

- Ask for a numerical value to be entered 

- Note: this will be a fake payment check to compare against the cart total

to determine if the payment succeeds

- This will be recorded as money_received

- Ask for Address/shipping information

- You’ll need to concatenate this into a single string to insert into the DB

  • User will be asked for their Address for shipping purposes

- Address form should validate correctly

- Use this as a rough guide (likely you’ll want to prefill some of the

data you already have about the user)

















  • Order process (comment each part of the process):

- Calculate Cart Items

- Verify the current product price against the Products table

- Since our Cart is table-based it can be long lived so if a user added a

Product at a sale and they attempt to purchase afterwards, it should pull the true Product cost.

- You can also show the Cart.unit_price vs Product.unit_price to show a sale or

an increase in price

  • Verify desired product and desired quantity are still available in the Products table

- Users can’t purchase more than what’s in stock

- Show an error message and prevent order from going through if

something isn’t available

- Let the user update their cart and try again

- Clearly show what the issue is (which product isn’t available, how much

quantity is available if the cart exceeds it)


  • Make an entry into the Orders table

  • Get last Order ID from Orders table

  • Copy the cart details into the OrderItems tables with the Order ID from the previous step

  • Update the Products table Stock for each item to deduct the Ordered Quantity

  • Clear out the user’s cart after successful order

  • Redirect user to Order Confirmation Page


  • Order Confirmation Page

- Show the entire order details from the Order and OrderItems table (similar

to cart)

- Including a the cost of each line item and the total value

- Show how they purchased and how much they paid

- Displays a Thank you message

  • User will be able to see their Purchase History

- For now limit to 10 most recent orders

- Show a summary of relevant information

- A list item can be clicked to view the full details in the Order Details Page

(similar to Order Confirmation Page except no “Thank you” message)

  • Store Owner will be able to see all Purchase History

- For now limit to 10 most recent orders

- A list item can be clicked to view the full details in the Order Details Pag

(similar to Order Confirmation Page except no “Thank you” message)




Contact Us or send your project requirement details at:



And get instant help with an affordable price.

bottom of page