qatu-client
v1.0.11
Published
Qatu Client is a pure frontend project developed in JavaScript. This repository contains the code and documentation needed to install, configure, and develop the application. Built on an MVVM (Model-View-ViewModel) architecture, it uses Webpack for bundli
Readme
Qatu Client
Qatu Client is a pure frontend project developed in JavaScript. This repository contains the code and documentation needed to install, configure, and develop the application. Built on an MVVM (Model-View-ViewModel) architecture, it uses Webpack for bundling, Jest for unit testing, and ESLint for linting, ensuring code quality and consistency.
Table of Contents
- Overview
- Key Features
- Technologies Used
- Project Architecture
- Prerequisites
- Installation Guide
- Environment Variable Configuration
- Available Commands
- Detailed Project Structure
- Development Guide
- Production Build
- Testing and Code Coverage
- Code Style and Linting
- Continuous Integration and Deployment (CI/CD)
- Code Conventions and Structure
- Best Development Practices
- Version Control Strategy
- Contribution Process
- Support, Documentation, and Additional Resources
- Development Team
Overview
Qatu Client is a frontend application developed in JavaScript, following an MVVM architecture. With a focus on modularity and scalability, the project is designed to be highly configurable while maintaining clear separation of responsibilities. The application is ideal for production environments, integrating seamlessly with a backend for data management.
Key Features
- Modular MVVM Architecture: Separation of responsibilities in Model, View, and ViewModel layers.
- Responsive Design: Adaptive layout for various devices and resolutions.
- Unit Testing with Jest: Code coverage to ensure functionality.
- Resource Optimization: Lazy loading, minimization, and resource caching.
- GitLab CI/CD: Automated pipeline for continuous integration and deployment.
Technologies Used
This project leverages modern, production-ready technologies:
- JavaScript ES6+: The base language of the application.
- Webpack: For bundling and module optimization.
- Babel: Transpiles ES6+ code for compatibility with older browsers.
- ESLint: Ensures code consistency and quality.
- Jest: Framework for unit testing and code coverage.
- Pino: Logging library configured in
src/constants/logger/loggerConfig.js.
MVVM Structure in the Project
The MVVM architecture divides the project into distinct layers:
- Model: Located in
src/models/, encapsulates business logic and data operations. - ViewModel: Located in
src/viewmodels/, contains presentation logic and data binding between the view and model. - View: The user interface in
src/views/, divided intocomponents/andpages/to organize reusable components and main views.

Project Architecture
The project follows a modular MVVM architecture to facilitate development and maintenance:
qatu-client/
├── src/
│ ├── assets/
│ │ ├── images/
│ │ └── styles/
│ ├── constants/
│ │ ├── config.js
│ │ └── logger/
│ ├── models/
│ │ └── services/
│ ├── utils/
│ │ ├── helpers.js
│ │ └── logger.js
│ ├── viewmodels/
│ ├── views/
│ │ ├── components/
│ │ └── pages/
│ ├── index.html
│ └── main.js
├── tests/
│ └── integration/
├── webpack.config.js
├── jest.config.js
├── .eslintrc.js
└── package.jsonsrc/: Main source code.assets/: Static assets, including images and styles.constants/: Application constants and configurations.models/: Business logic and services.utils/: Utility functions.viewmodels/: Presentation logic.views/: UI components and pages.tests/: Unit and integration tests.
Prerequisites
Required Tools
- Node.js (recommended version: 16.x or higher).
- npm (Node's package manager).
To verify Node.js and npm installation:
node -v
npm -vInstallation Guide
Clone the repository:
git clone [email protected]:jala-university1/cohort-1/oficial-es-desarrollo-de-software-4-iso-223.ga.t2.24.m2/secci-n-a/bugs-bunnys/qatu-client.git cd qatu-clientInstall dependencies:
npm install
Environment Variable Configuration
Configure environment variables in the .env file at the project root to customize endpoints and other settings:
REACT_APP_API_URL=https://api.qatu.local
REACT_APP_ENVIRONMENT=developmentAvailable Commands
Development and Production Commands
npm start: Starts the development server.npm run build: Builds the application for production in thedist/directory.npm test: Runs tests with Jest.npm run test:integration: Runs integration tests.npm run test:coverage: Generates a coverage report.npm run lint: Checks code style with ESLint.npm run lint:fix: Automatically fixes code style issues.
Development Guide
To start the development server with live reloading:
npm startDocker Setup
1. Build the Containers and Start the Application
docker-compose up -d build
2. Check the Status of Containers
docker-compose ps
3. Stop the Application
docker-compose down -v
Production Build
To compile the project in production mode:
npm run buildThe generated files in dist/ are ready for deployment.
Testing and Code Coverage
Use Jest for testing and code coverage:
Run tests:
npm testGenerate coverage:
npm run test:coverage
Code Style and Linting
Ensure consistency across the codebase with ESLint:
npm run lintTo automatically fix errors:
npm run lint:fixContinuous Integration and Deployment (CI/CD)
The .gitlab-ci.yml file automates integration and deployment on GitLab, performing:
- Unit Testing
- Code Style Verification
- Automatic Deployment
Code Conventions and Structure
- Branch Format:
feature/feature-name,fix/fix-name. - Commit Messages: Use
type(scope): description(e.g.,feat(ui): add search component).
Best Development Practices
- Clear Commit Messages: Descriptive messages for each change.
- Use Feature Branches: Create branches for each major change.
- Modular Code: Keep business logic separate from UI.
- Document Components: Provide in-code documentation for components.
DockerFile Frontend:
- Creates a new Docker image from the Dockerfile in the current directory, labeling it image-frontend-qatu with version 20.18.0.
sudo docker build -t image-frontend-qatu:20.18.0 .- Starts a new container based on the image image-frontend-qatu:20.18.0. The container is named frontend-container and runs in the background (-d), mapping port 3000 of the container to port 3000 of the host machine so that the application is accessible from http://localhost:3000.
sudo docker run --name frontend-container -p 3000:3000 -d image-frontend-qatu:20.18.0Enter the following link from your browser and you will have the Qatu page available to you: http://localhost:3000.
If you want to stop the container use:
sudo docker stop frontend-containerVersion Control Strategy
Semantic Versioning: (x.y.z):
- x: Major breaking changes.
- y: New features.
- z: Bug fixes.
Contribution Process
- Create a fork.
- Create a new branch.
- Make commits with descriptive messages.
- Push your branch and open a Pull Request.
Development Team
Mayra Ayaviri Muñoz
GitLab: Mayra AyaviriJuan Sebastián Lamouroux
GitLab: Juan LamourouxDaleth Vásquez Montano
GitLab: Daleth VasquezEver Mamani Vicente
GitLab: Ever Mamani VRodrigo Machaca
GitLab: Rodrigo Machaca
