Skip to content
Open
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
1,013 changes: 1,013 additions & 0 deletions ANDROID_ARCHITECTURE.md

Large diffs are not rendered by default.

938 changes: 938 additions & 0 deletions API_INTEGRATION.md

Large diffs are not rendered by default.

742 changes: 742 additions & 0 deletions IMPLEMENTATION_PLAN.md

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ Detailed architecture documentation for each project:
- **[telegram-bot](https://github.com/deep-assistant/telegram-bot/blob/main/ARCHITECTURE.md)** - Dual-language Telegram bot (Python/JavaScript)
- **[GPTutor](https://github.com/deep-assistant/GPTutor/blob/main/ARCHITECTURE.md)** - Multi-platform educational AI (VK/Telegram mini apps)
- **[web-capture](https://github.com/deep-assistant/web-capture/blob/main/ARCHITECTURE.md)** - Web page capture microservice (HTML/Markdown/PNG)
- **[android-app](ANDROID_ARCHITECTURE.md)** - Native Android application (Kotlin, Jetpack Compose) - [Planning Phase]
- [API Integration Guide](API_INTEGRATION.md)
- [Implementation Plan](IMPLEMENTATION_PLAN.md)
- [PR #33](https://github.com/deep-assistant/master-plan/pull/33)

# End Goal / Mission

Expand Down
92 changes: 92 additions & 0 deletions android-app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# Built application files
*.apk
*.ap_
*.aab

# Files for the ART/Dalvik VM
*.dex

# Java class files
*.class

# Generated files
bin/
gen/
out/
release/

# Gradle files
.gradle/
build/

# Local configuration file (sdk path, etc)
local.properties

# Proguard folder generated by Eclipse
proguard/

# Log Files
*.log

# Android Studio Navigation editor temp files
.navigation/

# Android Studio captures folder
captures/

# IntelliJ
*.iml
.idea/
misc.xml
deploymentTargetDropDown.xml
render.experimental.xml

# Keystore files
*.jks
*.keystore

# External native build folder generated in Android Studio 2.2 and later
.externalNativeBuild
.cxx/

# Google Services (e.g. APIs or Firebase)
google-services.json

# Freeline
freeline.py
freeline/
freeline_project_description.json

# fastlane
fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots
fastlane/test_output
fastlane/readme.md

# Version control
vcs.xml

# lint
lint/intermediates/
lint/generated/
lint/outputs/
lint/tmp/

# Android Profiling
*.hprof

# Secrets and API keys
secrets.properties
api-keys.properties

# Mac
.DS_Store

# Backup files
*~
*.swp
*.bak

# Build cache
.buildcache/
261 changes: 261 additions & 0 deletions android-app/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,261 @@
# Deep Assistant Android Application

Official Android client for Deep Assistant - your personal AI assistant available anywhere.

## Overview

The Deep Assistant Android application provides native mobile access to AI-powered conversations, image generation, and other AI services through a clean, modern interface built with Jetpack Compose.

## Features

### Current Features (MVP)
- Multi-model AI chat (GPT-4o, Claude, Llama, DeepSeek)
- Real-time streaming responses
- Token balance management
- Conversation history
- Secure authentication
- Material Design 3 UI

### Planned Features
- Image generation (DALL-E)
- Voice input and audio transcription
- Custom system messages
- Conversation context management
- Offline mode
- Push notifications
- Referral system

## Technical Stack

- **Language**: Kotlin 1.9+
- **Minimum SDK**: Android 8.0 (API 26)
- **Target SDK**: Android 14 (API 34)
- **UI Framework**: Jetpack Compose
- **Architecture**: MVVM + Clean Architecture
- **Dependency Injection**: Hilt
- **Networking**: Retrofit + OkHttp
- **Database**: Room
- **Async**: Kotlin Coroutines + Flow

## Architecture

This project follows Clean Architecture principles with clear separation of concerns:

```
app/
β”œβ”€β”€ presentation/ # UI Layer (Compose, ViewModels)
β”œβ”€β”€ domain/ # Business Logic (Use Cases, Models)
β”œβ”€β”€ data/ # Data Layer (Repositories, API, Database)
└── di/ # Dependency Injection (Hilt Modules)
```

For detailed architecture documentation, see [ANDROID_ARCHITECTURE.md](../ANDROID_ARCHITECTURE.md).

## Getting Started

### Prerequisites

- Android Studio Hedgehog (2023.1.1) or later
- JDK 17
- Android SDK 34
- Kotlin 1.9+

### Setup

1. Clone the repository:
```bash
git clone https://github.com/deep-assistant/android-app.git
cd android-app
```

2. Create `local.properties` file in the root directory:
```properties
sdk.dir=/path/to/your/Android/Sdk
```

3. Create `gradle.properties` with API configuration:
```properties
API_BASE_URL=https://your-api-gateway-url.com
# Add other configuration as needed
```

4. Sync project with Gradle files

5. Run the app on an emulator or physical device

### Configuration

Create a `secrets.properties` file (gitignored) for sensitive values:
```properties
FIREBASE_API_KEY=your_firebase_api_key
SENTRY_DSN=your_sentry_dsn
```

## Project Structure

```
android-app/
β”œβ”€β”€ app/
β”‚ β”œβ”€β”€ src/
β”‚ β”‚ β”œβ”€β”€ main/
β”‚ β”‚ β”‚ β”œβ”€β”€ java/com/deepassistant/android/
β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ presentation/
β”‚ β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ chat/ # Chat screen & ViewModel
β”‚ β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ auth/ # Authentication flow
β”‚ β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ settings/ # Settings screen
β”‚ β”‚ β”‚ β”‚ β”‚ └── common/ # Shared UI components
β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ domain/
β”‚ β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ model/ # Domain models
β”‚ β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ repository/ # Repository interfaces
β”‚ β”‚ β”‚ β”‚ β”‚ └── usecase/ # Business logic
β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ data/
β”‚ β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ remote/ # API services
β”‚ β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ local/ # Room database
β”‚ β”‚ β”‚ β”‚ β”‚ └── repository/ # Repository implementations
β”‚ β”‚ β”‚ β”‚ └── di/ # Hilt modules
β”‚ β”‚ β”‚ └── res/ # Resources
β”‚ β”‚ └── test/ # Unit tests
β”‚ └── build.gradle.kts
β”œβ”€β”€ gradle/
β”œβ”€β”€ build.gradle.kts
β”œβ”€β”€ settings.gradle.kts
β”œβ”€β”€ README.md
└── .gitignore
```

## API Integration

The app integrates with the Deep Assistant API Gateway. All API endpoints are documented in the [Architecture document](../ANDROID_ARCHITECTURE.md#api-integration-requirements).

### Authentication

The app uses Bearer token authentication:
```kotlin
Authorization: Bearer {user_token}
```

Tokens are securely stored using EncryptedSharedPreferences.

## Development

### Building

```bash
# Debug build
./gradlew assembleDebug

# Release build
./gradlew assembleRelease

# Run tests
./gradlew test

# Run instrumented tests
./gradlew connectedAndroidTest
```

### Code Style

This project follows the official Kotlin coding conventions and uses `ktlint` for linting:

```bash
# Check code style
./gradlew ktlintCheck

# Format code
./gradlew ktlintFormat
```

### Testing

- **Unit Tests**: Located in `src/test/`
- **Integration Tests**: Located in `src/androidTest/`
- **UI Tests**: Compose UI tests in `src/androidTest/`

Run tests:
```bash
./gradlew test # Unit tests
./gradlew connectedTest # Instrumented tests
```

## Contributing

1. Fork the repository
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
3. Commit your changes (`git commit -m 'Add some amazing feature'`)
4. Push to the branch (`git push origin feature/amazing-feature`)
5. Open a Pull Request

### Commit Convention

Follow conventional commits:
- `feat:` New features
- `fix:` Bug fixes
- `docs:` Documentation changes
- `style:` Code style changes (formatting)
- `refactor:` Code refactoring
- `test:` Adding or updating tests
- `chore:` Maintenance tasks

## Deployment

### Alpha/Beta Testing

The app uses Google Play's internal testing tracks:

1. **Internal Testing**: Team members only
2. **Closed Testing**: Invited testers
3. **Open Testing**: Public beta

### Production Release

Production releases are created through GitHub Actions and uploaded to Google Play Console.

## Monitoring

- **Crash Reporting**: Firebase Crashlytics
- **Analytics**: Firebase Analytics
- **Performance**: Firebase Performance Monitoring

## Security

- All sensitive data is encrypted at rest
- Network communication uses HTTPS/TLS
- Certificate pinning is implemented
- ProGuard/R8 obfuscation for release builds

## License

This project is licensed under the MIT License - see the [LICENSE](../LICENSE) file for details.

## Support

- GitHub Issues: [Report bugs or request features](https://github.com/deep-assistant/master-plan/issues)
- Documentation: [Full documentation](https://github.com/deep-assistant/master-plan)

## Acknowledgments

- Built with [Jetpack Compose](https://developer.android.com/jetpack/compose)
- API Gateway by Deep Assistant team
- Icons from [Material Icons](https://fonts.google.com/icons)

## Roadmap

See the main [ROADMAP](https://github.com/deep-assistant/master-plan/issues/4) for the complete development plan.

### Current Status

**Phase**: Architecture & Planning
**Target Release**: Q2 2025

### Milestones

- [x] Architecture design
- [ ] MVP development
- [ ] Alpha testing
- [ ] Beta release
- [ ] Production release on Google Play

## Contact

For questions or feedback, please open an issue in the [master-plan repository](https://github.com/deep-assistant/master-plan/issues).
Loading