Ojulari123 / RAA-projects

0 stars 0 forks source link

Tasks #2 #1

Closed solomonaboyeji closed 3 months ago

solomonaboyeji commented 3 months ago

There is a need to build an application for a fashion store (your clothing brand). The first baby step we need to take to build a system where the store can mange their users and orders is to build a user management system. Your first task is implement this in python. Adhere to the instructions below:

  1. Allow the users to create an account by entering their First Name, Second Name, Address and Password. Store this details into a users.json file. (1) What is JSON? (2) Reading and Writing JSON to a file
  2. Write another function that allows the user to log in by entering their email address and their password. You will need to read the file you created in step 1 above and locate the user with that email while you check if the password they supplied is the same with the one that is in the file. Print appropriate error messages if the email does not exist or password does not match. You should not do any encryption or decryption for the user's password.
  3. Write a function that allows users to add product to the store. Follow the same idea of saving into a json file but this time a products.json file.
  4. Write a function that allows a user to view all the products that has been added into the products.json file.
  5. We need a simple HTML/CSS page that will allow the user to create an account and log them in. This should not connect to any backend yet. (Checkout TailWindCSS)
  6. On your Wordpress site, allow users to view a single product, by directing them to the next page. Note: hosting your site online will come at a later date.
Ojulari123 commented 3 months ago

After the initial submission and debugging, I identified the following issues:

For Product.json and User.json:

solomonaboyeji commented 3 months ago
  1. Ensure each email addresses in the list are unique. Use a function to do the check e.g. if check_for_duplicate_email(email) == False: # proceed to collect other info...
  2. After all attempt to log a user in fails because they do not have an account, suggest to them to create an account or they exit
  3. Print out the checkout message, let it include the total of all the items, unit prices,total price and their quantities.
  4. Use integer as the a unique ID for each user, and link the products they added using this value.
  5. Both json file should be saved into another folder called ecommerce_data. ls ecommerce_data should list users.json and products.json

Users.json


[
  {
   "id": 1, 
   "name": "Solomon",
   "email": "solomon@tekinologi.com"
   "date_registered": "time and date",
  },

  {
   "id": 2, 
   "name": "Adeleke",
   "email": "adeleke@tekinologi.com"
   "date_registered": "time and date"
  }
]

Products Json

[
  {
   "id": 1, 
   "name": "Nike Sneakers",,
   "quantity": 2,
   "price": "£30",
   "user_id": 1
  },

  { 
  "id": 2, 
   "name": "New Balance Sneakers",
   "quantity": 2,
   "price": "£20",
   "user_id": 2
  }
]