A modern, production-ready mobile Address Book application built with Vue.js and NativeScript, featuring clean architecture and best practices.
-
Authentication System
- Mock login screen with validation
- Persistent authentication state
- Secure logout functionality
-
Contact Management
- View all contacts in an elegant list
- Add new contacts with validation
- Edit existing contact details
- Delete contacts with confirmation
- 5 pre-loaded sample contacts
-
Data Persistence
- Local storage using NativeScript ApplicationSettings
- All changes persist across app restarts
- No backend API required
-
User Experience
- Clean, modern UI design
- Smooth page transitions
- Form validation with helpful error messages
- Empty state handling
- Confirmation dialogs for destructive actions
-
Cross-Platform
- Works on both iOS and Android
- Platform-specific optimizations
- Responsive design
The project follows clean architecture principles with clear separation of concerns:
app/
βββ components/ # Vue components
β βββ Login.vue # Login screen
β βββ ContactList.vue # Contact list display
β βββ AddEditContact.vue # Add/Edit contact form
βββ store/ # State management
β βββ index.js # Vuex-like store implementation
βββ app.js # Application entry point
- State Management: Custom Vuex-like store with reactive state
- Component Communication: Props down, events up
- Data Persistence: ApplicationSettings for local storage
- Validation: Comprehensive form validation with user feedback
- Navigation: Programmatic navigation with transitions
- Node.js (v14 or higher)
- NativeScript CLI
- For iOS: macOS with Xcode
- For Android: Android SDK and Android Studio
-
Install NativeScript CLI globally:
npm install -g @nativescript/core
-
Navigate to the project directory:
cd /media/volumeD/AddressBookNative -
Install dependencies:
npm install
npm run androidor
ns run androidnpm run iosor
ns run iosnpm run build:androidnpm run build:ios- Enter any username (minimum 3 characters)
- Enter any password (minimum 4 characters)
- Click "Login" to access the contact list
- After login, you'll see a list of 5 pre-loaded contacts
- Each contact displays: name, phone number, and email
- Scroll through the list to view all contacts
- Tap the "+ Add Contact" button at the bottom
- Fill in all required fields:
- First Name (minimum 2 characters)
- Last Name (minimum 2 characters)
- Contact Number (minimum 10 digits)
- Email (valid email format)
- Tap "Add Contact" to save
- The new contact appears immediately in the list
- Tap "βοΈ Edit" button on any contact card
- Modify the desired fields
- Tap "Save Changes" to update
- Changes appear immediately in the list
- Tap "ποΈ Delete" button on any contact card
- Confirm the deletion in the dialog
- Contact is removed immediately from the list
- Tap the "Logout" option in the action bar
- Confirm logout in the dialog
- Returns to the login screen
- Modern Design: Clean, intuitive interface with Material Design principles
- Color Scheme: Professional blue theme (#3498db)
- Typography: Clear hierarchy with appropriate font sizes
- Icons: Emoji-based icons for visual clarity
- Feedback: Real-time validation with helpful error messages
- Animations: Smooth page transitions
- Responsive: Adapts to different screen sizes
The application uses a custom Vuex-like store implementation:
store.state; // Reactive state
store.getters; // Computed getters
store.commit(); // Synchronous mutations
store.dispatch(); // Asynchronous actionsContact:
{
id: Number, // Unique identifier (timestamp)
firstName: String, // Required, min 2 chars
lastName: String, // Required, min 2 chars
contactNumber: String,// Required, min 10 digits
email: String // Required, valid email format
}User:
{
username: String; // Authentication identifier
}- Username: Required, minimum 3 characters
- Password: Required, minimum 4 characters
- First Name: Required, minimum 2 characters
- Last Name: Required, minimum 2 characters
- Contact Number: Required, minimum 10 digits, phone format
- Email: Required, valid email format (user@domain.com)
AddressBookNative/
βββ app/
β βββ components/
β β βββ Login.vue
β β βββ ContactList.vue
β β βββ AddEditContact.vue
β βββ store/
β β βββ index.js
β βββ app.js
βββ App_Resources/
β βββ Android/
β β βββ src/main/
β β βββ AndroidManifest.xml
β β βββ res/
β βββ iOS/
β βββ Info.plist
β βββ build.xcconfig
βββ package.json
βββ webpack.config.js
βββ tsconfig.json
βββ nativescript.config.ts
βββ README.md
- Mock authentication (no actual backend)
- Data stored locally on device
- No network requests required
- Suitable for demonstration and offline use
- Create new component in
app/components/ - Add state/actions to
app/store/index.jsif needed - Update navigation in existing components
- Follow existing naming conventions and code style
- Use Vue 2 Options API
- Keep components focused and single-purpose
- Extract reusable logic into methods
- Use meaningful variable and function names
- Add comments for complex logic
Run on both platforms to ensure cross-platform compatibility:
- Test on Android emulator/device
- Test on iOS simulator/device
- Verify all CRUD operations
- Test form validations
- Check data persistence
The app includes 5 pre-loaded contacts:
- John Doe - +1234567890 - john.doe@example.com
- Jane Smith - +1234567891 - jane.smith@example.com
- Michael Johnson - +1234567892 - michael.j@example.com
- Emily Davis - +1234567893 - emily.davis@example.com
- David Wilson - +1234567894 - david.wilson@example.com
Issue: Build fails
- Solution: Run
ns cleanand try again
Issue: Hot reload not working
- Solution: Restart the app with
ns run android/ios
Issue: Dependencies not installing
- Solution: Delete
node_modulesandpackage-lock.json, then runnpm install
Issue: App crashes on startup
- Solution: Check console logs and ensure all files are in correct locations
Potential features for future versions:
- Search and filter contacts
- Group contacts by category
- Export/Import contacts
- Profile pictures for contacts
- Contact sharing
- Backend API integration
- Cloud synchronization
- Dark mode support
This application demonstrates:
- Clean architecture principles
- Component-based design
- State management patterns
- Form validation techniques
- Local data persistence
- Cross-platform mobile development
- Production-ready code quality
MIT License - Feel free to use this project for learning and development.
This is a demonstration project. Feel free to fork and modify for your needs.
Built with β€οΈ using Vue.js and NativeScript