Overview
This API provides a complete backend solution for managing electronic products, user accounts, and publishing products to WooCommerce stores. Built with modern technologies and security best practices, it offers a reliable foundation for e-commerce operations.JWT Authentication
Secure authentication using JSON Web Tokens with 1-hour token expiration
MySQL Database
Reliable data persistence with MySQL connection pooling for optimal performance
WooCommerce Integration
Direct integration with WooCommerce REST API for product publishing
User Management
Complete user management with bcrypt password hashing and role-based access
Architecture
The API follows a modular architecture with clear separation of concerns:- Server Layer (
server.js) - Express application setup with middleware configuration - Routes Layer (
routes/setup/routes_setup.js) - Route definitions and JWT middleware - Controller Layer (
routes/setup/servicios/cliente.js) - Business logic and database operations - Database Layer (
routes/setup/dbconn/dbconn.js) - MySQL connection pooling and query management
Technology Stack
Core Framework
- Express.js 4.17.1 - Fast, unopinionated web framework for Node.js
- Node.js - JavaScript runtime environment
Authentication & Security
- jsonwebtoken 8.5.1 - JWT token generation and verification
- bcrypt 5.0.1 - Password hashing and comparison
- cors - Cross-Origin Resource Sharing support
Database
- mysql 2.18.1 - MySQL database driver with connection pooling
- config 3.3.6 - Configuration management for different environments
E-commerce Integration
- @woocommerce/woocommerce-rest-api 1.0.1 - Official WooCommerce REST API client
Utilities
- morgan - HTTP request logging middleware
- nodemon - Development server with auto-restart
- xlsx - Excel file parsing for bulk product imports
Key Features
Product Management
- Bulk product import from Excel files
- CRUD operations for product catalog
- Product metadata management (descriptions, prices, stock levels)
- Track published products across platforms
User Management
- Secure user registration with encrypted passwords
- User profile updates and deletion
- Role-based access control (user types)
- Activity tracking via audit log (bitácora)
WooCommerce Integration
- Publish products directly to WooCommerce stores
- Automated product data mapping
- Category and image management
- Publication tracking and history
Security
- JWT-based authentication for all secured endpoints
- Password encryption using bcrypt
- Token expiration (1 hour)
- Authorization header validation
- Protected routes with middleware
API Architecture
The API uses a two-tier routing structure:-
Public Routes - Accessible without authentication
/- Health check endpoint/login- User authentication/upload_file- File upload (limited access)
-
Secured Routes - Protected by JWT middleware
- All routes under
/secured/*require valid JWT token - Includes product management, user operations, and WooCommerce integration
- All routes under
Configuration
The API uses a JSON-based configuration system with environment-specific settings stored inconfig/default.json:
config/default.json
Getting Started
Ready to start using the Tandex Electronics API? Continue to the Quickstart Guide for step-by-step setup instructions, or jump to Authentication to learn how to secure your API requests.Quickstart
Get the API up and running in minutes
Authentication
Learn how to authenticate your requests