Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
6913f82
Merge pull request #8 from ZNilakshi/Wathsala
Wathsu4 May 24, 2025
7d75225
Merge pull request #10 from ZNilakshi/Wathsala
Wathsu4 May 24, 2025
25849a3
Merge pull request #11 from ZNilakshi/Wathsala
Wathsu4 May 24, 2025
c484352
add
HiruniWijerathna May 25, 2025
1915498
brand pages
ZNilakshi May 25, 2025
8b5c3d0
change
HiruniWijerathna May 25, 2025
d8d5c79
add
HiruniWijerathna May 25, 2025
00fd696
item add
HiruniWijerathna May 25, 2025
e8df545
change
HiruniWijerathna May 25, 2025
b4119fa
add
HiruniWijerathna May 25, 2025
594533e
add
HiruniWijerathna May 25, 2025
6dffe53
Remove backend user profile route
Wathsu4 May 25, 2025
3abee1e
change screan scall
HiruniWijerathna May 25, 2025
8db252b
update
malshikainsari May 26, 2025
4595a54
Merge branch 'main' of https://github.com/ZNilakshi/Capstone-Project
malshikainsari May 26, 2025
762c23a
remove user profile
malshikainsari May 26, 2025
1956a23
Add back button to UserProfile page
Wathsu4 May 26, 2025
a12acd6
add
HiruniWijerathna May 28, 2025
2651f9a
add
HiruniWijerathna May 28, 2025
19f7daf
add
HiruniWijerathna May 28, 2025
2e6853c
add image
HiruniWijerathna May 29, 2025
543d814
new changes on admin dashboard
ZNilakshi May 29, 2025
f9db14f
change the port
ZNilakshi Jun 3, 2025
002806f
cart update
malshikainsari Jun 3, 2025
7ff8cbc
user details on cart
ZNilakshi Jun 3, 2025
4a4ceb7
order confirmation
ZNilakshi Jun 3, 2025
087eada
order details save in database
ZNilakshi Jun 3, 2025
4fe9cb0
order history
ZNilakshi Jun 4, 2025
ea618fc
orders in admin page
ZNilakshi Jun 4, 2025
3ade811
update brandpage
malshikainsari Jun 4, 2025
e6ac81d
age verification
ZNilakshi Jun 4, 2025
75d17d2
Update BrandPage.jsx
malshikainsari Jun 4, 2025
fe2d357
Update AuthForm.jsx
malshikainsari Jun 4, 2025
52e4fe3
Update CartContext.jsx
malshikainsari Jun 4, 2025
dcd2468
send notification
ZNilakshi Jun 4, 2025
9a6b833
age verification
ZNilakshi Jun 4, 2025
8be5998
user profile
ZNilakshi Jun 4, 2025
86a80b0
auth changes
ZNilakshi Jun 4, 2025
87ec2bc
cart routes
ZNilakshi Jun 4, 2025
ac799d8
products
ZNilakshi Jun 4, 2025
ba8512c
notifications
ZNilakshi Jun 4, 2025
e0b37f3
footer chnages
ZNilakshi Jun 4, 2025
087d621
sign up changes for fogot
ZNilakshi Jun 4, 2025
ff54081
update notification
ZNilakshi Jun 4, 2025
0e5d878
cart management
ZNilakshi Jun 4, 2025
c5d819a
checkout update
ZNilakshi Jun 4, 2025
d5618b7
Update branch contact numbers to include secondary contacts
Wathsu4 Jun 5, 2025
25a93cf
sprite
ZNilakshi Jun 5, 2025
63c34a6
Update branch contact numbers for each branches
Wathsu4 Jun 5, 2025
11ce34c
Merge branch 'main' of https://github.com/ZNilakshi/Capstone-Project
Wathsu4 Jun 5, 2025
801bafa
Update location in cantact page
Wathsu4 Jun 5, 2025
7d818e2
add
HiruniWijerathna Jun 5, 2025
597c0e0
filter change
ZNilakshi Jun 5, 2025
dbfc90d
admin panel status change
ZNilakshi Jun 5, 2025
4a1c723
manage stock
ZNilakshi Jun 5, 2025
5081d27
new design for admin
ZNilakshi Jun 5, 2025
0ae4f4d
brand page design changes
ZNilakshi Jun 5, 2025
48e5881
new admin design
ZNilakshi Jun 5, 2025
a3ac2ce
login for order product
ZNilakshi Jun 5, 2025
9d8c852
products search
ZNilakshi Jun 5, 2025
4b0d016
navigation bar update for our story
ZNilakshi Jun 5, 2025
60cd345
logo
ZNilakshi Jun 5, 2025
e4e6226
search bar
ZNilakshi Jun 11, 2025
c54968e
add
HiruniWijerathna Jun 27, 2025
160e729
Merge branch 'main' of https://github.com/ZNilakshi/Capstone-Project
HiruniWijerathna Jun 27, 2025
23b3080
Create README.md
HiruniWijerathna Jun 27, 2025
972aff8
Merge branch 'main' of https://github.com/ZNilakshi/Capstone-Project
HiruniWijerathna Jun 27, 2025
c7b3dfd
Update README.md
HiruniWijerathna Jun 27, 2025
1cc9b9c
Update README.md
HiruniWijerathna Jun 27, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# 🍷 De Silva Wine Store – Welimada

