Skip to content

TomiNavel/RetailCloudPOS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RetailCloudPOS (RCP)

.NET ASP.NET Core WPF Kotlin MySQL Docker License

Comprehensive Point of Sale system for small retail businesses with cloud synchronization capabilities.

Overview

RetailCloudPOS is an integrated management system designed to optimize operations for small retail businesses, with specialized features for hospitality. The solution consists of a desktop POS application, a REST API hosted on a server, a MySQL database, and an Android mobile application for remote monitoring.

Architecture

The system is composed of four main components:

┌─────────────────┐         ┌─────────────────┐
│  Desktop App    │         │   Mobile App    │
│  (WPF - .NET)   │         │  (Kotlin/MVVM)  │
└────────┬────────┘         └────────┬────────┘
         │                           │
         │   HTTP/JWT Auth           │
         └──────────┬────────────────┘
                    │
                    ▼
         ┌──────────────────────┐
         │   REST API           │◄───── Port 5000
         │   (ASP.NET Core 8)   │
         └──────────┬───────────┘
                    │
                    │ Entity Framework
                    ▼
         ┌──────────────────────┐
         │   MySQL Database     │◄───── Port 3306
         │   (Docker Container) │
         └──────────────────────┘

Component Details:

  • Desktop Application: Windows POS client for sales operations, inventory management, and cash register control. Connects to the API via HTTP.
  • Mobile Application: Android app for remote monitoring of sales, cash closures, and user activity. Read-only access to data.
  • REST API: Centralized backend service providing authentication, business logic, and data access. Containerized with Docker.
  • MySQL Database: Persistent storage for all system data. Runs in a Docker container alongside the API.

Deployment Model:

  • API + Database run in Docker containers (easily deployable to any server/VPS)
  • Desktop and Mobile apps are standalone clients that connect to the API endpoint
  • All communication is secured with JWT authentication

Features

  • Sales Processing: Complete point of sale interface with product catalog management
  • Inventory Management: Real-time stock control and product categorization
  • Hospitality Mode: Table assignment and management for restaurants and bars
  • Cash Register Operations: Cash drawer opening, closing, and movement tracking
  • Multiple Payment Methods: Support for various payment types per transaction
  • User Management: Role-based access control with activity logging
  • Mobile Monitoring: Remote access to sales data, cash closures, and user activity via Android app
  • Cloud Synchronization: Real-time data sync between desktop app and cloud database
  • Security: JWT authentication, rate limiting, and encrypted connections

Technology Stack

Desktop Application (TPV)

  • Framework: .NET 8.0 with WPF
  • Architecture: MVVM pattern with custom event aggregator
  • Authentication: JWT bearer token
  • PDF Generation: PDFsharp for receipt printing

REST API

  • Framework: ASP.NET Core 8.0
  • Authentication: JWT with ASP.NET Core Identity
  • Database: Entity Framework Core with Pomelo MySQL provider
  • Security: AspNetCoreRateLimit, global authorization policies
  • Logging: Serilog with console and rotating file sinks
  • Documentation: Swagger/OpenAPI

Mobile Application

  • Language: Kotlin
  • Architecture: MVVM with Jetpack Compose
  • UI: Material Design 3

Database

  • Engine: MySQL 8.0
  • Deployment: Docker container or VPS hosting

Getting Started

Prerequisites

  • .NET 8.0 SDK
  • MySQL 8.0 or Docker
  • (Optional) Android Studio for mobile app development

API Setup (Local Development)

  1. Navigate to the API directory:
cd RCP_api/RCP_api
  1. Create appsettings.Development.json for local configuration:
{
  "ConnectionStrings": {
    "DefaultConnection": "Server=localhost;Database=RCP;User=root;Password=yourpassword;"
  },
  "Jwt": {
    "Key": "YourSecureKeyHere_AtLeast32CharactersLong",
    "Issuer": "RCP_api",
    "Audience": "RCP_api"
  }
}
  1. Run the API:
dotnet run

The API will start on http://localhost:5000

Note: appsettings.Development.json is in .gitignore and won't be committed to the repository.

Database Setup

  1. Import the database schema:
mysql -u root -p < database/RCP.sql
  1. (Optional) Import test data:
mysql -u root -p < database/RCP_datos.sql

Desktop Application Setup

  1. Navigate to the desktop app directory:
cd RCP_desktop
  1. Build and run:
dotnet build RCP.sln
dotnet run --project RCP
  1. Configure API endpoint in the application settings.

Docker Deployment

The API and database can be deployed using Docker Compose for easy setup and portability.

  1. Navigate to the API directory:
cd RCP_api/RCP_api
  1. Copy the environment template and configure your credentials:
cp .env.example .env

Edit .env file with your database credentials:

  1. Start the containers:
docker-compose up -d

This will create two containers:

  • RCP-api: ASP.NET Core API on port 5000
  • RCP-db: MySQL 8.0 database on port 3306
  1. Import database schema and initial data:

Once the containers are running, import the SQL scripts to create the database structure and initial data:

# Import database schema
docker exec -i RCP-db mysql -uroot -p<YOUR_MYSQL_ROOT_PASSWORD> RCP < database/RCP.sql

# Import initial data (categories, test users, etc.)
docker exec -i RCP-db mysql -uroot -p<YOUR_MYSQL_ROOT_PASSWORD> RCP < database/RCP_datos.sql
  1. Restart the API container:
docker restart RCP-api

The API will be accessible at http://localhost:5000 and Swagger UI at http://localhost:5000/swagger.

Default Credentials

Important: Change these credentials in production environments.

  • Username: admin
  • Password: admin123

API Endpoints

The API provides the following resource endpoints:

  • /api/Autenticacion - User authentication and JWT generation
  • /api/Usuarios - User management
  • /api/Articulos - Product catalog
  • /api/Categorias - Product categories
  • /api/Subcategorias - Product subcategories
  • /api/Ventas - Sales transactions
  • /api/DetalleTickets - Sale line items
  • /api/Cajas - Cash register operations
  • /api/MovimientosCaja - Cash movements
  • /api/FormasPago - Payment methods
  • /api/AccesosUsuarios - User access logs
  • /api/Configuracion - System configuration

Full API documentation available via Swagger at /swagger when running in development mode.

Security Features

  • JWT Authentication: Secure token-based authentication
  • Rate Limiting: 100 requests/minute general, 10 requests/minute for authentication
  • Password Policy: Configurable password requirements via ASP.NET Core Identity
  • Activity Logging: Complete audit trail of user actions
  • CORS Configuration: Configurable cross-origin resource sharing

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contributing

Contributions are welcome! Please feel free to submit issues and pull requests.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors