Either:
- Docker
- Docker Compose
or
- Node >=15
- MongoDB
If you don't have Stripe or Paypal secrets, leave them as they are as shown below.
In /.env add:
STRIPE_SECRET_KEY=<stripe-secret-key>
STRIPE_DEVICE_NAME=<stripe-device-name>
In client/.env, add:
VITE_PUBLIC_PAYPAL_CLIENT_ID_SAND=<paypal-client-id>
VITE_PUBLIC_PAYPAL_ENV=sandbox
VITE_PUBLIC_STRIPE_PUBLISHABLE_KEY=<stripe-publishable-key>
In server/.env, add:
JWT_SECRET=password
MONGO_URI=mongodb://localhost:27017/sample-shop
PAYPAL_MODE=sandbox
PAYPAL_CLIENT_ID=<paypal-client-id>
PAYPAL_CLIENT_SECRET=<paypal-client-secret>
STRIPE_SECRET=<stripe-secret>
STRIPE_ENDPOINT_SECRET=<stripe-endpoint-secret>
In client/ run:
npm install
In server/ run:
npm install
In server/ run:
npm run dev
You should be able to open the site on localhost:3000
In / run:
docker-compose up
- Open localhost:3000/
- Click Sign Up
- Sign up (it should redirect you to localhost:3000/login if successful)
- Log in (it should redirect you to localhost:3000/inventory if successful)
- Add some products
- Go back to localhost:3000/
- Add a product to cart
- Click the cart icon
- Pay with your preferred payment gateway