Overview
Sistema Venta frontend is built with Angular 14 and Angular Material 14.2.7, providing a modern, responsive sales management interface. This guide covers environment configuration, Material Design setup, and service configuration.Prerequisites
Before configuring the application, ensure you have:- Node.js (v14 or higher)
- npm (v6 or higher)
- Angular CLI 14.2.4
The application uses TypeScript 4.7.2 with strict mode enabled for enhanced type safety.
Project Structure
The application follows Angular best practices with a modular architecture:Environment Configuration
Development Environment
Configure the development environment in
src/environments/environment.ts:src/environments/environment.ts
Update the
endpoint value to match your backend API URL. The default is an empty string.Production Environment
Configure the production environment in During production builds, Angular automatically replaces
src/environments/environment.prod.ts:src/environments/environment.prod.ts
environment.ts with environment.prod.ts.Angular Material Configuration
Installed Material Modules
The application uses a comprehensive set of Angular Material components configured inshared.module.ts:
Material Theme
The application uses the pre-built Indigo-Pink theme:angular.json
You can customize the theme by creating a custom theme file. See Angular Material Theming Guide for details.
Routing Configuration
Application Routes
The application uses lazy loading for the main layout module:src/app/app-routing.module.ts
Layout Routes
Authenticated pages are nested under the layout component:src/app/Components/layout/layout-routing.module.ts
Service Configuration
API Services
All services follow a consistent pattern using HttpClient and environment configuration:Available Services
The application includes the following service files:| Service | Purpose | API Endpoint |
|---|---|---|
usuario.service.ts | User management and authentication | /Usuario/ |
producto.service.ts | Product catalog management | /Producto/ |
venta.service.ts | Sales transaction processing | /Venta/ |
categoria.service.ts | Product category management | /Categoria/ |
rol.service.ts | User role management | /Rol/ |
menu.service.ts | Navigation menu data | /Menu/ |
dash-board.service.ts | Dashboard analytics | /DashBoard/ |
TypeScript Configuration
The application uses strict TypeScript settings:Additional Libraries
Key Dependencies
- UI & Charts
- Data Handling
- Chart.js (^3.9.1): For dashboard visualizations
- SweetAlert2 (^11.6.16): Enhanced alert dialogs
- Angular Material (^14.2.7): Material Design components
Next Steps
Development
Learn how to run the development server and work with the codebase
Deployment
Deploy your application to production environments