User Roles and Journeys
Relevant source files
The following files were used as context for generating this wiki page:The Becathlon application defines distinct user roles, each with a specific set of permissions and a tailored user journey. The system is designed to cater to unauthenticated visitors, registered customers (with a further distinction between Buyers and Sellers), and platform administrators. This structure ensures appropriate access control and a logical flow for different user interactions, from browsing products to managing the entire e-commerce platform.
The core user-facing modules that facilitate these journeys include authentication, catalog, cart, profiles, and orders.
Sources: README.md:12-25, 80-82, becathlon/settings.py:61-71
User Roles Overview
The application categorizes users into three primary roles, each with increasing levels of privilege.
| Role | Description | Key Permissions | Relevant Modules |
|---|---|---|---|
| Guest / Visitor | Unregistered users browsing the site. | View products, categories, and stores. Add items to a temporary cart. | main, catalog, cart, stores |
| Client / Customer | Registered users with an account. | All Guest permissions, plus place orders, manage a persistent profile, view order history, and switch between Buyer/Seller types. | authentication, profiles, cart, checkout, orders |
| Administrator | Users with full control via the Django admin interface. | Manage users, products, orders, and store locations. | admin.py across all apps |
Sources: README.md:104-120, IMPLEMENTATION.md:32-35
This diagram illustrates the high-level journey for each user role.
Sources: README.md:65-79
Guest Journey
An unauthenticated user, or "Guest," has read-only access to most of the site's content. Their primary journey revolves around product discovery.
- Discovery: Guests can land on the homepage, browse sport categories, and view product listings.
- Exploration: They can use search and filter options to explore the product catalog and view detailed product pages.
- Interaction: Guests can add items to a temporary, session-based shopping cart.
- Conversion: To complete a purchase, a guest must register for an account or log in. The system prompts them to do so if they attempt to check out.
The navigation bar for a guest user provides links to "Sign In" and "Sign Up".
Sources: README.md:65-67, apps/main/templates/main/base.html:36-39, IMPLEMENTATION.md:32-35
Registered Customer Journey
Registered users, referred to as "Clients" or "Customers," have a richer, more interactive experience. This journey begins with authentication.
Authentication
The apps/authentication module handles user registration, login, and logout.
- Registration: New users can sign up via a custom form that includes username, email, and password fields.
- Login: Existing users log in with their credentials. Upon successful login, they are redirected to the homepage.
- Logout: Authenticated users can log out, which terminates their session.
Sources: README.md:84, apps/authentication/views.py:10-85, IMPLEMENTATION.md:10-15
The following sequence diagram shows the login process.
Sources: apps/authentication/views.py:10-41
Profile Management
Once authenticated, users gain access to a personal profile page managed by the apps/profiles module.
Key features of the profile page include:
- Viewing personal and contact information (email, phone).
- Editing profile details such as name, preferred sports, and profile picture.
- Managing newsletter subscription preferences via an AJAX-powered toggle.
- Switching between "Buyer" and "Seller" account types.
Sources: apps/profiles/templates/profile_detail.html:1-440, apps/profiles/templates/profile_edit.html:1-100
Account Types: Buyer vs. Seller
A key feature for registered users is the ability to switch between BUYER and SELLER account types. This functionality is handled via an AJAX request from the profile page.
- Buyer: The default account type. Buyers can browse, purchase products, and manage their orders.
- Seller: An upgraded account type. Sellers have all Buyer permissions, plus the ability to list their own products for sale on the platform.
Switching from Seller back to Buyer is a destructive action that removes all of the user's listed products. The UI presents a confirmation modal to warn the user of this.
Sources: apps/profiles/templates/profile_detail.html:314-358, apps/main/templates/main/home.html:100-136
The state transitions for a user's account type are shown below.
Order Management
Registered customers can complete the purchasing process and manage their past orders through the apps/order module.
The typical order flow is as follows:
- Checkout: The user proceeds from their cart to the checkout page.
- Place Order: The user confirms their shipping details and places the order.
- Confirmation: The user receives an order confirmation.
- Order History: The user can view a list of all their past and current orders at the
/orders/endpoint. - Order Details: Users can view detailed information for each specific order.
Sources: README.md:70-72, apps/order/views.py
This flowchart visualizes the customer's journey from checkout to viewing their order history.
Sources: README.md:70-72, apps/order/views.py:18-100
Administrator Journey
Administrators interact with the application primarily through the built-in Django admin dashboard. Their role is to manage the platform's content and users.
Key administrative tasks include:
- User Management: Add, edit, and delete user accounts and assign roles.
- Product Management: Add, edit, and delete products and manage categories.
- Order Processing: View, process, and manage customer orders and handle mock refunds.
- Store Management: Maintain information about physical store locations.
These functions are enabled by registering the application models (Product, Order, Profile, Store, etc.) with the Django admin site.
Sources: README.md:74-79, 118-120