Mobile & Web App cho Smart City Platform
CityLens Web App là ứng dụng React Native được xây dựng với Expo, cho phép người dùng:
- Xem thông tin thời tiết và chất lượng không khí theo thời gian thực
- Theo dõi tình trạng giao thông
- Phản ánh các vấn đề hiện trường (xả rác, lấn chiếm, v.v.)
- Tương tác với AI Assistant để tìm kiếm thông tin
- Quản lý hồ sơ cá nhân
| Thành phần | Công nghệ | Phiên bản |
|---|---|---|
| Framework | React Native + Expo | 0.76.5 / 52 |
| Language | TypeScript | 5.3.3 |
| Navigation | React Navigation | 7.x |
| State Management | React Context API | - |
| Maps | React Native Maps | Latest |
| UI Components | Expo Vector Icons | Latest |
| Build Tool | Expo CLI | Latest |
- Node.js 20 trở lên
- npm 10 trở lên
- Backend API đang chạy (http://localhost:8000)
chmod +x scripts/setup.sh
./scripts/setup.shBước 1: Clone repository
git clone https://github.com/PKA-Open-Dynamics/CityLens.git
cd CityLens/web-appBước 2: Cài đặt dependencies
npm installBước 3: Cấu hình environment
cp .env.example .env
# Chỉnh sửa .env nếu cần thay đổi API URLBước 4: Chạy development server
npm start
# Chọn platform: w (Web), a (Android), i (iOS)npm run build:web
# Output: web-build/npm install -g eas-cli
eas build --platform android --profile productioneas build --platform ios --profile productionweb-app/
├── src/
│ ├── components/ # React components tái sử dụng
│ │ ├── Avatar.tsx
│ │ ├── FloatingAIButton.tsx
│ │ └── ReportCard.tsx
│ ├── config/ # Cấu hình ứng dụng
│ │ └── env.ts # Environment variables
│ ├── contexts/ # React Context providers
│ │ └── AuthContext.tsx # Authentication context
│ ├── navigation/ # Navigation configuration
│ │ └── RootNavigator.tsx # Root navigation setup
│ ├── screens/ # Màn hình ứng dụng
│ │ ├── LoginScreen.tsx
│ │ ├── RegisterScreen.tsx
│ │ ├── ExploreScreen.native.tsx
│ │ ├── MapScreen.native.tsx
│ │ ├── ReportScreen.native.tsx
│ │ ├── ProfileScreen.native.tsx
│ │ └── ...
│ └── services/ # API services
│ ├── auth.ts # Authentication API
│ ├── weather.ts # Weather & AQI API
│ └── traffic.ts # Traffic API
├── assets/ # Static assets
│ ├── icon.png
│ ├── splash-icon.png
│ └── videos/
├── scripts/ # Build & setup scripts
│ ├── setup.sh # Setup script (Linux/Mac)
│ ├── setup.ps1 # Setup script (Windows)
│ ├── start.sh # Start script (Linux/Mac)
│ ├── start.ps1 # Start script (Windows)
│ ├── build.sh # Build script (Linux/Mac)
│ └── build.ps1 # Build script (Windows)
├── App.tsx # Entry point
├── app.json # Expo config
├── package.json # Dependencies
└── tsconfig.json # TypeScript config
# API Base URL
EXPO_PUBLIC_API_BASE_URL=http://localhost:8000/api/v1Lưu ý:
- File
.envkhông được commit vào git - Sử dụng
.env.examplelàm template - Biến môi trường phải bắt đầu với
EXPO_PUBLIC_
expo: Expo SDK frameworkreact&react-native: Core framework@react-navigation/*: Navigationreact-native-maps: Maps integration@react-native-async-storage/async-storage: Storage
typescript: Type checking@types/react: TypeScript types
Xem package.json cho danh sách đầy đủ.
npm start # Start Expo dev server
npm run android # Run on Android
npm run ios # Run on iOS
npm run web # Run on web
npm run build:web # Build for production (web)rm -rf node_modules package-lock.json
npm installnpx expo start --port 8082- Kiểm tra backend đã chạy
- Kiểm tra
EXPO_PUBLIC_API_BASE_URLtrong.env - Kiểm tra CORS settings
Xem CHANGELOG.md cho lịch sử thay đổi chi tiết.
Xem DEPENDENCIES.md cho thông tin chi tiết về licenses.
Xem CONTRIBUTING.md cho hướng dẫn đóng góp.
GNU General Public License v3.0 (GPL-3.0)
Copyright (C) 2025 CityLens Contributors
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Xem LICENSE cho toàn văn.
- Repository: https://github.com/PKA-OpenDynamics/CityLens
- Backend: backend/README.md
- Web Dashboard: web-dashboard/README.md
- Issues: https://github.com/PKA-OpenDynamics/CityLens/issues
Made with ❤️ by CityLens Contributors
