Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/160906/Yakultt-App/llms.txt

Use this file to discover all available pages before exploring further.

This guide walks you through getting a fully working Yakult App development environment running on your local machine. By the end, you will have the MySQL database initialized, the Express backend serving the REST API on port 3000, and the Expo mobile app running on an emulator or physical device — ready to register your first user and place your first order.

Setup Steps

1

Prerequisites

Make sure the following tools are installed before you begin:
  • Node.js 18+nodejs.org
  • MySQL — via XAMPP (recommended for Windows) or MySQL Workbench
  • Expo CLI — install globally with:
npm install -g expo-cli
Verify your Node version before proceeding:
node -v   # should print v18.x.x or higher
2

Clone the Repository

Clone the Yakult App monorepo to your local machine:
git clone https://github.com/160906/Yakultt-App.git
cd Yakultt-App
The repository contains two top-level directories:
  • backend/ — the Express.js API server
  • yakult-app/ — the React Native / Expo mobile application
3

Configure the Database

Start your MySQL server, then create the yakult_db database:
mysql -u root -p -e "CREATE DATABASE IF NOT EXISTS yakult_db;"
Optionally, seed the database with the provided SQL dump for sample data:
mysql -u root -p yakult_db < backend/database/yakult_db.sql
Importing the SQL dump is optional. When the backend server starts for the first time, ensureSchema() automatically creates all required tables in yakult_db. You only need the dump if you want pre-loaded sample data.
4

Start the Backend

Install dependencies and start the Express development server:
cd backend
npm install
npm run dev
On startup you should see:
Servidor corriendo en http://localhost:3000
The server runs on port 3000 and auto-migrates the database schema on every start. Verify it is healthy with a quick curl:
curl http://localhost:3000/
Expected response:
{
  "ok": true,
  "mensaje": "API Yakult funcionando ✅"
}
5

Configure the Mobile App API URL

Open yakult-app/services/db.ts and confirm (or update) the BASE URL to match your environment:
// Android emulator → points to host machine loopback
const BASE = 'http://10.0.2.2:3000/api';

// Physical device → replace with your machine's LAN IP address
// const BASE = 'http://192.168.1.100:3000/api';
EnvironmentBASE URL
Android Emulatorhttp://10.0.2.2:3000/api
iOS Simulatorhttp://localhost:3000/api
Physical Device (same Wi-Fi)http://<your-LAN-IP>:3000/api
To find your LAN IP on Windows run ipconfig; on macOS/Linux run ifconfig or ip addr.
6

Start the Mobile App

In a new terminal, install dependencies and launch the Expo development server:
cd yakult-app
npm install
npx expo start
Expo will display a QR code in the terminal. Scan it with the Expo Go app on a physical device, or press:
  • a to open on a connected Android emulator
  • i to open on an iOS simulator (macOS only)
7

Create Your First User

You can register a new user either through the in-app registration screen or directly via the API.Using curl:
curl -X POST http://localhost:3000/api/auth/registro \
  -H "Content-Type: application/json" \
  -d '{
    "nombre": "Ana López",
    "correo": "ana@upa.edu.mx",
    "contrasena": "MiContraseña123"
  }'
Role assignment rules:
Email domainAssigned role
@upa.edu.mxMaster (full admin access)
Any other domainPromotor (field sales access)
A successful registration returns a JWT token you can use to authenticate subsequent API requests:
{
  "usuario": {
    "id": 1,
    "nombre": "Ana López",
    "correo": "ana@upa.edu.mx",
    "rol": "Master"
  },
  "token": "<jwt-token>"
}

Next Steps

With your environment running, explore the core modules of the platform:
  • Products — Add and manage the Yakult product catalog
  • Clients — Register customers and manage accounts
  • Orders — Create orders and track fulfillment
  • Reports — Generate and export PDF sales reports
On Windows, XAMPP is the fastest way to get MySQL running with zero configuration. Install XAMPP, open the XAMPP Control Panel, and click Start next to the MySQL module. The default root user with an empty password matches the backend db.js configuration exactly — no changes needed for local development.
The default database configuration in backend/db.js uses the root user with an empty password. This is acceptable for local development only. Before deploying to any shared or production environment, create a dedicated MySQL user with a strong password and update db.js (or use environment variables) accordingly.

Build docs developers (and LLMs) love