Skip to content

ansari-project/ansari-frontend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Ansari Chat - AI-Powered Islamic Knowledge Assistant

Ansari Chat Logo

React Native Expo TypeScript License

πŸ“– Overview

Ansari Chat is a cross-platform mobile and web application that provides an AI-powered Islamic knowledge assistant. Built with React Native and Expo, it offers users an intuitive chat interface to ask questions about Islamic teachings, practices, and guidance.

✨ Features

  • AI Chat Interface: Interactive conversation with an Islamic knowledge assistant
  • Multi-language Support: Internationalization with i18next
  • Cross-Platform: Runs on iOS, Android, and Web
  • Thread Management: Organize conversations in separate threads
  • Share Functionality: Share conversations with others
  • User Authentication: Secure login and registration system
  • Guest Mode: Try the app without creating an account
  • Dark/Light Theme: Automatic theme switching based on device settings
  • Markdown Support: Rich text formatting in chat messages
  • RTL Support: Full support for Arabic and other RTL languages

πŸ› οΈ Tech Stack

Core Technologies

  • React Native 0.76.7 - Mobile framework
  • Expo SDK 52 - Development platform
  • TypeScript - Type-safe JavaScript
  • Redux Toolkit - State management
  • NativeWind - Tailwind CSS for React Native

Key Libraries

  • expo-router - File-based routing
  • react-i18next - Internationalization
  • react-native-reanimated - Smooth animations
  • react-native-gesture-handler - Touch gestures
  • react-native-markdown-display - Markdown rendering
  • @sentry/react-native - Error tracking
  • @vercel/analytics - Web analytics
  • formik & yup - Form handling and validation

πŸ“‹ Prerequisites

  • Node.js 18+ and npm/yarn
  • Expo CLI (npm install -g expo-cli)
  • iOS Simulator (Mac only) or Android emulator
  • EAS CLI for building (npm install -g eas-cli)

πŸš€ Getting Started

Installation

  1. Clone the repository:
git clone [repository-url]
cd ansari-frontend
  1. Install dependencies:
npm install
  1. Set up environment variables:
cp .env.example .env.local

Edit .env.local with your configuration:

EXPO_PUBLIC_ENVIRONMENT=development
EXPO_PUBLIC_API_V2_URL=https://your-api-url/api/v2
EXPO_PUBLIC_API_TIMEOUT=60000
EXPO_PUBLIC_SHARE_URL=http://localhost:8081
EXPO_PUBLIC_SUBSCRIBE_URL=your-subscribe-url
EXPO_PUBLIC_FEEDBACK_EMAIL=[email protected]
EXPO_PUBLIC_COMPREHENSIVE_GUIDE_URL=https://docs.yourdomain.com/capabilities/
EXPO_PUBLIC_PRIVACY_URL=https://docs.yourdomain.com/privacy/
EXPO_PUBLIC_TERMS_URL=https://docs.yourdomain.com/terms/
EXPO_PUBLIC_ENABLE_SHARE=false

Development

Start the development server:

npm start
# or with cache clear
npm run start:clear

Run on specific platforms:

npm run ios          # iOS Simulator
npm run android      # Android Emulator
npm run web          # Web browser

Run on physical devices:

npm run ios:device
npm run android:device

πŸ“¦ Building

Development Build

npm run build:development

Preview Build

npm run build:preview

Production Build

npm run build:production

Platform-specific builds:

npm run android:preview   # Android preview APK
npm run ios:preview       # iOS preview build

πŸ§ͺ Code Quality

Linting

npm run lint                    # Check all files
npx eslint [file-path]          # Check specific file
npx eslint [file-path] --fix    # Auto-fix issues

Code Style

The project uses:

  • ESLint for code linting
  • Prettier for code formatting
  • TypeScript strict mode
  • Custom lint rules (see .eslintrc.js)

πŸ“± Project Structure

ansari-frontend/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ app/                   # Expo Router pages
β”‚   β”‚   β”œβ”€β”€ (app)/             # Authenticated routes
β”‚   β”‚   β”œβ”€β”€ (public)/          # Public routes
β”‚   β”‚   β”œβ”€β”€ share/             # Share functionality
β”‚   β”‚   └── welcome/           # Onboarding
β”‚   β”œβ”€β”€ assets/                # Images, fonts, etc.
β”‚   β”œβ”€β”€ components/            # Reusable components
β”‚   β”‚   β”œβ”€β”€ buttons/           # Button components
β”‚   β”‚   β”œβ”€β”€ chat/              # Chat-related components
β”‚   β”‚   β”œβ”€β”€ menu/              # Menu components
β”‚   β”‚   β”œβ”€β”€ prompts/           # Prompt components
β”‚   β”‚   β”œβ”€β”€ share/             # Share components
β”‚   β”‚   β”œβ”€β”€ svg/               # SVG icon components
β”‚   β”‚   └── threads/           # Thread management
β”‚   β”œβ”€β”€ constants/             # App constants
β”‚   β”œβ”€β”€ hooks/                 # Custom React hooks
β”‚   β”œβ”€β”€ i18n/                  # Internationalization
β”‚   β”œβ”€β”€ services/              # API services
β”‚   β”œβ”€β”€ store/                 # Redux store
β”‚   β”‚   β”œβ”€β”€ actions/           # Redux actions
β”‚   β”‚   β”œβ”€β”€ slices/            # Redux slices
β”‚   β”‚   └── types/             # TypeScript types
β”‚   β”œβ”€β”€ styles/                # Global styles
β”‚   └── utils/                 # Utility functions
β”œβ”€β”€ public/                    # Static assets (web)
β”œβ”€β”€ config/                    # Configuration files
└── docs/                      # Documentation

🌐 API Integration

The app connects to a backend API for:

  • User authentication
  • Chat conversations
  • Thread management
  • User preferences
  • Feedback submission

API configuration is managed through environment variables.

πŸ“² Deployment

Web Deployment (Vercel)

npm run build
# Deploy the 'dist' folder to Vercel

Mobile Deployment

Android

  1. Build APK/AAB:
npm run android:release
  1. Submit to Google Play:
eas submit -p android

iOS

  1. Build IPA:
npm run ios:release
  1. Submit to App Store:
eas submit -p ios

πŸ”„ OTA Updates

Deploy over-the-air updates:

npm run update:development   # Development channel
npm run update:preview       # Preview channel
npm run update:production    # Production channel

🀝 Contributing

  1. Create a feature branch from develop
  2. Make your changes
  3. Run linting: npm run lint
  4. Test on multiple platforms
  5. Create a pull request to develop

πŸ“„ Development Guidelines

See CLAUDE.md for detailed development guidelines including:

  • Code style requirements
  • Git workflow
  • Build commands
  • Common patterns

πŸ› Debugging

  • Use React Native Debugger for debugging
  • Sentry integration for error tracking in production
  • Console logs visible in Metro bundler terminal

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.


Made with ❀️ by Ansari Project Team

About

Frontend for Ansari

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages