Update Front-End after CI/CD

This commit is contained in:
2025-08-28 23:45:33 +03:00
parent c477143b30
commit 95a344a7a6

View File

@@ -1,104 +1,108 @@
# SGE System Frontend # SGE System Frontend
## Overview ## Overview
The frontend of the SGE System is a modern web application built with **React**, providing an interactive and user-friendly interface. It communicates with the backend API to deliver a seamless experience for users. The frontend of the SGE System is a modern web application built with **React**, providing an interactive and user-friendly interface. It communicates with the backend API to deliver a seamless experience for users.
## Technology Stack ## Technology Stack
- **React** UI library - **React** UI library
- **React Router** Routing - **React Router** Routing
- **i18n** Internationalization - **i18n** Internationalization
- **Docker** Containerization - **Docker** Containerization
## Repository Structure ## Repository Structure
``` ```
SGE/ SGE/
├── sge-backend/ # Backend source code ├── sge-backend/ # Backend source code
├── sge-frontend/ # Frontend source code ├── sge-frontend/ # Frontend source code
├── config.conf # Centralized configuration file (see below) ├── config.conf # Centralized configuration file (see below)
├── docker-compose.yml # Docker Compose file (see below) ├── docker-compose.yml # Docker Compose file (see below)
``` ```
## Setup and Installation ## Setup and Installation
### Prerequisites ### Prerequisites
- **Node.js** (v14.0.0 required) and npm - **Node.js** (v14.0.0 required) and npm
- **Docker** (for containerized deployment) - **Docker** (for containerized deployment)
#### Node.js Version Management #### Node.js Version Management
If you need to switch Node versions, use nvm: If you need to switch Node versions, use nvm:
```sh ```sh
nvm install v14.0.0 nvm install v14.0.0
nvm use v14.0.0 nvm use v14.0.0
unset NODE_OPTIONS unset NODE_OPTIONS
``` ```
### Frontend Setup ### Frontend Setup
#### Local Development #### Local Development
1. Clone the repository and navigate to the frontend directory: 1. Clone the repository and navigate to the frontend directory:
```sh ```sh
git clone <repository-url> git clone <repository-url>
cd SGE/sge-frontend cd SGE/sge-frontend
``` ```
2. Ensure `config.conf` is in the project root (`SGE/`). 2. Ensure `config.conf` is in the project root (`SGE/`).
You can either: You can either:
- Manually set environment variables from `config.conf` - Manually set environment variables from `config.conf`
- Or configure your IDE to load variables from `config.conf` - Or configure your IDE to load variables from `config.conf`
3. Install dependencies: 3. Install dependencies:
```sh ```sh
npm install npm install
``` ```
4. Start the development server: 4. Start the development server:
```sh ```sh
npm start npm start
``` ```
#### Docker Deployment #### Docker Deployment
1. Ensure both `config.conf` and `docker-compose.yml` are in the project root (`SGE/`). 1. Ensure both `config.conf` and `docker-compose.yml` are in the project root (`SGE/`).
2. From the root directory, build and run the frontend (and backend) using Docker: 2. From the root directory, build and run the frontend (and backend) using Docker:
```sh ```sh
docker-compose up --build docker-compose up --build
``` ```
## Configuration Management ## Configuration Management
The SGE System uses a centralized `config.conf` file for all environment variables. The SGE System uses a centralized `config.conf` file for all environment variables.
**Location:** Place `config.conf` in the root directory of your project, alongside `docker-compose.yml`. **Location:** Place `config.conf` in the root directory of your project, alongside `docker-compose.yml`.
This file contains environment variables for both backend and frontend components, including: This file contains environment variables for both backend and frontend components, including:
- API connection settings - API connection settings
- Mail configuration - Mail configuration
- Application URLs - Application URLs
When running with Docker, environment variables are automatically loaded from `config.conf` via the `env_file` directive in `docker-compose.yml`. When running with Docker, environment variables are automatically loaded from `config.conf` via the `env_file` directive in `docker-compose.yml`.
For local development, you can either: For local development, you can either:
- Use the same `config.conf` file and manually set the environment variables - Use the same `config.conf` file and manually set the environment variables
- Configure your IDE to load these variables from the file - Configure your IDE to load these variables from the file
Refer to the backend README for more details on configuration options and structure. Refer to the backend README for more details on configuration options and structure.
## Integration with Backend ## Integration with Backend
The frontend expects the backend API to be available at the host and port specified in `config.conf` (`API_PROTOCOL`, `API_HOST`, `SERVER_PORT`). The frontend expects the backend API to be available at the host and port specified in `config.conf` (`API_PROTOCOL`, `API_HOST`, `SERVER_PORT`).
Ensure both services are configured consistently. Ensure both services are configured consistently.
## License ## License
[Insert your license information here] [Insert your license information here]
## CI/CD Testing v1