Welcome to Mis Compras
Mis Compras is an e-commerce marketplace platform designed to democratize digital commerce, connecting local entrepreneurs with their community. This guide will walk you through creating an account, making your first purchase, and listing your first product.Mis Compras was created to strengthen local economic and social networks, allowing anyone to start and grow their business from home.
Getting Started
Create Your Account
Register for a new Mis Compras account to start buying or selling products.The system will:Error Response:
Registration API
The platform uses a PHP backend for user registration. Here’s how the registration works:- Validate all required fields
- Check for duplicate email addresses
- Hash your password using
password_hash()withPASSWORD_DEFAULT - Create your user account in the database
Log In to Your Account
Once registered, log in to access all platform features.Success Response:The login system:
Login API
- Verifies credentials using
password_verify() - Creates a PHP session with
$_SESSION["id_usuario"] - Returns user details for client-side storage
Your user ID is essential for all authenticated operations like listing products or making purchases.
Browse Products by Category
Make Your First Purchase
Add products to your cart and complete the checkout process.What happens during checkout:
Checkout Process
The checkout system processes your cart items and creates an order:- Order Creation: A new entry is created in the
pedidostable - Order Details: Each item is stored in
detalle_pedidowith quantity and price - Cart Cleanup: Your shopping cart is cleared after successful purchase
All prices are stored as DECIMAL(10,2) in the database to ensure accurate financial calculations.
List Your First Product
Start selling by creating your first product listing.Product Creation Process:Image Naming:
Create a Product Listing
- Session Validation: Ensures you’re logged in
- Field Validation: Checks all required fields are present
- Image Upload: Generates unique filename with timestamp and random hash
- Database Insert: Creates product record with your user ID as vendor
Database Schema Overview
Understanding the core tables will help you work with the platform:usuarios
User Accounts
id_usuario(Primary Key)nombre(Name)email(Unique)contrasena(Hashed password)fecha_registro(Timestamp)
productos
Product Listings
id_producto(Primary Key)nombre(Product name)descripcion(Description)precio(DECIMAL)imagen(Image filename)id_vendedor(Foreign Key to usuarios)id_categoria(Foreign Key to categorias)
pedidos
Orders
id_pedido(Primary Key)id_usuario(Foreign Key to usuarios)total(DECIMAL)direccion(Delivery address)fecha_pedido(Timestamp)
categorias
Product Categories
id_categoria(Primary Key)nombre(Category name)descripcion(Description)
API Endpoints Quick Reference
| Endpoint | Method | Description |
|---|---|---|
/php/registro.php | POST | Register new user |
/php/login.php | POST | User authentication |
/php/obtener_productos_por_categoria.php | GET | Get all products grouped by category |
/php/vender.php | POST | Create new product listing |
/php/checkout.php | POST | Process purchase order |
/php/obtener_producto.php | GET | Get single product details |
/php/mis_productos.php | GET | Get products by current user |
Next Steps
Installation
Set up your local development environment
API Reference
Explore all available API endpoints
Database Schema
Deep dive into the database structure
User Authentication
Learn about authentication and security
Need Help?
If you encounter any issues during setup or have questions:- Check the Installation Guide for detailed setup instructions
- Review the database schema in the included SQL file
- Ensure your PHP environment has bcrypt support for password hashing
- Verify MySQL/MariaDB is running and accessible
Next Steps
For Sellers
Learn how to start selling on Mis Compras
For Buyers
Discover how to browse and purchase products
Configuration
Set up your local development environment
API Documentation
Explore the complete API reference