Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
ee541db
Making first step in fetchData (facility/factory))
walkerman-on Mar 18, 2024
4afa25b
Finishing 90% of facility and factory fetching
walkerman-on Mar 18, 2024
731770e
Making normal path to facilities
walkerman-on Mar 19, 2024
814c4e2
Remaking some fetch functions
walkerman-on Mar 21, 2024
5b621eb
Making fresh design with scheme
walkerman-on Mar 21, 2024
b9ec801
Adding Cloud Firestore and delating json-server
walkerman-on Mar 24, 2024
1dc439b
Remaking paths with factoryKey
walkerman-on Mar 24, 2024
6389a38
Making Notification for Errors
walkerman-on Mar 25, 2024
419cad5
Remaking Sidebar icon
walkerman-on Mar 25, 2024
551a447
Adding facilitySchemes to Firestore Storage
walkerman-on Mar 26, 2024
9fc5622
Adding schemeURL to Firestore Storage and remaking display method of …
walkerman-on Mar 26, 2024
f679fec
Making searching in facilities and fixing some bugs
walkerman-on Mar 28, 2024
c4e3652
Remaking extraReducers, paths and delating redux-persist library
walkerman-on Mar 31, 2024
ae3147c
Remaking nav path
walkerman-on Mar 31, 2024
3ae20fb
Making steps in auth with lk.ktk.gubkin
walkerman-on Apr 2, 2024
7959692
Making first step in adding valves
walkerman-on Apr 2, 2024
35e9408
Fetching technological parameters from Firestore
walkerman-on Apr 3, 2024
8ed6ea9
Remaking some style to parametersMenu
walkerman-on Apr 3, 2024
886409c
Remaking sidebarScheme logic
walkerman-on Apr 3, 2024
b077839
Adding filter for valves by facility id
walkerman-on Apr 6, 2024
11dd24f
Trying to make inputs for parameters
walkerman-on Apr 9, 2024
edc77a2
Fixing some bugs
walkerman-on Apr 20, 2024
19dcaee
Remaking name in auth
walkerman-on Apr 20, 2024
4ff636b
Making fresh code and README.md
walkerman-on Jun 11, 2024
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
4 changes: 0 additions & 4 deletions .prettierignore

This file was deleted.

8 changes: 0 additions & 8 deletions .prettierrc

This file was deleted.

69 changes: 69 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
## Демо

---

## Запуск проекта

Прежде чем запускать проект, необходимо создать файл `.env` в корневой директории проекта. В этом файле укажите следующую конфигурацию для подключения к Firebase:

```.env
FIREBASE_API_KEY = "apiKey"
FIREBASE_API_AUTH_DOMAIN = "authDomain"
FIREBASE_API_PROJECT_ID = "projectId"
FIREBASE_API_STORAGE_BUCKET = "storageBucket"
FIREBASE_API_MESSAGING_SENDER_ID = "messagingSenderId"
FIREBASE_API_APP_ID = "appId"
```

Замените "apiKey", "authDomain", "projectId", "storageBucket", "messagingSenderId", и "appId" соответственно вашими значениями, полученными от Firebase.

Эти параметры необходимы для правильной идентификации вашего проекта Firebase и его подключения к приложению.