<p align="center">
<img src="frontend/public/4.png" alt="de silva Website Banner" width="100%" />
</p>

A **MERN stack** (MongoDB, Express.js, React.js, Node.js) based web application designed for **De Silva Wine Stores – Welimada**, enabling customers to browse and order products online with a smooth, modern experience.

---

## 🛍️ Key Features

- 🔍 **Browse Products by Category**
- 🥃 Spirits
- 🍺 Beer
- 🍷 Wine

- 🛒 **Shopping Cart**
- Add, view, and update cart items
- Checkout securely

- 🧑‍💼 **Admin Panel**
- Add, edit, and delete products
- Manage inventory

- ✅ **Order Confirmation**
- Place and confirm orders

- 📞 **Contact Page**
- Users can contact the store with inquiries or custom order requests

---

## 🛠️ Tech Stack (MERN)

- **Frontend:** React.js + Tailwind CSS
- **Backend:** Node.js + Express.js
- **Database:** MongoDB with Mongoose
- **API Communication:** Axios
- **Deployment:**
- Frontend: Vercel / Netlify
- Database: MongoDB Atlas

7 changes: 7 additions & 0 deletions backend/.env
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,10 @@ PORT=5000

JWT_SECRET=your_super_secret_jwt_key
MONGO_URI=mongodb+srv://nilakshisamarasekara0:fw9YI0vgQfSwsKNr@cluster0.crf7fpq.mongodb.net/?retryWrites=true&w=majority&appName=Cluster0

EMAIL_USER=drivextravel@gmail.com
EMAIL_PASS=yorg nvuu bgay npqz


SMTP_PORT=587
SMTP_HOST=smtp.gmail.com
13 changes: 10 additions & 3 deletions backend/middleware/auth.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
const jwt = require("jsonwebtoken");

module.exports = (req, res, next) => {
const auth = async (req, res, next) => {
try {
const token = req.header("Authorization").replace("Bearer ", "");
const token = req.header("Authorization")?.replace("Bearer ", "");

if (!token) {
throw new Error("Authentication required");
}

const decoded = jwt.verify(token, process.env.JWT_SECRET);
req.user = decoded;
next();
} catch (err) {
res.status(401).json({ message: "Authentication required" });
res.status(401).json({ message: "Please authenticate" });
}
};

module.exports = auth;
27 changes: 27 additions & 0 deletions backend/models/Order.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// models/Order.js
const mongoose = require('mongoose');

const orderItemSchema = new mongoose.Schema({
productId: { type: mongoose.Schema.Types.ObjectId, required: true },
name: { type: String, required: true },
size: { type: String },
price: { type: Number, required: true },
quantity: { type: Number, required: true }
});

const orderSchema = new mongoose.Schema({
user: {
firstName: { type: String, required: true },
lastName: { type: String, required: true },
email: { type: String, required: true },
phone: { type: String, required: true },
location: { type: String, required: true }
},
items: [orderItemSchema],
subtotal: { type: Number, required: true },
total: { type: Number, required: true },
status: { type: String, default: 'pending' },
createdAt: { type: Date, default: Date.now }
});

module.exports = mongoose.model('Order', orderSchema);
13 changes: 5 additions & 8 deletions backend/models/User.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
const mongoose = require("mongoose");

const userSchema = new mongoose.Schema(
{
const userSchema = new mongoose.Schema({
firstName: String,
lastName: String,
username: { type: String, required: true, unique: true },
email: { type: String, unique: true, sparse: true },
phone: String,
password: { type: String, required: true },
phone: String,
role: { type: String, enum: ["user", "admin"], default: "user" },
},
{ timestamps: true }
);
role: { type: String, enum: ['user', 'admin'], default: 'user' },
}, { timestamps: true });

module.exports = mongoose.model("User", userSchema);
module.exports = mongoose.model("User", userSchema);
17 changes: 1 addition & 16 deletions backend/node_modules/.bin/bcrypt

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 1 addition & 16 deletions backend/node_modules/.bin/semver

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 16 additions & 7 deletions backend/node_modules/.package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions backend/node_modules/mongodb/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 19 additions & 2 deletions backend/node_modules/mongodb/lib/beta.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion backend/node_modules/mongodb/lib/bulk/common.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion backend/node_modules/mongodb/lib/bulk/common.js.map

Large diffs are not rendered by default.

Loading