CKSC Online Souvenir is the official Quasar/Vue 3 storefront for the Taipei Municipal Chien Kuo High School Student Council's souvenir campaign.
The application allows visitors to browse merchandise, place orders, and track their orders. Authorized managers and administrators can review orders, update payment and delivery status, and send customer notifications.
- Product catalog with size-based variants for jackets, shorts, caps, and other merchandise
- Shopping cart and checkout flow for customer orders
- Order lookup and order history pages for buyers
- Role-based administration for managers, admins, and super admins
- Firebase-backed authentication and Firestore data storage, protected by
firestore.rules - Prices and discounts re-checked on the server for every order
- Automated order confirmation emails and bulk notification emails through Cloud Functions
- Launch gate that redirects visitors to
/comingsoonbefore the sale opens
- Vue 3
- Quasar 2
- Vue Router
- Pinia
- Firebase Authentication (Google sign-in for staff, anonymous sign-in for buyers)
- Cloud Firestore
- Google Analytics
- Firebase Hosting / GitHub Pages
- Firebase Cloud Functions
- AWS SES for email delivery
- xlsx
- file-saver
- html2pdf.js
- qrcode
src/
├── pages/ # Route-level screens such as Home, Cart, Orders, Admin, and Account
├── components/ # Product page layouts and the toast
├── layouts/ # Header, menu and footer
├── stores/ # Pinia stores: auth (staff roles), cart, toast
├── services/ # Firebase setup and order reads/writes
├── composables/ # Admin order list, filters and statistics
├── utils/ # Order formatting, receipts, Excel export, PDF download
├── data/ # Survey questions
└── router/ # Route definitions and navigation guards
functions/ # Firebase Cloud Functions
├── index.js # createOrder, sendOrderQRCode, sendOrderNotification
├── lib/ # Order validation, email templates, SES mailer
└── shared/ # Catalog, pricing and settings used by BOTH the web app and the functions
# (imported in the web app as `shared/...`)
firestore.rules # Firestore security rules
public/ # Static assets (product images go in public/product-<id>.png)
.github/workflows/
└── deploy.yml # GitHub Pages deployment workflow
| What | File |
|---|---|
| Products, prices, sizes, schools, gift rule, combo deals | functions/shared/catalog.js |
| Shop opening time, roles | functions/shared/config.js |
| Survey questions | src/data/surveyQuestions.js |
The catalog is shared, so after changing prices deploy both the website and the Cloud Functions.
- Node.js 22 (20 and 24 also work for the website)
- npm or yarn
- Firebase CLI for Firebase deployment
docker build -t my-souvenir-app .docker run -p 9000:9000 my-souvenir-appThis launches the Quasar/Vite development server.
Create a production build with:
docker run --rm -p 9000:9000 my-souvenir-app npm run buildThe generated SPA files are written to:
dist/spa
The application is configured to use Firebase through:
src/services/firebase.js
If you are using a different Firebase project, update the Firebase configuration and make sure the correct project alias is configured in:
.firebaserc
Example:
{
"projects": {
"default": "cksc-merchandis"
}
}Before running Firebase commands, authenticate and select the appropriate project:
firebase login
firebase use <your-project>- Authentication → Sign-in method: enable Google (staff) and Anonymous (buyers are signed in anonymously at checkout so they can see and cancel only their own orders).
- Firestore rules:
firebase deploy --only firestore:rules - First super admin: in the Firestore console create
users/<your Firebase Auth uid>withrole: "super_admin". Everyone else is invited from 帳號管理 and activated on their first Google sign-in. - Firebase Storage is not used. If it is enabled, set its rules to deny everything.
- App Check (recommended before opening): helps block scripts from placing fake orders that email arbitrary addresses. Create a reCAPTCHA Enterprise score-based website key with
souvenir.cksc.twallowed, then in the Firebase console go to App Check and register the web app with reCAPTCHA Enterprise using that key. Put the same site key inAPP_CHECK_SITE_KEYinfunctions/shared/config.js, publish the updated website through GitHub Pages, and verify that App Check tokens are issued before deploying the functions with enforcement enabled. The Firebase SDK manages the reCAPTCHA tokens; no separate HTML click handler is needed. Each email address is also limited to 10 orders per day (staff are exempt).
Buyers don't log in: the site signs them in anonymously at checkout and every order stores that account as ownerUid, so only that browser can see or cancel it. If someone signs in on the staff login page from the same browser, the claimOrders function moves their guest orders along with them (to the staff account, or back to a new guest account if the login is refused). Orders placed before ownerUid existed can only be seen by admins, except staff orders, which are reassigned to the staff account on their next login.
The Cloud Functions in:
functions/index.js
expect the following Secret Manager secrets (firebase functions:secrets:set NAME):
AWS_ACCESS_KEY_IDAWS_SECRET_ACCESS_KEYAWS_REGIONSENDER_EMAIL
See functions/README.md for details. The website itself does not need them, but placing an order does need the deployed createOrder function.
The frontend is published through:
.github/workflows/deploy.yml
The workflow installs dependencies, builds the Quasar application, and publishes the generated files from:
dist/spa
To deploy the Cloud Functions and Firestore rules (and Firebase Hosting):
firebase deploy| Route | Description |
|---|---|
/ |
Storefront home |
/product/:id |
Product detail page |
/cart |
Shopping cart and checkout |
/orders |
Buyer order history |
/orders/:id |
Order detail |
/admin |
Admin dashboard |
/admin/login |
Admin login |
/comingsoon |
Pre-launch landing page |
The storefront launch gate is enforced in:
src/router/index.js
Before SHOP_OPEN_AT in functions/shared/config.js, visitors are redirected to /comingsoon and the createOrder function rejects orders. Staff accounts can bypass this restriction.
| Role | Can |
|---|---|
manager 友校幹部 |
View survey results, see the shop before it opens |
admin 建班幹部 |
Everything above, plus view/edit/delete all orders, export Excel, print receipts, email payment/pickup notifications to buyers |
super_admin 系統管理員 |
Everything above, plus manage staff accounts |
This project is maintained by the Taipei Municipal Chien Kuo High School Student Council.
- 79-2 Student Council Student Assembly Deputy Speaker
- 80-1 Student Council Chairman (President)
- 80-2 Student Council Speaker
- 80-1 Student Council Executive Department CIO
- 80-2 Student Council Executive Department IT Associate
CKSC Online Souvenir
Taipei Municipal Chien Kuo High School Student Council