{"id":50645890,"url":"https://github.com/datweb07/cafe-app","last_synced_at":"2026-06-07T12:31:06.589Z","repository":{"id":361057872,"uuid":"1251342052","full_name":"datweb07/cafe-app","owner":"datweb07","description":null,"archived":false,"fork":false,"pushed_at":"2026-05-29T02:29:05.000Z","size":8613,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-29T04:12:16.646Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://cafe-app-vsx7.onrender.com","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/datweb07.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-27T13:37:37.000Z","updated_at":"2026-05-29T02:29:09.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/datweb07/cafe-app","commit_stats":null,"previous_names":["datweb07/cafe-app"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/datweb07/cafe-app","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datweb07%2Fcafe-app","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datweb07%2Fcafe-app/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datweb07%2Fcafe-app/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datweb07%2Fcafe-app/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/datweb07","download_url":"https://codeload.github.com/datweb07/cafe-app/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datweb07%2Fcafe-app/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34022031,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-07T02:00:07.652Z","response_time":124,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-06-07T12:31:05.773Z","updated_at":"2026-06-07T12:31:06.583Z","avatar_url":"https://github.com/datweb07.png","language":"PHP","funding_links":["https://developer.paypal.com/"],"categories":[],"sub_categories":[],"readme":"\u003e Read in other languages: [Tiếng Việt](README.vi.md)\n\n# Cafe App\n\n## Project Description\n\nXXX\n\n## Key Features\n\n### Client Features\n- **Product Catalog** — Browse products with images, specs, pricing, and variants (color, storage, RAM)\n- **Product Detail** — Full spec sheet, image gallery, variant selector, related products\n- **Shopping Cart** — Add, update quantity, remove items, persistent across sessions\n- **Search** — Real-time XML-based search with history tracking and popular keywords\n- **Wishlist** — Save products for later, toggle from product cards\n- **Checkout** — Multi-step checkout with address selection and payment method choice\n- **Payment Methods** — VNPay (card), PayPal (international), VietQR (bank transfer QR), COD (cash on delivery)\n- **Order Management** — View order history, track status, cancel pending orders\n- **Product Reviews** — Star rating + comment system, one review per purchased product\n- **Promotions** — Browse active promotions, apply discount/coupon codes at checkout\n- **User Authentication** — Register, login, email verification, forgot/reset password\n- **Google Login** — One-click sign-in via Google OAuth (Supabase Auth)\n- **Profile Management** — Update name, phone, DOB, gender, avatar (Cloudinary upload)\n- **Address Book** — Add/edit/delete multiple shipping addresses, set default\n- **Responsive Design** — Mobile-first layout, works on all screen sizes\n\n### Admin Features\n- **Dashboard** — Revenue charts, order stats, top products, recent activity\n- **Product Management** — Full CRUD for products, variants, images (Cloudinary), specifications\n- **Category Management** — Hierarchical categories with featured/suggested flags\n- **Order Management** — View all orders, update status, view order details\n- **User Management** — View customer accounts, account details\n- **Promotion Management** — Create/edit/delete promotional campaigns with product linking\n- **Discount Code Management** — Generate and manage voucher/coupon codes with usage limits\n- **Banner Management** — Hero banners and promotional banners with display toggle\n- **Review Management** — View and moderate product reviews\n- **Payment Verification** — Approve or reject manual payment confirmations (VietQR/COD)\n- **Payment Gateway Health** — Monitor success/failure rates per gateway\n- **Notification System** — Real-time admin notifications for new orders and payments\n- **Refund Management** — Process refunds for VNPay (sandbox mock) and PayPal\n\n## Technologies Used\n\n\u003cimg alt=\"fpt-shop-banner\" src=\"https://github.com/datweb07/NHOM_1_WEB/blob/main/images/technology.png\" /\u003e\n\n| Layer | Technology |\n|---|---|\n| Backend | PHP 8.x, MVC architecture, custom file-based router |\n| Frontend | HTML5, CSS3, JavaScript ES6+, Bootstrap 5, Font Awesome 6 |\n| Database | MySQL 8.x (utf8mb4) |\n| Image Storage | Cloudinary PHP SDK |\n| Email | PHPMailer (bundled), Gmail SMTP |\n| Auth | PHP Sessions + Supabase Auth (Google OAuth) |\n| Payment | VNPay, PayPal REST API v2, VietQR, COD |\n| Security | Google reCAPTCHA v2 |\n| Caching | Redis (predis) |\n| Env Config | vlucas/phpdotenv |\n\n## Installation \u0026 Setup\n\n### Prerequisites\n- **PHP**: \u003e= 8.0\n- **MySQL**: \u003e= 8.0\n- **Composer**: Latest version\n- **Web Server**: Apache/Nginx or PHP's built-in server\n\n### Step 1: Clone the Repository\n```bash\ngit clone [https://github.com/datweb07/NHOM_1_WEB.git](https://github.com/datweb07/NHOM_1_WEB.git)\ncd NHOM_1_WEB\n````\n\n### Step 2: Install Dependencies\n\n  - Install Composer at [this link](https://getcomposer.org/download/)\n\n\u003c!-- end list --\u003e\n\n```bash\ncomposer install\n```\n\n### Step 3: Configure Environment Variables\n\n1.  Copy the example environment file:\n\n\u003c!-- end list --\u003e\n\n```bash\ncp .env.example .env\n```\n\n2.  Edit the `.env` file with your configurations:\n\n\u003c!-- end list --\u003e\n\n```env\nAPP_ENV=local\nAPP_DEBUG=true\nAPP_URL=http://localhost:3000\n\nDB_HOST=localhost\nDB_PORT=3306\nDB_DATABASE=db_fpt\nDB_USERNAME=root\nDB_PASSWORD=your_password\n\nREDIS_HOST=127.0.0.1\nREDIS_PORT=6379\nREDIS_PASSWORD=null\nREDIS_DB=0\n\nCLOUDINARY_CLOUD_NAME=your_cloud_name\nCLOUDINARY_API_KEY=your_api_key\nCLOUDINARY_API_SECRET=your_api_secret\n\nMAIL_HOST=smtp.gmail.com\nMAIL_PORT=587\nMAIL_USERNAME=your_email@gmail.com\nMAIL_PASSWORD=your_app_password\nMAIL_ENCRYPTION=tls\n\nRECAPTCHA_SITE_KEY=your_recaptcha_site_key\nRECAPTCHA_SECRET_KEY=your_recaptcha_secret_key\n\nSUPABASE_URL=https://your-project-id.supabase.co\nSUPABASE_ANON_KEY=your_supabase_anon_key\nSUPABASE_JWT_SECRET=your_supabase_jwt_secret\n\nVNPAY_TMN_CODE=your_tmn_code\nVNPAY_HASH_SECRET=your_hash_secret\nVNPAY_URL=https://sandbox.vnpayment.vn/paymentv2/vpcpay.html\n\nVIETQR_BANK_ID=VCB\nVIETQR_ACCOUNT_NO=your_account_number\nVIETQR_ACCOUNT_NAME=YOUR FULL NAME\nVIETQR_TEMPLATE=compact2\n\nPAYPAL_CLIENT_ID=your_paypal_client_id\nPAYPAL_SECRET=your_paypal_secret\nPAYPAL_MODE=sandbox\n```\n\n### Step 4: Setup Database\n\n1.  Create a new database in MySQL:\n\n\u003c!-- end list --\u003e\n\n```sql\nCREATE DATABASE db_web CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;\n```\n\n2.  Import the database schema:\n\n\u003c!-- end list --\u003e\n\n```bash\nmysql -u root -p db_web \u003c database/db_web.sql\n```\n\nOr use phpMyAdmin to import the `database/db_web.sql` file.\n\n### Step 5: Configure Cloudinary (Image Storage)\n\n1.  Sign up for a free account at [Cloudinary](https://cloudinary.com/).\n2.  Get your credentials from your dashboard.\n3.  Update the `.env` file with your Cloudinary credentials.\n\n### Step 6: Configure Email Service\n\nFor Gmail SMTP:\n\n1.  Enable 2-step verification (2FA) on your Google account.\n2.  Generate an App Password: [Google App Passwords](https://myaccount.google.com/apppasswords).\n3.  Enter the generated password into the `MAIL_PASSWORD` field in the `.env` file.\n\n### Step 7: Configure Google Login Service\n\nConfigure Supabase and Google Cloud Console (Supabase \u0026 Google Cloud)\n\n  - Supabase Setup:\n\n\u003c!-- end list --\u003e\n\n1.  Go to the [Supabase](https://supabase.com/) homepage, create a free account, and create a new project.\n2.  Copy the URL of the newly created project.\n3.  On the left navigation bar, go to **Authentication** → **Sign In/Providers**.\n4.  Under **Auth Providers**, select Google, and set up the Google Cloud Console to fill in the required information.\n\n\u003c!-- end list --\u003e\n\n  - Google Cloud Console Setup:\n\n\u003c!-- end list --\u003e\n\n1.  Go to the [Google Cloud Console](https://console.cloud.google.com/?hl=vi) homepage.\n2.  In the top-left corner next to the Google Cloud logo, click the project dropdown and select **New project**.\n3.  Under **Project name**, enter a memorable name, e.g., `FPT-SHOP`, then click **Create**.\n4.  Next, click the hamburger menu icon, select **APIs \u0026 Services** → **OAuth consent screen**.\n5.  Under **Overview** → **Google Auth Platform not configured yet**, select **Get started**.\n6.  Under **App Information**, enter a memorable **App name** (you can use `FPT-SHOP`), choose your currently logged-in email for the **User support email**, and click Next.\n7.  In the **Audience** section, select **External**, then click Next.\n8.  Under **Contact Information**, enter your currently logged-in email, click Next, and then click **Create**.\n\n\u003c!-- end list --\u003e\n\n  - Create Client ID:\n\n\u003c!-- end list --\u003e\n\n1.  On the left menu, select **APIs \u0026 Services** → **Credentials**.\n2.  At the top, select **Create credentials** → **OAuth client ID**.\n3.  For **Application type**, select **Web application**. Under Name, give it a memorable name (e.g., `Supabase Auth Client`).\n4.  Under **Authorized redirect URIs**, click **Add URI**. Then go back to *Supabase Setup* at step 4, copy the **Callback URL (for OAuth)**, return here to paste it into URIs 1, and click **Create**.\n5.  Right after clicking create, Google will display a popup containing two strings: **Client ID** and **Client Secret**. Copy these two strings, return to Supabase **(Authentication → Providers → Google)**, enable \"Sign in with Google\", paste the two strings into the corresponding fields, and click Save.\n\n\u003c!-- end list --\u003e\n\n  - Declare URL for Web Application:\n\n\u003c!-- end list --\u003e\n\n1.  Return to Supabase, go to **Authentication → URL Configuration**.\n2.  **Site URL**: Enter `http://localhost:3000` (development) or `https://yourdomain.com` (production).\n3.  **Redirect URLs**: Add the exact path to the callback handler file on your PHP system.\n    Example: `http://localhost:3000/app/views/client/auth/callback.php`\n4.  Update the `.env` file with your Cloudinary credentials.\n\n### Step 8: Google reCAPTCHA v2 \n\n1. Go to https://www.google.com/recaptcha/admin/create.\n2. Under **Label**, enter a name (e.g., `FPT Shop`).\n3. Under **reCAPTCHA type**, select **reCAPTCHA v2** → \"I'm not a robot\" Checkbox.\n4. Under **Domains**, add `localhost` (for development) and your production domain.\n5. Click **Submit** — you will receive a **Site Key** and **Secret Key**.\n6. Copy them into your `.env`:\n   ```env\n   RECAPTCHA_SITE_KEY=6Lc...your_site_key\n   RECAPTCHA_SECRET_KEY=6Lc...your_secret_key\n   ```\n### Step 9: VNPay (Card Payment — Sandbox)\n\n1. Go to https://sandbox.vnpayment.vn/devreg/ and register a sandbox merchant account.\n2. After registration, log in to the sandbox portal.\n3. Go to **Thông tin tích hợp** (Integration Info) to find your:\n   - **TMN Code** (`vnp_TmnCode`) — your merchant terminal code\n   - **Hash Secret** (`vnp_HashSecret`) — your signing secret\n4. Copy them into your `.env`:\n   ```env\n   VNPAY_TMN_CODE=XXXXXXXX\n   VNPAY_HASH_SECRET=your_hash_secret_here\n   VNPAY_URL=https://sandbox.vnpayment.vn/paymentv2/vpcpay.html\n   ```\n5. For testing, use VNPay's test card numbers from: https://sandbox.vnpayment.vn/apis/docs/thanh-toan-pay/pay.html\n\n\u003e **Note**: VNPay sandbox does not support real refunds. This project uses a mock refund simulation that logs the operation without calling the VNPay API.\n\n### Step 10: PayPal (International Payment — Sandbox)\n\n1. Go to https://developer.paypal.com/ and log in with your PayPal account.\n2. Go to **Apps \u0026 Credentials** → make sure you are in **Sandbox** mode.\n3. Click **Create App** → name it `FPT Shop` → **Create App**.\n4. You will see your **Client ID** and **Secret key 1** — copy them:\n   ```env\n   PAYPAL_CLIENT_ID=AXxx...your_client_id\n   PAYPAL_SECRET=EXxx...your_secret\n   PAYPAL_MODE=sandbox\n   ```\n5. For testing, use PayPal sandbox buyer accounts from **Testing Tools** → **Sandbox Accounts** → Choose an account with the `Type` Personal, which will contain the `Email` and `Password` used to test payments.\n6. Currency conversion: VND amounts are divided by 25,000 to get USD (e.g., 500,000 VND → $20.00 USD).\n\n\u003e For production, change `PAYPAL_MODE=live` and replace with live credentials.\n\n### Step 11: VietQR (Bank Transfer QR)\n\n1. Set your bank details in `.env`:\n   ```env\n   VIETQR_BANK_ID=VCB          # Bank code (VCB = Vietcombank, TCB = Techcombank, etc.)\n   VIETQR_ACCOUNT_NO=1234567890\n   VIETQR_ACCOUNT_NAME=NGUYEN VAN A\n   VIETQR_TEMPLATE=compact2\n   ```\n2. Find your bank's code at: https://www.vietqr.io/danh-sach-ngan-hang\n3. Payment confirmation is **manual** — admin must verify and approve the transfer.\n\n### Step 12: Run the Development Server\n\nFrom the project root directory:\n\n```bash\nphp -S localhost:3000 router.php\n```\n\n### Step 13: Access the Application\n\n  - **Client**: http://localhost:3000\n  - **Admin Panel**: http://localhost:3000/admin/auth/login\n\n### Default Admin Credentials\n\nAfter importing the database, you can log in with:\n\n  - **Email**: admin@fptshop.com\n  - **Password**: admin\n\n## Development Team\n\n| Member                                                                         | Role        |\n| ------------------------------------------------------------------------------ | ----------- |\n| Truong Thanh Dat ([datweb07](https://github.com/datweb07))                     | Team Leader |\n| Phan Khac Anh Tuan ([KhacTuan1224](https://github.com/KhacTuan1224))           | Member      |\n| Nguyen Phuong Chinh ([chinhngprit](https://github.com/chinhngprit))            | Member      |\n| Nguyen Tan Khiem ([nguyentankhiem1610](https://github.com/nguyentankhiem1610)) | Member      |\n\n## Contributing\n\nPlease read [CONTRIBUTING.md](https://www.google.com/search?q=CONTRIBUTING.md) for details on our code of conduct and the process for submitting pull requests.\n\n## License\n\nThis project is released under the **MIT License**. See the [LICENSE.md](LICENSE.md) file for full details.\n\n### Third-Party Library Licenses\n\nThis project uses various third-party libraries and services. For detailed information on all dependencies, their licenses, and compliance requirements, please see [THIRD-PARTY-NOTICES.md](https://www.google.com/search?q=THIRD-PARTY-NOTICES.md).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatweb07%2Fcafe-app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdatweb07%2Fcafe-app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatweb07%2Fcafe-app/lists"}