A full-stack e-commerce application for SW Jewelry with React frontend and Express API backend.
sw_jewelry/
├── client/ # React frontend application
│ ├── src/
│ │ ├── components/
│ │ ├── config/
│ │ └── ...
│ └── package.json
├── server/ # Express API backend
│ ├── controllers/
│ ├── routes/
│ ├── middleware/
│ ├── utils/
│ └── package.json
├── .env.local # ⚠️ Environment variables (ROOT directory)
├── package.json # Root workspace configuration
└── README.md
- Node.js (v16 or higher)
- npm (v8 or higher)
- MongoDB Atlas account
-
Clone the repository
git clone <repository-url> cd sw_jewelry
-
Install all dependencies
pnpm run install:all
-
Set up environment variables
IMPORTANT: Create
.env.localin the ROOT directory (not in server/):# Location: /sw_jewelry/.env.local (ROOT directory) # MongoDB Configuration MONGODB_PASSWORD=your_actual_mongodb_password_here MONGODB_USERNAME=lincolnwisely MONGODB_CLUSTER=cluster0.9qqs7tb.mongodb.net MONGODB_DATABASE=sw_jewelry_db MONGODB_URI=mongodb+srv://lincolnwisely:[email protected]/sw_jewelry_db?retryWrites=true&w=majority # Database Configuration DB_NAME=sw_jewelry_db # JWT Configuration JWT_SECRET=your_super_secret_jwt_key_here JWT_EXPIRES_IN=7d # Server Configuration PORT=3000 NODE_ENV=development
⚠️ Critical: The.env.localfile MUST be in the root directory, NOT in the server/ subdirectory. -
Seed the database
npm run seed
-
Start development servers
npm run dev
This will start both:
- Frontend:
http://localhost:3001 - Backend:
http://localhost:3000
- Frontend:
-
Start both servers simultaneously:
npm run dev
-
Or start them individually:
# Terminal 1 - Backend npm run dev:server # Terminal 2 - Frontend npm run dev:client