Giter Site home page Giter Site logo

fantasy-ecommerce-store's Introduction

1. User Authentication (Sign-up and Sign-in)

Sign-up Process:

Ensure that the sign-up process collects necessary information (e.g., username, email, password) and stores it securely in your database. Passwords should be hashed using a strong hashing algorithm (like bcrypt) before being saved. PHP's password_hash() and password_verify() functions are suitable for this purpose.

Sign-in Process:

Implement sign-in logic that verifies user credentials against the stored hashes in your database. Upon successful sign-in, initiate a session for the user using session_start(), and store relevant user information in session variables to track the authentication state across pages.

Session Management:

Configure session handling to manage user sessions securely (as detailed in the previous response regarding cookies and session settings).

2. Linking Users with Actions

User Sessions:

Use PHP sessions to maintain user state across different pages of your application. After successful authentication, store the user's ID (and any other necessary information) in $_SESSION to identify the user's actions, like adding to cart, wishlist, or viewing order history.

Database Design:

Ensure your database schema links orders, wishlists, and cart items with user accounts. This typically involves having foreign keys in your orders, wishlists, and cart tables that reference the user's ID in the users table.

3. Wishlist and Order History

Wishlist Management:

Implement functionality that allows authenticated users to add items to a wishlist. This involves creating a wishlist table in your database where items added to the wishlist by a user are stored with references to the user's ID.

Order History:

Store completed orders in an orders table, linking each order to the user's ID. Include relevant order details such as item IDs, quantities, prices, and timestamps to enable users to view their past orders.

4. Integrating User Accounts with Shopping Cart

Persistent Shopping Carts:

Consider making the shopping cart persistent for authenticated users by storing cart items in the database linked to the user's ID. This allows the cart to be retained across sessions.

Checkout Process:

Implement a checkout process that transitions items from the cart to an order, storing the order information in your orders table linked to the user's ID.

5. Security Considerations

Input Validation and Sanitization:

Always validate and sanitize user inputs to prevent SQL injection and cross-site scripting (XSS) vulnerabilities.

Secure Communications:

Use HTTPS to encrypt data transmitted between the client and server, protecting sensitive information like passwords and personal details during sign-up/sign-in and checkout processes.

Access Controls:

Ensure that users can only access and modify their own cart, wishlist, and order history. Implement checks in your backend logic to verify that the authenticated user ID matches the user ID associated with the actions being performed.

Development Approach

Incremental Development:

Tackle one feature at a time, starting with user authentication. Test thoroughly before moving on to the next feature.

User Testing and Feedback:

Involve potential users in testing early versions of your site. User feedback can be invaluable in identifying usability issues and understanding user expectations.

Security Audits:

Regularly review your code and database for security vulnerabilities. Consider using tools or services to audit your site's security.

Known issues:

localstoage forgetting username after an exctened period.

Deleteing items from the users cart (fixed)

wishlist...everything about it!

fantasy-ecommerce-store's People

Contributors

joeyz56 avatar

Stargazers

Chad Groom avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.