Skip to content

Commit 4f5c668

Browse files
authored
Merge pull request #228 from jugeshraghav/restaurant-dynamic-web
restaurant website added.
2 parents d002a33 + 2305771 commit 4f5c668

File tree

14 files changed

+3797
-0
lines changed

14 files changed

+3797
-0
lines changed

Index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,3 +82,5 @@
8282
| [Password Generator](https://github.com/Ayushparikh-code/Web-dev-mini-projects/tree/main/Password%20Generator) | A password generator app to generate strong passwords which can be easily used for authentication. |
8383
| [Parallex Website](https://github.com/Ayushparikh-code/Web-dev-mini-projects/tree/main/Chess-Game) | A basic website using HTML, CSS, JAVASCRIPT with modern look. |
8484
| [Weight Converter](https://github.com/Ayushparikh-code/Web-dev-mini-projects/tree/main/Weight%20Converter) |A web page where used can convert weight from kilograms to grams, ounces and pounds.
85+
86+
| [Restaurant website](https://github.com/Ayushparikh-code/Web-dev-mini-projects/tree/main/Restaurant-website) |A Restuarant website with a simple and user friendly design ad a database linked to it.

Restaurant-website/index.html

Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
4+
<head>
5+
<meta charset="UTF-8">
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7+
<title>Le Catering</title>
8+
<link rel="stylesheet" href="css/style.css">
9+
<link rel="shortcut icon" type="image/jpg" href="/images/img1.jpg">
10+
</head>
11+
<body>
12+
<!-------Navbar-------------------------------------------------------------------------------------------------------------------------------->
13+
<nav>
14+
<ul>
15+
<li><a href="#home" id="left">Gourmet au Catering</a></li>
16+
<li><a href="#about" id="right">About</a></li>
17+
<li><a href="#menu" id="right1">Menu</a></li>
18+
<li><a href="#contact" id="right2">Contact</a></li>
19+
</ul>
20+
</nav>
21+
<!-------Home section---------------------------------------------------------------------------------------------------------------------------------->
22+
<div id="home">
23+
</div>
24+
<p id="home-content">Le Catering</p>
25+
<hr>
26+
<!-----About section---------------------------------------------------------------------------------------------------------------------------------------->
27+
<div id="about">
28+
<!--image in about section-->
29+
<section id="about-section-image">
30+
<img src="images/img1.jpg">
31+
</section>
32+
<!---content in about section-->
33+
<section id="about-section">
34+
<p id="about-section-heading">About Catering</p>
35+
<h5 id="about-section-des">Tradition since 1889</h5>
36+
Lorem ipsum dolor sit amet consectetur adipisicing elit. Unde libero sequi eius ipsam? Explicabo velit,
37+
facere ullam excepturi perferendis commodi consequuntur, officia alias fuga beatae, eligendi voluptas
38+
quisquam molestiae voluptatum cum suscipit earum dolorem aliquid neque? Dolores exercitationem assumenda
39+
quia.
40+
<br>
41+
Lorem ipsum dolor sit amet consectetur adipisicing elit. Ut qui ab a illum eaque. Excepturi, totam. Odit
42+
aperiam magni, culpa veniam ullam ea totam suscipit minima! Quam odio nesciunt ipsum. Maxime ipsa soluta
43+
fugiat.
44+
Lorem ipsum dolor sit amet consectetur adipisicing elit. Ratione iure eaque repellendus cumque quasi
45+
dignissimos, atque necessitatibus, qui molestiae aliquid adipisci a cum.<br>
46+
Lorem ipsum dolor sit, amet consectetur adipisicing elit. Quas at blanditiis dolore saepelorem10
47+
48+
</section>
49+
</div>
50+
<hr>
51+
<!----------Our menu section------------------------------------------------------------------------------------------------------------------------------->
52+
<div id="menu">
53+
<!---menu-content-->
54+
<section id="menu-content">
55+
<div class="menu-items">
56+
<p id="menu-main-heading">Our Menu<p>
57+
</div>
58+
<div class="menu-items">
59+
<h3 class="menu-headings">
60+
Bread Basket
61+
</h3>
62+
<p class="menu-des">
63+
Assortment of fresh baked fruit breads and muffins 5.50
64+
</p>
65+
</div>
66+
<div class="menu-items">
67+
<h3 class="menu-headings">
68+
Honey Almond Granola with Fruits
69+
</h3>
70+
<p class="menu-des">
71+
Natural cereal of honey toasted oats, raisins, almonds and dates 7.00
72+
</p>
73+
</div>
74+
<div class="menu-items">
75+
<h3 class="menu-headings">
76+
Belgian Waffle
77+
78+
</h3>
79+
<p class="menu-des">
80+
Vanilla flavored batter with malted flour 7.50
81+
</p>
82+
</div>
83+
<div class="menu-items">
84+
<h3 class="menu-headings">
85+
Scrambled eggs
86+
</h3>
87+
<p class="menu-des">
88+
Scrambled eggs, roasted red pepper and garlic, with green onions 7.50
89+
</p>
90+
</div>
91+
<div class="menu-items">
92+
<h3 class="menu-headings">
93+
Blueberry Pancakes
94+
</h3>
95+
<p class="menu-des">
96+
With syrup, butter and lots of berries 8.50
97+
</p>
98+
</div>
99+
<!----section-image-->
100+
</section>
101+
<section id="menu-img">
102+
<img src="images/img2.jpg">
103+
</section>
104+
</div>
105+
<hr>
106+
<!------Contact section---------------------------------------------------------------------------------------------------------------------------------->
107+
<div id="contact">
108+
<p id="contact-main-heading">
109+
Contact
110+
<p>
111+
<p class="contact-content">We offer full-service catering for any event, large or small. We understand your
112+
needs and we will cater the food to satisfy the biggerst criteria of them all, both look and taste. Do not
113+
hesitate to contact us.
114+
115+
</p>
116+
<h2 id="contact-sub-heading">
117+
Catering Service, 42nd Living St, 43043 New York, NY
118+
</h2>
119+
<p class="contact-content">
120+
You can also contact us by phone 00553123-2323 or email [email protected], or you can send us a message
121+
here:
122+
</p>
123+
<!----form------>
124+
<form action="/" method="post">
125+
<input type="text" name="name" placeholder="Name" required><br>
126+
<input type="number" name="people" placeholder="How many people" ><br>
127+
<input type="date" name="date" value="30-12-2020 20:00" ><br>
128+
<input type="text" name="message" placeholder="Message/Special requirements"><br>
129+
<input type="submit" name="button" value="SEND MESSAGE"><br>
130+
</form>
131+
</div>
132+
<!-------Footer-------------------------------------------------------------------------------------------------------------------------------->
133+
<div id="footer">
134+
<span id="footer-content">Powered by @jugesh-raghav...</span>
135+
</div>
136+
</body>
137+
138+
</html>

Restaurant-website/index.js

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
const express = require("express");
2+
const mongoose = require("mongoose");
3+
const path = require("path");
4+
const app = express();
5+
6+
7+
8+
app.use(express.urlencoded({extended:true}));
9+
app.use(express.static(__dirname + "/public"));
10+
11+
12+
13+
14+
15+
mongoose.connect("mongodb://localhost:27017/restaurant",{
16+
useNewUrlParser:true, useUnifiedTopology: true
17+
}).then(()=>console.log("successfull"))
18+
.catch((err)=>console.log(err));
19+
20+
const visitorSchema= new mongoose.Schema({
21+
name:String,
22+
NoofPeople:Number,
23+
date:Date,
24+
message:String
25+
});
26+
27+
const visitorModel = new mongoose.model("visitor",visitorSchema);
28+
29+
//let visitor1 = new visitorModel(
30+
//{
31+
// name:"jugesh",
32+
//NoofPeople:6,
33+
//date:12-03-2020,
34+
// message:"hii"
35+
// }
36+
//);
37+
//visitor1.save();
38+
//const visitor2 = new visitorModel(
39+
// {
40+
// name:"raghav",
41+
// NoofPeople:6,
42+
// date:12-03-2020,
43+
// message:"hello"
44+
//}
45+
//);
46+
47+
//visitor2.save();
48+
49+
50+
app.get("/",(req,res)=>{
51+
res.sendFile(__dirname+"/index.html");
52+
});
53+
54+
55+
app.post("/",(req,res)=>{
56+
const name = req.body.name;
57+
const people = req.body.people;
58+
const date = req.body.date;
59+
const message = req.body.message;
60+
const visitor3 = new visitorModel(
61+
{
62+
name: name,
63+
NoofPeople:people,
64+
date:date,
65+
message:message
66+
}
67+
);
68+
visitor3.save();
69+
res.redirect("/");
70+
})
71+
72+
73+
74+
75+
app.listen(3000,(req,res)=>{
76+
console.log("server running at port 3000");
77+
})
78+

0 commit comments

Comments
 (0)