Motobai is a small, independent business focused on selling motor parts — with a strong emphasis on oils and lubricants that keep engines running at peak performance. Our goal is to provide dependable, accessible automotive supplies for local workshops and internal operations.
This internal-use application is built to support and streamline Motobai's day-to-day workflows. Designed for use by our employees, it offers an efficient and user-friendly interface for managing inventory, tracking orders, and monitoring product data.
- Project documentation: Motobai Google Docs documentation
| Name | Role |
|---|---|
| Jose Emmanuel Idpan | Backend Developer (Django) |
| Ram Christian Nacar | Frontend Developer (React) |
| Thaddeus Domingo | Quality Assurance & Project Management |
- Built with React (frontend) and Django (backend)
- RESTful API integration for smooth data flow
- JWT Authentication and user role support
- Real-time inventory management
- Order tracking and status updates
- Modular design for future scalability
This branch is for local backend use only. Run Django locally and connect it to a local MySQL-compatible database.
Install these before proceeding:
- Node.js
- Python 3.11 or 3.12 for the backend local environment
- A MySQL-compatible database setup, using one of the install methods below
- VS Code or another editor
Database setup options:
- Fedora/Linux: MariaDB server + CLI.
- Windows: MySQL Installer with MySQL Server + MySQL Workbench.
git clone <this link>
cd MotobaiProjectChoose one method for your operating system.
Install and start MariaDB:
sudo dnf install mariadb-server mariadb
sudo systemctl enable --now mariadbOpen the database shell:
sudo mariadbInside the MariaDB/MySQL prompt:
CREATE DATABASE IF NOT EXISTS motobai;
ALTER USER 'root'@'localhost' IDENTIFIED BY 'root';
FLUSH PRIVILEGES;
EXIT;Test the login:
mariadb -u root -p motobaiWhen prompted, enter:
root
If changing the root password fails on your machine, create a separate app user instead:
CREATE DATABASE IF NOT EXISTS motobai;
CREATE USER IF NOT EXISTS 'motobai'@'localhost' IDENTIFIED BY 'motobai';
GRANT ALL PRIVILEGES ON motobai.* TO 'motobai'@'localhost';
FLUSH PRIVILEGES;
EXIT;Then update backend/.env during backend setup:
DB_USER=motobai
DB_PASSWORD=motobai
- Download MySQL Installer Community from: https://dev.mysql.com/downloads/installer/
- Run the installer.
- Choose Developer Default, or choose Custom and include:
- MySQL Server 8.x
- MySQL Workbench
- During MySQL Server configuration:
- Set the root password to
rootto match the current local Django settings. - Keep the default port
3306. - Finish the installer and start MySQL Server if prompted.
- Set the root password to
- Open MySQL Workbench.
- Connect to the local instance, usually named
Local instance MySQL80. - Open a new SQL tab and run:
CREATE DATABASE IF NOT EXISTS motobai;If you choose a root password other than root, update DB_PASSWORD in backend/.env during backend setup.
cd frontend
npm installCreate a file named .env inside the frontend/ folder:
touch .envAdd:
VITE_API_URL="http://127.0.0.1:8000"
The frontend defaults to http://127.0.0.1:8000 when VITE_API_URL is not set.
cd ..
cd backend
python -m venv .venv
# Windows PowerShell:
.venv\Scripts\Activate.ps1
# macOS/Linux:
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install -r requirements.txtrequirements.txt is for the local MySQL/MariaDB backend setup.
Create the backend local environment file:
Fedora/Linux:
cp .env.example .env
python -c "from django.core.management.utils import get_random_secret_key; print(get_random_secret_key())"Windows PowerShell:
copy .env.example .env
py -c "from django.core.management.utils import get_random_secret_key; print(get_random_secret_key())"Open backend/.env, paste the generated value into DJANGO_SECRET_KEY, and adjust DB_PASSWORD if your local database password is not root.
backend/backend/__init__.py should contain:
import pymysql
pymysql.install_as_MySQLdb()python manage.py migrateDo not run makemigrations during normal setup. The repo already includes migrations.
From the repository root, use the CLI import.
Fedora/Linux:
cd ..
mariadb -u root -p motobai < defaultdata/motobai_seed_local.sqlWindows PowerShell:
cd ..
cmd /c "mysql -u root -p motobai < defaultdata\motobai_seed_local.sql"Windows Command Prompt:
cd ..
mysql -u root -p motobai < defaultdata\motobai_seed_local.sqlUse defaultdata/motobai_seed_local.sql, not the raw motobai_dump2.sql. The raw dump includes old Django internal table data and can conflict with current migrations.
Verify the seed:
mariadb -u root -p motobai -e "SELECT COUNT(*) AS products FROM api_product; SELECT username FROM auth_user;"On Windows, use:
mysql -u root -p motobai -e "SELECT COUNT(*) AS products FROM api_product; SELECT username FROM auth_user;"Seed login:
username: motobai_admin
password: motobai123
Terminal 1 — Backend:
cd backend
source .venv/bin/activate
python manage.py runserverOn Windows PowerShell, activate the backend environment with:
cd backend
.venv\Scripts\Activate.ps1
python manage.py runserverTerminal 2 — Frontend:
cd frontend
npm run devThen open your browser and go to: http://127.0.0.1:5173
Add Python to your system PATH: https://datatofish.com/add-python-to-windows-path/
Reinstall or repair pip: https://pip.pypa.io/en/stable/installation/
This is a known Windows build issue. Use PyMySQL instead (already covered in step 4–5 above). Do not try to install mysqlclient directly on Windows without MySQL C headers.
Make sure frontend/.env uses the same backend URL you are running, normally http://127.0.0.1:8000. If you run Vite on a different host or port, add that frontend origin to DJANGO_CORS_ALLOWED_ORIGINS in backend/.env, then restart Django.
Open backend/backend/settings.py and set:
USE_TZ = FalseThen restart the Django server.
Open backend/.env and update DB_PASSWORD to match what you set during MySQL installation.
At Motobai, we believe that a well-oiled system is just as important as a well-oiled machine.