A complete full-stack order management solution with Android mobile app and web-based admin panel.
- Product browsing with categories
- Search and filter products
- Shopping cart management
- Discount pricing support
- Order placement and tracking
- User authentication (Login/Register)
- Featured products
- Order history
- Modern Material Design 3 UI
- Responsive design
- Real-time dashboard with statistics
- Order management (view, update status, track)
- Product management (CRUD operations)
- Discount pricing management
- Category management with images
- User management
- Live image previews
- Search and filter functionality
- Responsive design (mobile, tablet, desktop)
- Secure authentication
- RESTful API architecture
- MySQL database
- Input sanitization & validation
- CORS enabled
- Optimized queries
- Language: Kotlin
- UI Framework: Jetpack Compose
- Architecture: MVVM (Model-View-ViewModel)
- Networking: Retrofit + OkHttp
- JSON Parsing: Gson
- Design: Material Design 3
- Navigation: Compose Navigation
- Language: PHP 7.4+
- Database: MySQL 5.7+ / MariaDB 10.2+
- API: RESTful
- Server: Apache/Nginx
- Frontend: HTML5, CSS3, JavaScript (Vanilla)
- Design: Responsive, Modern UI
- API Integration: Fetch API
- Android Studio (latest version)
- Android SDK (API 24+)
- Kotlin plugin
- PHP 7.4 or higher
- MySQL 5.7+ or MariaDB 10.2+
- Apache/Nginx web server
- PHP extensions: mysqli, json
Upload the entire backend folder to your PHP server:
your-server.com/
└── backend/
├── admin/
├── api/
├── assets/
├── config.php
└── setup_database.php
Edit backend/config.php with your database credentials:
$host = "your-database-host"; // Usually "localhost"
$user = "your-database-username";
$password = "your-database-password";
$dbname = "your-database-name";Create a new MySQL database:
CREATE DATABASE your_database_name CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;Access the setup script in your browser:
http://your-server.com/backend/setup_database.php
Or run via command line:
cd backend
php setup_database.phpThis will:
- Create all necessary tables (users, categories, products, orders, order_items)
- Insert sample categories with images
- Insert sample products with discounts
Test the API:
http://your-server.com/backend/api/products.php?action=list
You should see a JSON response with sample products.
git clone <your-repository-url>
cd BuiltOrderManagementOpen app/src/main/java/com/king/builtordermanagement/data/api/RetrofitClient.kt
Update the BASE_URL with your server URL:
private const val BASE_URL = "http://your-server.com/backend/"Examples:
// For live server
private const val BASE_URL = "https://yourdomain.com/backend/"
// For local testing (use your computer's IP, not localhost)
private const val BASE_URL = "http://192.168.1.100/backend/"
// For shared hosting
private const val BASE_URL = "https://yoursite.com/backend/"- Always end the URL with
/backend/ - Use
https://for production (secure) - For local testing, use your computer's IP address (not
localhostor127.0.0.1) - Make sure your server is accessible from your Android device
- Open Android Studio
- Select "Open an Existing Project"
- Navigate to the project folder
- Wait for Gradle sync to complete
- Connect your Android device or start an emulator
- Click "Run" (green play button) or press
Shift + F10 - Select your device
- Wait for the app to install and launch
Open in your browser:
http://your-server.com/backend/admin/login.html
Username: admin
Password: admin123
Security Warning: Change the default password before going to production!
- Launch the app
- Register a new account or login
- Browse products by category
- Add products to cart
- Proceed to checkout
- Track your orders
- Home: Browse featured products and categories
- Categories: Filter products by category
- Search: Find products quickly
- Cart: Review items before checkout
- Orders: Track order status and history
- Profile: Manage account settings
- View total orders, pending orders, products, and revenue
- See recent orders at a glance
- Click "Orders" in sidebar
- Filter by status or search
- Click "View" to see order details
- Update order status (pending → processing → shipped → delivered)
- Click "Products" in sidebar
- Click "+ Add Product" to create new
- Fill in details:
- Name, description
- Price (required)
- Discount price (optional - for sales)
- Stock quantity
- Category
- Image URL
- Featured status
- Click "Save"
Adding Discounts:
- Enter regular price:
$99.99 - Enter discount price:
$79.99 - Product will show with "SALE" badge
- Click "Categories" in sidebar
- Click "+ Add Category"
- Enter name, description, and image URL
- Images will preview as you type
- Click "Save"
- View all registered users
- See order count per user
- Track registration dates
- PHP 7.4+
- MySQL 5.7+ or MariaDB 10.2+
- Apache with mod_rewrite OR Nginx
- PHP extensions: mysqli, json
- Memory limit: 128MB minimum
- Upload max filesize: 10MB minimum
- Minimum SDK: API 24 (Android 7.0)
- Target SDK: API 34 (Android 14)
- Compile SDK: API 34
Ensure your server allows:
- CORS requests (already configured in
config.php) - POST, GET, PUT, DELETE methods
- JSON content type
BuiltOrderManagement/
├── app/
│ └── src/
│ └── main/
│ ├── java/com/king/builtordermanagement/
│ │ ├── data/
│ │ │ ├── api/ # Retrofit API interfaces
│ │ │ ├── models/ # Data models
│ │ │ └── repository/ # Data repositories
│ │ ├── ui/
│ │ │ ├── components/ # Reusable UI components
│ │ │ ├── screens/ # App screens
│ │ │ └── theme/ # Material Design theme
│ │ ├── viewmodel/ # ViewModels
│ │ └── MainActivity.kt
│ └── res/ # Resources
│
└── backend/
├── admin/
│ ├── index.html # Admin dashboard
│ └── login.html # Admin login
├── api/
│ ├── admin.php # Admin operations
│ ├── auth.php # Authentication
│ ├── categories.php # Categories API
│ ├── orders.php # Orders API
│ └── products.php # Products API
├── assets/
│ ├── css/
│ │ └── styles.css # Admin panel styles
│ └── js/
│ └── script.js # Admin panel logic
├── config.php # Database configuration
├── setup_database.php # Database setup script
└── README.md # Backend documentation
POST /api/auth.php?action=register- Register new userPOST /api/auth.php?action=login- User login
GET /api/products.php?action=list- Get all productsGET /api/products.php?action=featured- Get featured productsGET /api/products.php?action=category&category_id={id}- Get products by categoryGET /api/products.php?action=search&q={query}- Search productsGET /api/products.php?action=detail&id={id}- Get product details
GET /api/categories.php?action=list- Get all categories
POST /api/orders.php?action=create- Create new orderGET /api/orders.php?action=list&user_id={id}- Get user ordersGET /api/orders.php?action=detail&order_id={id}- Get order detailsPOST /api/orders.php?action=cancel- Cancel order
GET /api/admin.php?action=stats- Dashboard statisticsGET /api/admin.php?action=all_orders- All ordersPOST /api/admin.php?action=update_order_status- Update order statusPOST /api/admin.php?action=create_product- Create productPOST /api/admin.php?action=update_product- Update productPOST /api/admin.php?action=delete_product- Delete productPOST /api/admin.php?action=create_category- Create categoryPOST /api/admin.php?action=update_category- Update categoryPOST /api/admin.php?action=delete_category- Delete categoryGET /api/admin.php?action=users- Get all users
-
Change Admin Password
- Implement proper authentication system
- Use password hashing (bcrypt)
-
Enable HTTPS
- Get SSL certificate (Let's Encrypt is free)
- Force HTTPS in
.htaccess
-
Update Database Credentials
- Use strong passwords
- Restrict database user permissions
-
Secure Files
- Set proper file permissions (644 for files, 755 for directories)
- Protect sensitive files via
.htaccess
-
Update CORS Settings
- In
config.php, changeAccess-Control-Allow-Originfrom*to your domain
- In
-
Environment Variables
- Move sensitive data to environment variables
- Don't commit credentials to version control
"Unable to connect to server"
- Check if BASE_URL is correct in
RetrofitClient.kt - Ensure server is accessible from your device
- Use IP address instead of localhost for local testing
- Check if server is running
"Network error"
- Verify internet connection
- Check if API endpoints are working (test in browser)
- Ensure CORS is enabled on server
App crashes on launch
- Check Android Studio Logcat for errors
- Verify all dependencies are installed
- Clean and rebuild project
"Database connection failed"
- Verify credentials in
config.php - Check if MySQL service is running
- Ensure database exists
"404 Not Found" on API calls
- Check if
.htaccessis enabled - Verify file paths are correct
- Check server configuration
CORS errors
- Verify CORS headers in
config.php - Check if server allows cross-origin requests
Can't login
- Use default credentials: admin / admin123
- Clear browser cache
- Check browser console for errors
Images not loading
- Verify image URLs are accessible
- Check internet connection
- Ensure URLs use HTTPS if site uses HTTPS
- id, name, email, phone, password_hash, address, created_at
- id, name, image_url, description, created_at
- id, category_id, name, description, price, discount_price, image_url, stock, rating, is_featured, created_at
- id, user_id, total_amount, status, shipping_address, payment_method, notes, created_at
- id, order_id, product_id, quantity, price
Contributions are welcome! Please feel free to submit a Pull Request.
This project is open source and available under the GNU Affero General Public License v3.0.
Built with ❤️ by Kush Kalsi
For issues and questions:
- Open an issue on GitHub
- Email: me@kushkalsi.in
- Material Design 3 for UI components
- Unsplash for sample product images
- Android Jetpack libraries
- PHP community
⭐ If you find this project helpful, please give it a star!
Happy Coding! 🚀




