A modular sweepstakes application that allows users to enter a list of names, register with payment, and randomly pull winners.
- Entrants Management: Add, edit, and update a list of potential winners
- Payment Integration: Register with payment to unlock pulling functionality
- Winner Selection: Randomly select winners from the entrants list
- Pull History: View a history of all past pulls and their winners
- Payment Status: Track whether the user has registered with payment
The application follows a modular architecture to promote maintainability and scalability:
- EntrantsForm: Manages the list of entrants with text input and updates
- SweepstakesControls: Handles registration, payment, and winner selection
- PullsHistory: Displays past pulls and their results
- Sweepstakes: Main component that orchestrates the application flow
- SweepstakesContext: Provides state management and client operations across components
The application uses:
- React for the UI components
- Context API for state management
- ao-process-clients for interacting with the sweepstakes blockchain process
- A responsive design that works well on desktop and mobile devices
-
Install dependencies:
npm install -
Start the development server:
npm run dev -
Build for production:
npm run build -
Deploy to the permaweb:
npm run deploy
The modular design makes it easy to extend the application:
- Add new components in the
src/components/Sweepstakes/directory - Expand context functionality in
src/context/SweepstakesContext.tsx - Modify styles in the respective CSS files
See the LICENSE file for details.