A React Native Expo application for waste identification and recycling center location.
AWEXPO/
├── src/ # Frontend React Native code
│ ├── screens/ # Application screens
│ ├── navigation/ # Navigation configuration
│ ├── constants/ # Design system (colors, typography)
│ ├── services/ # API services
│ └── types/ # TypeScript type definitions
├── backend/ # Node.js Express server
│ ├── models/ # MongoDB schemas
│ ├── routes/ # API endpoints
│ ├── middleware/ # Authentication & validation
│ └── server.js # Main server file
├── assets/ # Images and static files
└── docker-compose.yml # Docker configuration
The frontend connects to the backend through src/services/api.ts:
- Base URL:
http://localhost:5000/api(development) - Authentication: JWT tokens stored in AsyncStorage
- HTTP Client: Axios with request/response interceptors
- Error Handling: Centralized error management
POST /api/auth/register- User registrationPOST /api/auth/login- User authenticationGET /api/auth/profile- Get user profileGET /api/health- Server health check
- User registers/logs in through frontend
- Backend validates credentials and returns JWT token
- Frontend stores token in AsyncStorage
- All subsequent API calls include token in Authorization header
- Backend validates token and returns user data
The Engineer Override is a development/testing feature that allows bypassing authentication:
- Skip login during development
- Test app functionality without backend
- Debug UI/UX without authentication issues
- Located in
src/screens/OnboardingScreen.tsx - Red "ENG OVERRIDE" link at bottom of login screen
- Calls
onComplete()directly, bypassing authentication - Only visible during development
- Navigate to login screen
- Scroll to bottom
- Tap "ENG OVERRIDE" link
- App proceeds to main interface
- Node.js (v16+)
- npm or yarn
- Expo CLI
- MongoDB Atlas account
# Install dependencies
npm install
# Start Expo development server
npm start# Navigate to backend directory
cd backend
# Install dependencies
npm install
# Set environment variables
# Create .env file with MongoDB connection string
# Start server
npm run dev:cloudCreate .env file in backend directory:
MONGODB_URI=mongodb+srv://username:password@cluster.mongodb.net/database
JWT_SECRET=your_jwt_secret_key
PORT=5000
- User authentication (register/login)
- Camera integration for waste scanning
- Image upload and management
- Recycling center locator
- Waste categorization
- Consistent color palette
- Typography hierarchy (Helvetica, Roboto, Courier)
- Responsive layouts
- Modern UI components
- Bottom tab navigation
- Stack navigation for screens
- Onboarding flow
- Create screen in
src/screens/ - Add navigation route in
src/navigation/ - Create API endpoint in
backend/routes/ - Update API service in
src/services/
- Use design system constants (
colors.ts,theme.ts) - Follow component structure patterns
- Maintain responsive design principles
# Build and run with Docker
docker-compose up --build- Update API base URL for production
- Configure environment variables
- Remove Engineer Override in production
- Set up proper MongoDB security
- Backend not running: Check if server is started on port 5000
- Authentication errors: Verify MongoDB connection
- Image upload issues: Check camera permissions
- Navigation problems: Verify route configurations
- Use Engineer Override to bypass auth issues
- Check browser console for API errors
- Verify environment variables are loaded