|
| 1 | +# ParetOS Mock Data Setup |
| 2 | + |
| 3 | +## Overview |
| 4 | +This application has been modified to run without external authentication and API dependencies. All data is now served from comprehensive mock data sources, allowing the UI to function fully offline. |
| 5 | + |
| 6 | +## Changes Made |
| 7 | + |
| 8 | +### 1. Authentication Bypass |
| 9 | +- AWS Amplify authentication has been disabled |
| 10 | +- The app now automatically treats users as authenticated |
| 11 | +- No login is required to access any features |
| 12 | +- `AuthenticatedRoute` component always allows access |
| 13 | + |
| 14 | +### 2. Mock Data Service (`src/services/mockDataService.ts`) |
| 15 | +Created a comprehensive mock data service that provides: |
| 16 | + |
| 17 | +#### Mock User Data |
| 18 | +- Default demo user with full profile information |
| 19 | +- User ID: `bc382b6b-b3fc-4f9c-8f41-88280779ced0` |
| 20 | +- Includes XP, achievements, and learning progress |
| 21 | + |
| 22 | +#### Mock Experiences |
| 23 | +- **Training/Apprenticeship**: Development environment setup tutorials |
| 24 | +- **Product**: Portfolio product building experience |
| 25 | +- **Interviewing**: Technical interview preparation materials |
| 26 | + |
| 27 | +#### Mock Sprints |
| 28 | +- Pre-configured sprint data with missions and daily tasks |
| 29 | +- Includes planning and review sections |
| 30 | +- Team collaboration features |
| 31 | + |
| 32 | +#### Mock Mentorship Data |
| 33 | +- Sample coaches/mentors with profiles |
| 34 | +- Sample athletes/mentees |
| 35 | +- Relationship management data |
| 36 | + |
| 37 | +#### Mock Sanity CMS Data |
| 38 | +- **Technical Schemas**: React, Node.js, Database courses |
| 39 | +- **Economic Schemas**: Freelancing and startup economics |
| 40 | +- **Hub Schemas**: Community hubs for developers |
| 41 | + |
| 42 | +### 3. API Call Replacements |
| 43 | +All API calls have been replaced with mock service calls: |
| 44 | +- `fetchUser()` → `mockService.api.getUser()` |
| 45 | +- `fetchSprints()` → `mockService.api.getSprints()` |
| 46 | +- `fetchCoaches()` → `mockService.api.getCoaches()` |
| 47 | +- `fetchExperiences()` → `mockService.api.getExperiences()` |
| 48 | +- WebSocket connections removed (sprints use static data) |
| 49 | + |
| 50 | +### 4. Files Modified |
| 51 | +- `src/App.tsx` - Replaced Auth and API calls with mock service |
| 52 | +- `src/components/AuthenticatedRoute.tsx` - Bypassed authentication checks |
| 53 | +- `src/utils/queries/initialFetchQueries.ts` - Uses mock data providers |
| 54 | +- `src/offline-data/*.js` - Fixed exports for mock data files |
| 55 | + |
| 56 | +### 5. Mock Authentication Flow |
| 57 | +The mock auth service provides: |
| 58 | +- `signIn()` - Always returns success with demo user |
| 59 | +- `signOut()` - Clears local storage |
| 60 | +- `currentSession()` - Returns mock session |
| 61 | +- `signUp()` - Creates new mock user |
| 62 | +- `resetPassword()` - Returns success message |
| 63 | + |
| 64 | +## Running the Application |
| 65 | + |
| 66 | +```bash |
| 67 | +# Install dependencies |
| 68 | +npm install |
| 69 | + |
| 70 | +# Start development server |
| 71 | +npm start |
| 72 | +``` |
| 73 | + |
| 74 | +The application will run on `http://localhost:5173/` |
| 75 | + |
| 76 | +## Available Features with Mock Data |
| 77 | + |
| 78 | +1. **User Profile** - View and edit demo user profile |
| 79 | +2. **Learning Experiences** - Browse training, product, and interview prep modules |
| 80 | +3. **Sprint Management** - View and interact with sprint planning tools |
| 81 | +4. **Mentorship** - See coach/athlete relationships |
| 82 | +5. **Context Builder** - Browse technical and economic learning resources |
| 83 | +6. **Community Hubs** - Access developer community features |
| 84 | + |
| 85 | +## Data Persistence |
| 86 | +- Mock data is loaded fresh on each page reload |
| 87 | +- User modifications are stored in browser localStorage |
| 88 | +- No backend persistence (all changes are local) |
| 89 | + |
| 90 | +## Demo Credentials |
| 91 | +No login required! The app automatically uses a demo user account. |
| 92 | + |
| 93 | +## Extending Mock Data |
| 94 | +To add more mock data: |
| 95 | +1. Edit `src/services/mockDataService.ts` |
| 96 | +2. Add new data to the appropriate section |
| 97 | +3. Update the mock API methods if needed |
| 98 | + |
| 99 | +## Original Data Sources (Now Mocked) |
| 100 | +- AWS Cognito (Authentication) |
| 101 | +- AWS API Gateway + Lambda (REST APIs) |
| 102 | +- WebSocket connections (Real-time sprint updates) |
| 103 | +- Sanity CMS (Content management) |
| 104 | +- AWS S3 (File storage) |
| 105 | + |
| 106 | +All these services are now simulated locally with comprehensive mock data. |
0 commit comments