Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
71e0458
Start React
Insatsu Apr 21, 2024
d205343
Update README.md
rimiol Apr 23, 2024
343bf15
Showing HomePage on React
Insatsu Apr 24, 2024
2488a53
Update README.md
rimiol Apr 24, 2024
4e017a0
the first version of the authorization system has been added
JoskiyChel Apr 24, 2024
6926bf5
Extra test pages have been removed
JoskiyChel Apr 24, 2024
e4462c7
Merge remote-tracking branch 'origin/pythonApi'
JoskiyChel Apr 24, 2024
215aa07
Removed test styles
JoskiyChel Apr 24, 2024
7bda673
-Added a section for choosing flowers for sale
WhitePencil1 Apr 24, 2024
c6cf09c
Merge branch 'front'
WhitePencil1 Apr 24, 2024
fd35097
-Fixed the merge...
WhitePencil1 Apr 24, 2024
3beabb5
Take new front
Insatsu Apr 26, 2024
a237e82
Try to solve "can't resolve" problem
Insatsu Apr 26, 2024
192a7df
Make switch(of course it is test) between pages & add some TODO.
Insatsu Apr 26, 2024
deca290
test
Insatsu Apr 26, 2024
8e59c17
Merge branch 'Insatsu'. It works(at least on my PC)
Insatsu Apr 26, 2024
1f85791
solve some problem
Insatsu Apr 26, 2024
d3743e6
Added the multer middleware and uploaded a few images
rimiol Apr 27, 2024
ba4068e
fixed a little mistake
rimiol Apr 27, 2024
e8ee4cf
multer realisation has been removed
rimiol Apr 27, 2024
78a8c4f
Footer added
WhitePencil1 Apr 27, 2024
3cd1887
Merge branch 'main' of https://github.com/algorithm-ssau/Lycoris_
rimiol Apr 27, 2024
91b253e
take
Insatsu Apr 28, 2024
941c382
take
Insatsu Apr 28, 2024
73d597f
Added Purchase Page and some example images
WhitePencil1 Apr 29, 2024
71273af
- Completed purchase page;
WhitePencil1 Apr 29, 2024
bb98aa2
add footer to ShopItemsPage
Insatsu Apr 29, 2024
6d0d4bc
temp merge
Insatsu Apr 29, 2024
1b63e79
add purchase
Insatsu Apr 29, 2024
17e93b2
make docker for front & back but still not python. make connection wi…
Insatsu May 6, 2024
cba453e
added a readme and a list of required plugins
JoskiyChel May 9, 2024
b74ac3f
add axios in react & use it ; add CORS in express & use it; add pytho…
Insatsu May 9, 2024
f3b215d
- Added cart page;
WhitePencil1 May 11, 2024
1dc9409
temp_2
Insatsu May 12, 2024
c989e3c
add cart_page ; change pyApi
Insatsu May 12, 2024
0027132
Merged with Insatsu
Insatsu May 12, 2024
c35801e
Update README.md
Insatsu May 12, 2024
935f9e6
Add shoppingCarts
Timur-Sul May 20, 2024
6909c60
fix
Timur-Sul May 20, 2024
a739c83
docker works again; some update
Insatsu May 20, 2024
ab1e859
Replenishment of the database
Timur-Sul May 20, 2024
1ca3aca
api update
JoskiyChel May 20, 2024
2ecaeee
requirements update
JoskiyChel May 20, 2024
62729bb
deleted test flask pages
JoskiyChel May 20, 2024
dc66246
start make user&cart actions
Insatsu May 21, 2024
d871e4b
Add a shopping cart request by user
Timur-Sul May 21, 2024
42c7a59
Merge branch 'main' of https://github.com/algorithm-ssau/Lycoris_ int…
Timur-Sul May 21, 2024
a776f05
Add a request to add flowers to the cart
Timur-Sul May 21, 2024
3de1a87
Homepage translated
rimiol May 21, 2024
deb8b2f
Footer translated
rimiol May 21, 2024
179f79c
CartContent & FlowerItem translated
rimiol May 21, 2024
9398cfa
Merge pull request #7 from algorithm-ssau/Rimiol
rimiol May 21, 2024
81fb966
Merge branch 'main' into Insatsu
Insatsu May 22, 2024
c9b6aa9
- Added user registration (login) page;
WhitePencil1 May 23, 2024
20f0fd5
- Added a page for user registration;
WhitePencil1 May 24, 2024
44208a8
make cart
Insatsu May 24, 2024
3ef97bd
remove cache
Insatsu May 24, 2024
3bb3fae
make order add to db
Insatsu May 24, 2024
4be7c68
make profile
Insatsu May 25, 2024
614521c
start make login/reg
Insatsu May 25, 2024
361f154
- Added scaling of profile pictures;
WhitePencil1 May 25, 2024
3dad8d7
readme update (опять)
JoskiyChel May 25, 2024
aae424f
96% made. I'll leave the rest to you
Insatsu May 26, 2024
7d4f59f
Merge branch 'Insatsu'
Insatsu May 26, 2024
0019653
Fixed some bugs
WhitePencil1 Jun 3, 2024
0802317
readme, again
JoskiyChel Jun 3, 2024
9395e47
- Fixed some more bugs;
WhitePencil1 Jun 3, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
tt
tt.zip
.vscode
node_modules/
.front/
.front
28 changes: 19 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,31 @@
# 🏵 Lycoris_
# 🏵 Lycoris_ (http://146.255.188.240:3000/)
## 👁️‍🗨️ О проекте:
### Сайт - `Магазин цветов`
### Основные функции:
- ...
- ...
- Интерактивный пользовательский интерфейс
- Каталог цветов и добавление их в корзину
- Оформление заказа товара
- Личный кабинет пользователя
- Просмотр истории заказов
## 🔧 Технологии:
### 🌱 Backend
- Express
- Python (Flask)
- Node.JS
- MongoDB
- Python
### 🌷 Frontend
- JavaScript
- Node.JS
- ReactJS
- React
## 🔌 Инструкция запуска:
### Шаг 0.
- ~~Здесь будет интструкция~~
Для запуска необходим Docker, поэтому дальнейшие шаги предполагают его наличие на вашем устройстве.
### Шаги.
- Скачайте репозиторий с GitHub (с сайта zip-архив или же клонированием, но для последнего нужен установленный git);
- Перейдите в директорию проекта и откройте консоль;
- В консоли введите "docker compose up --build" и дождитесь запуска сервера;
- Откройте в браузере адрес http://localhost:3000/;
- Наслаждайтесь.

