Skip to content

Commit

Permalink
Sprint1
Browse files Browse the repository at this point in the history
  • Loading branch information
beulitca committed Dec 11, 2024
1 parent f0abcce commit 38889d0
Show file tree
Hide file tree
Showing 124 changed files with 31,153 additions and 0 deletions.
172 changes: 172 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
Задание 1
===========


Описание структуры исходного кода
------------------------
1.BackEnd
1.1 scripts настройка переменных окружения
1.2 src - код проекта
1.2.1 controllers реализация обработчиков запросов к API
- cards, api:
-CRUD Cards- -Likes-
getCards, dislikeCard
createCard, likeCard
deleteCard,
- users
-CRUD Users- -Profole- -Auth-
getUsers updateUserInfo login
getUser updateUserAvatar
getCurrentUser
createUser
1.2.2 errors - справочник кода и текста ошибок
1.2.3 middlewares - универсальные алгоритмы
1.2.4 models - структура интерфейса
- card - структура интерфейса карточки в режиме добавления
- user - структура интерфейса профиля в режиме редактирования
1.2.5 routs - сигнатура методов API, роутинг
- cards, api:
-CRUD Cards- -Likes-
getCards, dislikeCard
createCard, likeCard
deleteCard,
- users
-CRUD Users- -Profole- -Auth-
getUsers updateUserInfo login
getUser updateUserAvatar
getCurrentUser
createUser
- index.ts - список всех url api
- /signup
- /signin - /signin - ввод логина пароля, регистрация (POST, OPTIONS)
- /middlewares -
- /auth
- /users - /users/me - редактирование профиля (PATCH, OPTIONS)
- /users/me/avatar - редактирование аватора (PATCH, OPTIONS)
- /cards - создание (OPTIONS,POST,GET)
- /cards/like/ - постановка лайков (PUT, OpTIONS)
- /cards/like/ - снятие лайков (DELETE, OpTIONS)
2.Frontend
2.1 Public
2.1.1 index.html
2.1.2 manifest.json
2.2 src - код проекта фронта
2.2.1 blocks - папки со стилями
2.2.2 components - код интерфейсов фронта
- AddPlacePopup.js - popup добавления места
- App.js - код главной страницы
-- api.js (GET /cards;)
-- api.js (GET /users/me)
-- auth.js (GET users.me)
-- api.js (PATCH /usrs/me) - обновление профиля
-- api.js (PATCH /users/me/avatar) - обновление аватора
-- api.js (PUT /cards/like/${cardID}) - постановка лайка
-- api.js (DELETE /cards/${cardID}) - удаление карточки
-- api.js (POST /cards) - добавление карточки
-- auth.js (POST /signup) - авторизация
-- auth.js (POST /signin) - регистрация
- Card.js - код отображения карточки
- Register.js - окно регистрации
- EditProfilePopup.js - редактирование профиля
- EditAvatarPopup.js - окно редактирования картинки
- Register.js - поля ввода учетных данных
- Main.js, Footer.js, Header.js, ImagePopup.js, InfoTooltip.js, PopupWithForm.js, ProtectedRoute.js - главная страница
2.2.3 context
2.2.4 images
2.2.4 utils - интеграция с back-ом
2.2.5 vendor
2.2.6 index.css, index.js - точка входа в приложение
2.2.7 serviceWorker.js - вероятно, слушатель запросов
2.2.8 setupTests.js, index.spec.js - файлы для тестирования
2.3 package.json - список зависимостей приложения


Разбиение на микрофронтенды, структура директорий
-------------------------------------------------
Обоснование: выделены микрофронтенды:
- auth (авторизация, регистрация)
- cards(CRUD картинок)
- profile(просмотр/редактирование профиля и аватора).
- host(фронтовая интеграция микрофронтендов)

Микрофронтенды интегрируются на базе module federation. Фреймворк выбран как наиболее простой в реализации (т к есть пример в материалах), а также не противорячащий цели задания - объединяет части сайта на базе единого технологического стека.

Структура директорий:
frontend/microfrontend
|--|auth
|----|src
|------|blocks
|--------|auth-form
|--------|login
|------|components
|--------|AuthTestControl.js
|--------|InfoTooltip.js
|--------|Login.js
|--------|Register.js
|------|images
|--------|error-icon.svg
|--------|success-icon.svg
|------|utils
|---------|auth.js
|--|cards
|----|src
|------|blocks
|--------|card
|--------|places
|--------|popup
|------|components
|--------|AddPlacePopup.js
|--------|Card.js
|--------|CardsTestControl.js
|--------|ImagePopup.js
|------|contexts
|--------|CurrentUserContext.js
|------|images
|--------|close.svg
|--------|delete-icon.svg
|--------|like-active.svg
|--------|like-inactive.svg
|------|utils
|---------|app.js
|--|host
|----|src
|------|blocks
|--------|footer
|--------|header
|--------|page
|--------|content
|------|components
|--------|App.js
|--------|Footer.js
|--------|Header.js
|--------|Main.js
|--------|ProtectedRoute.js
|------|contexts
|--------|CurrentUserContext.js
|------|images
|--------|logo.svg
|--|profile
|------|blocks
|--------|profile
|------|components
|--------|EditAvatarPopup.js
|--------|EditProfilePopup.js
|--------|PopupWithForm.js
|--------|ProfileTestControl.js
|------|contexts
|--------|CurrentUserContext.js
|------|images
|--------|add-icon.svg
|--------|close.svg
|--------|edit-icon.svg
|------|utils
|---------|app.js

Задание 2
===========
architecture-sprint-1\Task2\arch_template_task2.jpg





Binary file added Task2/arch_template_task2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions frontend/microfrontend/auth/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"presets": [
["@babel/preset-react", { "runtime": "automatic" }],
"@babel/preset-env"
],
"plugins": [["@babel/transform-runtime"]]
}
116 changes: 116 additions & 0 deletions frontend/microfrontend/auth/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.test

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next
out

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
31 changes: 31 additions & 0 deletions frontend/microfrontend/auth/compilation.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
const printCompilationMessage = (status, port) => {
let messageColor, messageType, browserMessage;

switch (status) {
case "success":
messageColor = "\x1b[32m";
messageType = "Compiled successfully!";
browserMessage = "You can now view";
break;
case "failure":
messageColor = "\x1b[31m";
messageType = "Compilation Failed!";
browserMessage = "You can't now view";
break;
case "compiling":
messageColor = "\x1b[94m";
messageType = "Compiling...";
browserMessage = "Compiling the";
break;
}

console.log(`\n\n
${messageColor}${messageType}\x1b[0m\n
${browserMessage} \x1b[1mRemote\x1b[0m in the browser.
${messageColor}${messageType}\x1b[0m\n
\x1b[1mLocal\x1b[0m: http://localhost:\x1b[1m${port}\x1b[0m
\x1b[1mLocal\x1b[0m: http://localhost:\x1b[1m${port}\x1b[0m\n\n
`);
};

module.exports = printCompilationMessage;
Loading

0 comments on commit 38889d0

Please sign in to comment.