Ссылка на документацию - [Add Firebase to your JavaScript project](https://firebase.google.com/docs/web/setup)

```
npm install - устанавливаем зависимости
npm start - запуск UI

```

---

## Скрипты

- `npm run start` - Запуск frontend проекта на webpack dev server
- `npm run build:prod` - Сборка в prod режиме
- `npm run build:dev` - Сборка в dev режиме (не минимизирован)

---

## Архитектура проекта

Проект написан в соответствии с методологией Feature Sliced Design

Ссылка на документацию - [Feature Sliced Design](https://feature-sliced.design/docs/get-started/tutorial)

---

## Конфигурация проекта

Для разработки проект содержит Webpack конфиг

Вся конфигурация хранится в ./config

---

### Работа с данными

Взаимодействие с данными осуществляется с помощью Redux Toolkit

В качестве авторизации используется сервис Firebase Authentication
Ссылка на документацию - [Firebase Authentication](https://firebase.google.com/docs/auth)

В качестве базы данных предприятий / установок используется сервис Firebase Realtime Database
Ссылка на документацию - [Firebase Realtime Database](https://firebase.google.com/docs/database)

В качестве базы данных статичных файлов используется сервис Cloud Storage for Firebase
Ссылка на документацию - [Cloud Storage for Firebase](https://firebase.google.com/docs/storage)

---
82 changes: 75 additions & 7 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
"scripts": {
"start": "webpack serve --env port=3000",
"build:prod": "webpack --env mode=production",
"build:dev": "webpack --env mode=development",
"prettier": "npx prettier --write **/*.{ts,tsx}"
"build:dev": "webpack --env mode=development"
},
"keywords": [],
"author": "",
Expand Down Expand Up @@ -41,6 +40,7 @@
"@ant-design/icons": "^5.2.6",
"@reduxjs/toolkit": "^1.8.0",
"antd": "^5.10.0",
"axios": "^1.6.8",
"firebase": "^10.6.0",
"react": "^17.0.2",
"react-dom": "^17.0.2",
Expand Down
3 changes: 0 additions & 3 deletions src/app/App.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { Message } from 'shared/ui/Message';
import { routeConfig } from './providers/router/routeConfig/appRouteConfig';
import './styles/index.scss';
import { AppRouter } from 'app/providers/router';
Expand All @@ -7,8 +6,6 @@ const App = () => {
return (
<>
{AppRouter(routeConfig)}
{/* тут будет Notification */}
<Message content="" />
</>
);
};
Expand Down
12 changes: 10 additions & 2 deletions src/app/providers/StoreProvider/config/store.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
import { configureStore } from '@reduxjs/toolkit';
import { configureStore, combineReducers } from '@reduxjs/toolkit';
import { userReducer } from 'entities/Auth/index';
import {factoryReducer} from "entities/Factory/index"
import { facilityReducer } from 'entities/Facility';
import { parameterReducer } from 'entities/TechnologicalParameters';
import {valveReducer} from 'entities/Valve';

export const store = configureStore({
reducer: {
user: userReducer,
factory: factoryReducer,
facility: facilityReducer,
parameter: parameterReducer,
valve: valveReducer,
},
});
});
6 changes: 3 additions & 3 deletions src/app/providers/StoreProvider/config/types.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { UserSchema } from 'entities/Auth';
import { UserState } from 'entities/Auth';
import { store } from './store';

export type AppDispatch = typeof store.dispatch;
export type RootState = ReturnType<typeof store.getState>;

export interface StateSchema {
user: UserSchema;
export interface IUserState {
user: UserState;
}
9 changes: 8 additions & 1 deletion src/app/providers/router/routeConfig/appRouteConfig.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ import { Page } from 'widgets/Page/ui/Page';
import { AppRoutesProps } from './types';
import { getLogin, getNotFound, getRegister } from './routes';
import { getMain } from 'app/providers/router/routeConfig/routes';
import { AccountPage } from 'pages/AccountPage';

export enum AppRoutes {
LOGIN = 'login',
REGISTER = 'register',
ACCOUNT = 'account',
MAIN = 'main',
SCADA = 'scada',
NOT_FOUND = 'not_found',
Expand All @@ -18,9 +20,10 @@ export enum AppRoutes {
export const RoutePath: Record<AppRoutes, string> = {
[AppRoutes.LOGIN]: getLogin(),
[AppRoutes.REGISTER]: getRegister(),
[AppRoutes.SCADA]: 'scada/*',
[AppRoutes.SCADA]: '/*',
[AppRoutes.MAIN]: getMain(),
[AppRoutes.NOT_FOUND]: getNotFound(),
[AppRoutes.ACCOUNT]: 'account/user/:userId',
};

export const routeConfig: Record<AppRoutes, AppRoutesProps> = {
Expand All @@ -46,4 +49,8 @@ export const routeConfig: Record<AppRoutes, AppRoutesProps> = {
path: RoutePath.not_found,
element: <NotFoundPage />,
},
[AppRoutes.ACCOUNT]: {
path: RoutePath.account,
element: <AccountPage />,
},
};
23 changes: 12 additions & 11 deletions src/app/providers/router/routeConfig/pageRouteConfig.tsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
import { AccountPage } from 'pages/AccountPage';
import { InfographicsPage } from 'pages/InfographicsPage';
import { NotFoundPage } from 'pages/NotFoundPage';
import { ObjectPage } from 'pages/ObjectPage';
import { FacilityPage } from 'pages/FacilityPage';
import { TestPage } from 'pages/TestPage';
import { AppRoutesProps } from './types';
import { getMain, getNotFound } from 'app/providers/router/routeConfig/routes';


export enum AppRoutes {
INFOGRAPHICS = 'infographics',
ACCOUNT = 'account',
OBJECT = 'object',
TEST = 'test',
FACILITY = 'facility',
TEST = 'description',
MAIN = 'main',
NOT_FOUND = 'not_found',
}

export const RoutePath: Record<AppRoutes, string> = {
[AppRoutes.INFOGRAPHICS]: 'infographics',
[AppRoutes.ACCOUNT]: 'account',
[AppRoutes.OBJECT]: 'object/:id',
[AppRoutes.TEST]: 'test',
[AppRoutes.INFOGRAPHICS]: '/:factoryKey/facility/:facilityId/infographics',
[AppRoutes.ACCOUNT]: 'account/user/:userId',
[AppRoutes.FACILITY]: '/:factoryKey/facility/:facilityId',
[AppRoutes.TEST]: '/:factoryKey/facility/:facilityId/description',
[AppRoutes.MAIN]: getMain(),
[AppRoutes.NOT_FOUND]: getNotFound(),
};
Expand All @@ -33,12 +34,12 @@ export const routeConfig: Record<AppRoutes, AppRoutesProps> = {
path: RoutePath.infographics,
element: <InfographicsPage />,
},
[AppRoutes.OBJECT]: {
path: RoutePath.object,
element: <ObjectPage />,
[AppRoutes.FACILITY]: {
path: RoutePath.facility,
element: <FacilityPage />,
},
[AppRoutes.TEST]: {
path: RoutePath.test,
path: RoutePath.description,
element: <TestPage />,
},
[AppRoutes.MAIN]: {
Expand Down
Loading