Для остановки сервера необходимо открыть консоль в этой же директории и ввести "docker compose down".
## 👥 Авторы:
``` json
{"firstName": "Pavel",
Expand All @@ -26,7 +36,7 @@
"prof": "Frontend"}
{"firstName": "Maksim",
"lastName": "Surkov",
"prof": "Backend"}
"prof": "FullStack"}
{"firstName": "Timur",
"lastName": "Suleymanov",
"prof": "Backend"}
Expand Down
9 changes: 9 additions & 0 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM mongo-express:1.0.2-20

WORKDIR /backend

COPY . .

EXPOSE 3001

# CMD ["npm", "start"]
32 changes: 32 additions & 0 deletions backend/controllers/flower-controller.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
const Flower = require('../models/flower');
const multer = require('multer');
const path = require('path');

const storage = multer.diskStorage({
destination: (_, __, cb) => {
cb(null, 'flowers');
},
filename: (req, file, cb) => {
cb(null, file.originalname);
},
});

const upload = multer({ storage });

const handleError = (res, error) => {
res.status(500).json({ error });
Expand Down Expand Up @@ -39,6 +52,11 @@ const getFlowers = (req, res) => {
};

const addFlower = (req, res) => {
/*const flowerData = req.body;
if (req.file) {
flowerData.image = '/flowers' + req.file.originalname;
}
const flower = new Flower(flowerData);*/
const flower = new Flower(req.body);
flower
.save()
Expand All @@ -51,6 +69,11 @@ const getFlowers = (req, res) => {
};

const updateFlower = (req, res) => {
/*const flowerData = req.body;
if (req.file) {
flowerData.image = '/flowers' + req.file.originalname;
}
const flower = new Flower(FlowerData);*/
Flower
.findByIdAndUpdate(req.params.id, req.body)
.then((result) => {
Expand All @@ -60,11 +83,20 @@ const getFlowers = (req, res) => {
})
.catch((err) => handleError(res, err));
};

/*not used yet
const uploadFlowerImage = (req, res) => {
res.json({
url: '/flowers' + req.file.originalname,
});
}
*/

module.exports = {
getFlowers,
getFlower,
deleteFlower,
addFlower,
updateFlower,
//uploadFlowerImage,
};
13 changes: 13 additions & 0 deletions backend/controllers/order-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,17 @@ const getOrders = (req, res) => {
})
.catch((err) => handleError(res, err));
};

const getOrderByUser = (req, res) => {
Order
.find({user: req.params.user})
.then((result) => {
res
.status(200)
.json(result);
})
.catch((err) => handleError(res, err));
};

const deleteOrder = (req, res) => {
Order
Expand Down Expand Up @@ -67,4 +78,6 @@ const getOrders = (req, res) => {
deleteOrder,
addOrder,
updateOrder,

getOrderByUser
};
105 changes: 105 additions & 0 deletions backend/controllers/shoppingCart-controller.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
const ShoppingCart = require('../models/shoppingCart');

const handleError = (res, error) => {
res.status(500).json({ error });
}

const getShoppingCarts = (req, res) => {
ShoppingCart
.find()
.sort({ title: 1 })
.then((result) => {
res
.status(200)
.json(result);
})
.catch((err) => handleError(res, err));
};

const getShoppingCart = (req, res) => {
ShoppingCart
.findById(req.params.id)
.then((result) => {
res
.status(200)
.json(result);
})
.catch((err) => handleError(res, err));
};

const deleteShoppingCart = (req, res) => {
ShoppingCart
.findByIdAndDelete(req.params.id)
.then((result) => {
res
.status(200)
.json(result);
})
.catch((err) => handleError(res, err));
};

const addShoppingCart = (req, res) => {
const shoppingCart = new ShoppingCart(req.body);
shoppingCart
.save()
.then((result) => {
res
.status(201)
.json(result);
})
.catch((err) => handleError(res, err));
};

const updateShoppingCart = (req, res) => {
ShoppingCart
.findByIdAndUpdate(req.params.id, req.body)
.then((result) => {
res
.status(200)
.json(result);
})
.catch((err) => handleError(res, err));
};

const getShoppingCartByUser = (req, res) => {
ShoppingCart
.find({user: req.params.user})
.then((result) => {
res
.status(200)
.json(result);
})
.catch((err) => handleError(res, err));
};

// const updateShoppingCartOfFlowers = (req, res) => {
// ShoppingCart
// .findById(req.params.id)
// .then((result) => {
// res
// .status(200)
// .json(result);
// })
// .catch((err) => handleError(res, err));
// };

const updateShoppingCartOfFlowers = (req, res) => {
ShoppingCart
.findByIdAndUpdate(req.params.id, { $push: req.body})
.then((result) => {
res
.status(200)
.json(result);
})
.catch((err) => handleError(res, err));
};

module.exports = {
getShoppingCarts,
getShoppingCart,
deleteShoppingCart,
addShoppingCart,
updateShoppingCart,
getShoppingCartByUser,
updateShoppingCartOfFlowers
};
2 changes: 0 additions & 2 deletions backend/models/flower.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ const flowerSchema = new Schema({
required: true
},
image: {
// The logic behind the image processing is up to you.
// I think you should store it in binary form and then unpack it as you see fit
type: Object
}
});
Expand Down
1 change: 1 addition & 0 deletions backend/models/order.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const Schema = mongoose.Schema;
const orderSchema = new Schema({
user: {
type: ObjectId,
ref: 'User',
required: true
},
address: {
Expand Down
17 changes: 17 additions & 0 deletions backend/models/shoppingCart.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
const { ObjectId } = require('mongodb');
const mongoose = require('mongoose');
const Schema = mongoose.Schema;

const shoppingCartSchema = new Schema({
user: {
type: ObjectId,
required: true
},
flowers: [{
flower: ObjectId,
count: Number
}]
});

const ShoppingCart = mongoose.model('ShoppingCart', shoppingCartSchema);
module.exports = ShoppingCart;
16 changes: 16 additions & 0 deletions backend/node_modules/.bin/mkdirp

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

17 changes: 17 additions & 0 deletions backend/node_modules/.bin/mkdirp.cmd

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

28 changes: 28 additions & 0 deletions backend/node_modules/.bin/mkdirp.ps1

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

Loading