A full-featured online game store built as a diploma project. The application allows users to browse, purchase, and manage games with a modern, responsive UI.
| Layer | Technology |
|---|---|
| Frontend | React 19, TypeScript, Tailwind CSS v4 |
| Build Tool | Vite |
| Backend & Auth | Firebase (Firestore, Auth, Functions, Hosting) |
| State Management | TanStack React Query |
| Payments | Stripe, PayPal |
| Forms | Formik + Yup |
| Animations | Framer Motion |
| i18n | i18next + react-i18next |
| Routing | React Router DOM v7 |
| PDF Generation | jsPDF + jspdf-autotable |
| Testing | Vitest, Playwright, Cucumber (BDD) |
- ๐ Browse and purchase games
- ๐ณ Payment integration via Stripe and PayPal
- ๐ User authentication via Firebase Auth
- ๐ Multi-language support (i18n)
- ๐ PDF receipt / report generation
- ๐ฑ Responsive design with Tailwind CSS
- ๐ Google reCAPTCHA protection
- ๐ QR code generation
- ๐จ Smooth animations with Framer Motion
The application follows a client-server architecture with a React frontend and Firebase backend.
- Component-based: Modular React components with TypeScript for type safety.
- Context API: State management for cart, wishlist, library, and authentication.
- Routing: Client-side routing with React Router for SPA navigation.
- Styling: Utility-first CSS with Tailwind for responsive design.
- Internationalization: i18next for multi-language support.
- Firebase Services:
- Firestore: NoSQL database for user data, games, and transactions.
- Auth: User authentication with Steam OAuth.
- Functions: Serverless functions for payment processing and API logic.
- Hosting: Static site hosting for the frontend.
- API: RESTful endpoints for authentication, 2FA, and payments.
- User Management: Registration via Steam, profile management, 2FA with TOTP.
- Game Catalog: Display games with prices, add to cart/wishlist.
- Purchase Flow: Secure payments via Stripe/PayPal, receipt generation.
- Library Management: Purchased games stored in user's library with receipts.
- User browses games on frontend.
- Authentication via Steam OAuth, tokens managed by Firebase.
- Cart/wishlist state persisted in localStorage and synced with Firestore.
- Payments processed via Stripe/PayPal webhooks.
- Purchase data stored in Firestore, receipts generated as PDF.
.
โโโ src/
โ โโโ components/ # Reusable UI components
โ โโโ context/ # React Context providers (Auth, Cart, Library, Wishlist)
โ โโโ pages/ # Route-level page components
โ โโโ utils/ # Utility functions and validation schemas
โโโ server/ # Firebase Cloud Functions
โโโ public/ # Static assets
โโโ features/ # Cucumber BDD feature files
โโโ locale/ # i18n translation files
โโโ docs/
โ โโโ deployment.md # Production deployment guide
โ โโโ update.md # Update & rollback guide
โ โโโ backup.md # Backup & restore guide
โ โโโ linting.md # ESLint configuration & rules
โ โโโ generate_docs.md # Documentation generation guide
โ โโโ api/
โ โ โโโ openapi.yaml # OpenAPI 3.0 API specification
โ โโโ scripts/ # Automation scripts
โโโ firebase.json # Firebase configuration
โโโ vite.config.ts # Vite configuration
- API Docs: OpenAPI/Swagger at
/api-docswhen server is running. - Component Docs: TypeDoc generated docs in
docs/api/. - Live Components: Storybook at
npm run storybook. - Tests as Docs: Integration tests demonstrate component usage.
Run npm run docs to generate TypeDoc documentation.
Download and install Node.js v18 or higher from https://nodejs.org (LTS version).
node --version # v18.x.x or higher
npm --versionDownload from https://git-scm.com.
npm install -g firebase-tools
firebase --versiongit clone https://github.com/klim912/Diploma.git
cd Diploma
npm installCreate a .env file in the root directory:
VITE_FIREBASE_API_KEY=your_api_key
VITE_FIREBASE_AUTH_DOMAIN=your_project.firebaseapp.com
VITE_FIREBASE_PROJECT_ID=your_project_id
VITE_FIREBASE_STORAGE_BUCKET=your_project.appspot.com
VITE_FIREBASE_MESSAGING_SENDER_ID=your_sender_id
VITE_FIREBASE_APP_ID=your_app_id
VITE_STRIPE_PUBLIC_KEY=pk_test_...
VITE_PAYPAL_CLIENT_ID=your_paypal_client_id
VITE_RECAPTCHA_SITE_KEY=your_recaptcha_site_keynpm run dev
# App opens at http://localhost:5173| Command | Description |
|---|---|
npm run dev |
Start development server |
npm run build |
Build for production |
npm run preview |
Preview production build |
npm run lint |
Run ESLint |
npm run lint:fix |
Auto-fix ESLint errors |
npm run type-check |
TypeScript type checking |
npm run check |
Full code quality check |
npm run test |
Run unit tests |
npm run coverage |
Run tests with coverage |
npm run docs |
Generate JSDoc documentation |
This project uses JSDoc for code documentation. All contributors must follow these rules:
Always document:
- All exported functions, hooks, and components
- All TypeScript interfaces and types shared across files
- File-level module descriptions (
@fileoverview) - Complex business logic and algorithms (inline comments)
Format for functions:
/**
* Brief one-line description of what the function does.
*
* Longer explanation if needed (business logic, algorithm details).
*
* @param paramName - Description of the parameter
* @returns Description of what is returned
* @throws {ErrorType} When and why this error is thrown
*
* @example
* myFunction('input') // โ 'output'
*/Format for React components:
/**
* ComponentName โ brief description of the component's purpose.
*
* @component
* @param props - {@link ComponentNameProps}
*
* @example
* <ComponentName requiredProp="value" />
*/Format for interfaces:
/**
* Describes what this type represents.
*
* @interface InterfaceName
*/
export interface InterfaceName {
/** Description of this field */
fieldName: string
}Any change to a public function's signature, parameters, or behavior must include a JSDoc update in the same commit.
npm run docs
# Output: docs/api/html/index.htmlSee docs/generate_docs.md for full instructions.
Open docs/api/openapi.yaml in https://editor.swagger.io or run:
npm run docs:apiUnit / Component Tests โ Vitest + React Testing Library
npm run test
npm run coverageEnd-to-End Tests โ Playwright
npx playwright testBDD Tests โ Cucumber
npx cucumber-jsSee docs/deployment.md for the full production deployment guide.
npm run build
firebase deployMIT License โ see LICENSE for details.