Circle is a full-stack, well rounded restaurant management application. It allows users, such as customers, to add items to their order while also facilitating restaurant administrative functions. On the administrative side this would include additional features such as adding, editing and deleting existing orders.
![Main Page](/michaelanthonyyy/circle_restaurant_mgmt/raw/main/public/assets/main.gif)
To install dependencies run the following command:
npm install
To use this repo you will need a working knowledge of Javascript, Express, Sequelize, Passport, HTML/Foundation CSS.
To run this tool use the following command.
node server.js
Admin Credentials:
username: admin
password: password
For our models, we had "Items" which holds all menu information, "Seating" which assigns users to a specific table for the food to be delivered, and "Orders" which is a join table between the two. Through table association Orders belongs to both Seating and Items with foreign-key's for each table allowing Orders to display itemId's correctly based on seatingId when Users are placing their orders.
Orders.associate = function (models) {
models.Orders.belongsTo(models.Seating, {
foreignKey: {
allowNull: false,
constraints: false,
}
});
models.Orders.belongsTo(models.Items, {
foreignKey: {
allowNull: false,
constraints: false,
}
});
};
We have several routes for items, orders, and seating. The items and seating routes are used to give the user and admin both functionality with adding orders, editing and deleting orders. The seating routes are used for displaying the orders and keeping track of customers.
app.get("/api/orders/seating/:id", function (req, res) {
db.Orders.findAll({
where: {
SeatingId: req.params.id,
submitted: 0,
completed: 0
},
include: [
{
model: db.Items,
required: false
}
]
}).then(function (dbItem) {
res.json(dbItem);
})
});
To help align everything and make the menu items responsive, we added the following Foundation CSS.
- 'grid-x': align all items in a row
- 'grid-margin-x': add a space along the x-axis
- 'small-up-2/medium-up-2/large-up-2": limit the number of menu items visible at various breakpoints.
<div class="tabs-panel is-active" data-menu-items="appetizers" id="menuAppetizers">
<div class="grid-x grid-margin-x small-up-2 medium-up-4 large-up-6" id="appetizerItem"></div>
<!-- Dynamically add Menu Items by category through jQuery-->
</div>
This project uses a MIT License.
If you would like to contribute, you will need to know Sequelize and Node.
To run tests run the following command:
NA
Created by Hudson Barnes, Pamela Gutierrez, Michael Medina, Muhammad A Khalid
If you have any questions you can reach us at the following:
Hudson Barnes | hudsonmbarnes@gmail.com | GitHub | |
Pamela Gutierrez | gtrz.pamela@gmail.com | GitHub | |
Michael Medina | michaelanthony.medinaa@gmail.com | GitHub | |
Muhammad A Khalid | akhalid.code@gmail.com | GitHub |