Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

start setup for mobile app #11

Merged
merged 1 commit into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ across mobile, web, and desktop environments.
- SQLite (local database)

- **Mobile App:** TBD/TBA
- Toga Framework (Python)


- **Web Interface:** TBD/TBA

Expand Down
109 changes: 109 additions & 0 deletions mobile_app/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
# NexusWare Mobile App

## Overview

NexusWare Mobile is built using the Toga framework, providing a native mobile experience for warehouse management tasks.
This README provides detailed instructions for setting up, installing, and running the mobile application.

## Prerequisites
- Python 3.8 or higher
- pip (Python package installer)
- Git
- Xcode (for iOS development on macOS)
- Android Studio and SDK (for Android development)

## Development Environment Setup

### macOS Setup for iOS Development
1. Install Xcode from the App Store
2. Install Xcode Command Line Tools:
`xcode-select --install`
3. Accept Xcode license:
`sudo xcodebuild -license accept`

### Android Setup
1. Install Android Studio
2. Install Android SDK through Android Studio
3. Add the following to your ~/.bash_profile or ~/.zshrc:
```bash
export ANDROID_SDK_ROOT=$HOME/Library/Android/sdk
export PATH=$PATH:$ANDROID_SDK_ROOT/tools/bin
export PATH=$PATH:$ANDROID_SDK_ROOT/platform-tools
```

## Project Setup

1. Clone the repository and navigate to mobile app directory:
```bash
git clone https://github.com/HardMax71/NexusWare.git
cd NexusWare
git checkout -b mobile_app
cd mobile_app
```

2. Create and activate virtual environment:
```bash
python3 -m venv venv
source venv/bin/activate # On macOS/Linux
# or
.\venv\Scripts\activate # On Windows
```

3. Install required packages:
`pip install toga briefcase`

4. Project Structure:

```
mobile_app/
├── src/
│ └── nexusware/
│ ├── __init__.py
│ ├── __main__.py
│ └── app.py
├── pyproject.toml
└── LICENSE
```

## Development

### Running in Dev Mode
To test the application during development:
`briefcase dev`

### Creating Platform-Specific Projects
Create scaffolding for different platforms:
# For iOS
`briefcase create ios`

# For Android
`briefcase create android`

### Building the Application
Build for specific platforms:
# For iOS
`briefcase build ios`

# For Android
`briefcase build android`

### Running on Devices/Simulators
# Run on iOS simulator
`briefcase run ios`

# Run on Android emulator
`briefcase run android`

### Debugging
- Logs are stored in the `logs/` directory
- Use briefcase run ios -v or briefcase run android -v for verbose output
- Check iOS console logs in Xcode
- Use Android Studio's logcat for Android debugging

## Support
- Create issues in GitHub repository
- Check Toga documentation: https://toga.readthedocs.io/
- Check Briefcase documentation: https://briefcase.readthedocs.io/

## License
This project is licensed under the MIT License - see the LICENSE file for details.
Empty file added mobile_app/__init__.py
Empty file.
26 changes: 26 additions & 0 deletions mobile_app/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[tool.briefcase]
project_name = "NexusWare Mobile"
bundle = "com.example.nexusware"
version = "0.1.0"
url = "https://example.com/nexusware"
license.file = "LICENSE"
author = "Your Name"
author_email = "[email protected]"

[tool.briefcase.app.nexusware]
formal_name = "NexusWare Mobile"
description = "NexusWare Mobile Application"
sources = ['src/nexusware']
requires = [
'toga>=0.3.0',
]

[tool.briefcase.app.nexusware.macOS]
requires = [
'toga-cocoa>=0.3.0',
]

[tool.briefcase.app.nexusware.ios]
requires = [
'toga-iOS>=0.3.0',
]
Empty file.
4 changes: 4 additions & 0 deletions mobile_app/src/nexusware/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from nexusware.app import main

if __name__ == '__main__':
main().main_loop()
51 changes: 51 additions & 0 deletions mobile_app/src/nexusware/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import toga
from toga.style import Pack
from toga.style.pack import COLUMN, ROW

class NexusWareMobile(toga.App):
def __init__(self):
super().__init__()

def startup(self):
# Create a main window with a title
self.main_window = toga.MainWindow(title="NexusWare Mobile")

# Create a main box with vertical layout
main_box = toga.Box(style=Pack(direction=COLUMN, padding=10))

# Add a header label
header_label = toga.Label(
"NexusWare Mobile",
style=Pack(padding=(0, 0, 20, 0), font_size=20, font_weight='bold')
)

# Create a button that will show a message
self.button = toga.Button(
'Test Connection',
on_press=self.show_message,
style=Pack(padding=5)
)

# Create a text input
self.input = toga.TextInput(
placeholder='Scan barcode...',
style=Pack(padding=5)
)

# Add all widgets to the main box
main_box.add(header_label)
main_box.add(self.input)
main_box.add(self.button)

# Add the main box to the main window
self.main_window.content = main_box
self.main_window.show()

def show_message(self, widget):
self.main_window.info_dialog(
'Connection Test',
'Successfully connected to NexusWare!'
)

def main():
return NexusWareMobile()
Loading