Create a MongoDB database and get your MongoDB URI if using MongoDB Atlas (or use mongodb://localhost:27017 if running locally).
Online payment functionality: Create a PayPal account and get your PayPal Client ID from the PayPal Developer portal.
Create the .env file
PORT = 5000
MONGO_URI = mongodb://localhost:27017 Hoặc Dùng MongoDB Atlas URI
JWT_SECRET = <your-choice> (e.g., abc123)
PAYPAL_CLIENT_ID = <your-client id>
PAYPAL_APP_SECRET=<your-payPal-secret>
PAYPAL_API_URL=https://api-m.sandbox.paypal.com
npm install
cd frontend
npm install
npm run dev
npm run client
npm run server
-
Register a new account.
-
Access your database (using MongoDB Compass or MongoDB Atlas) and set the isAdmin field of the newly created account to true.
-
Log in again using the updated account.