The Showtime Watch application is designed to facilitate the preorder and management of a smartwatch that integrates with cryptocurrency wallets. It includes features such as a leaderboard, profile management, and wallet connection/reset functionalities.
- User: Can preorder the watch, manage their profile, connect/reset their wallet, and view the leaderboard.
- Admin: Manages user data, orders, and leaderboard entries (not explicitly mentioned but implied for backend management).
User Flow:
graph TD
A[Home] --> B[Login]
B --> C[Profile]
C --> D[Connect Wallet]
D --> E[Preorder]
E --> F[Order Confirmation]
F --> G[Leaderboard]
G --> H[View Ranking]
H --> I[Logout]
Admin Flow:
graph TD
A[Admin Login] --> B[Dashboard]
B --> C[Manage Users]
B --> D[Manage Orders]
B --> E[Manage Leaderboard]
C --> F[View/Edit User Profiles]
D --> G[View/Edit Orders]
E --> H[Update Leaderboard]
H --> I[Logout]
Users Table
id
(UUID)email
(VARCHAR)username
(VARCHAR)password
(HASH)wallet_address
(VARCHAR)created_at
(TIMESTAMP)updated_at
(TIMESTAMP)
Orders Table
id
(UUID)user_id
(UUID, FK)order_id
(VARCHAR)watch_id
(VARCHAR)referral_code
(VARCHAR)created_at
(TIMESTAMP)updated_at
(TIMESTAMP)
Leaderboard Table
id
(UUID)user_id
(UUID, FK)ranking
(INT)referrals
(INT)created_at
(TIMESTAMP)updated_at
(TIMESTAMP)
Wallet Resets Table
id
(UUID)user_id
(UUID, FK)reset_code
(VARCHAR)created_at
(TIMESTAMP)expires_at
(TIMESTAMP)
List Pages
- Home
- Leaderboard
- Profile
- Preorder
CRUD Forms
- Profile Management (Create/Update)
- Wallet Connection/Reset
- Preorder Form
Data Validation
- Email validation
- Password strength
- Wallet address format
- Referral code format
React Components
HomePage
LeaderboardPage
ProfilePage
PreorderPage
LoginForm
ProfileForm
WalletConnectForm
WalletResetForm
OrderConfirmation
LeaderboardEntry
ReferralCodeInput
User APIs
POST /api/login
- { email, password }POST /api/register
- { email, username, password }GET /api/profile
- { user_id }PUT /api/profile
- { user_id, email, username, wallet_address }POST /api/wallet/connect
- { user_id, wallet_address }POST /api/wallet/reset
- { email }GET /api/wallet/reset/:reset_code
- { reset_code }
Order APIs
POST /api/preorder
- { user_id, watch_id, referral_code }GET /api/orders
- { user_id }
Leaderboard APIs
GET /api/leaderboard
- { }GET /api/leaderboard/:user_id
- { user_id }
Feature Breakdown
- User Authentication: 20 hours
- Profile Management: 30 hours
- Wallet Connection/Reset: 25 hours
- Preorder System: 40 hours
- Leaderboard: 35 hours
- Frontend Development: 60 hours
- Backend Development: 50 hours
- Testing and QA: 30 hours
Total Estimate: 290 hours
- User Authentication: Essential for access control.
- Profile Management: Allows users to manage their information.
- Wallet Connection/Reset: Critical for cryptocurrency integration.
- Preorder System: Core functionality for sales.
- Leaderboard: Enhances user engagement.
- Frontend Development: User interface and experience.
- Backend Development: Server-side logic and database management.
- Testing and QA: Ensures reliability and performance.
Solidity Smart Contract for Showtime Watch Preorders
Explanation
Structs and Mappings:
Preorder
: A struct to store details of each preorder.preorders
: A mapping to store preorders by their unique order ID.referralUsage
: A mapping to store the usage count of each referral code.Events:
NewPreorder
: Emitted when a new preorder is placed.PreorderFulfilled
: Emitted when a preorder is fulfilled.Functions:
placePreorder
: Allows users to place a preorder by sending Ether and optionally providing a referral code.fulfillPreorder
: Allows the contract owner to mark a preorder as fulfilled.checkPreorderStatus
: Allows users to check the status of their preorder.withdrawFunds
: Allows the contract owner to withdraw funds from the contract.Modifiers:
onlyOwner
: Ensures that only the contract owner can call certain functions.Constructor: