|
| 1 | +# @appgram/react Demo |
| 2 | + |
| 3 | +Interactive demo app for testing the `@appgram/react` library. |
| 4 | + |
| 5 | +## Quick Start |
| 6 | + |
| 7 | +From the `packages/appgram-react` directory: |
| 8 | + |
| 9 | +```bash |
| 10 | +# Option 1: Full setup (builds library + installs demo + runs) |
| 11 | +npm run demo |
| 12 | + |
| 13 | +# Option 2: Step by step |
| 14 | +npm install # Install library dependencies |
| 15 | +npm run build # Build the library |
| 16 | +cd demo |
| 17 | +npm install # Install demo dependencies |
| 18 | +npm run dev # Start demo at http://localhost:5173 |
| 19 | +``` |
| 20 | + |
| 21 | +## Configuration |
| 22 | + |
| 23 | +Edit `demo/src/App.tsx` to update the config: |
| 24 | + |
| 25 | +```tsx |
| 26 | +const CONFIG = { |
| 27 | + projectId: 'your_project_id', // Your Appgram project ID |
| 28 | + orgSlug: 'your_org', // Your organization slug |
| 29 | + projectSlug: 'your_project', // Your project slug |
| 30 | + // apiUrl: 'http://localhost:3000', // For local API testing |
| 31 | +} |
| 32 | +``` |
| 33 | + |
| 34 | +## What's Included |
| 35 | + |
| 36 | +The demo showcases: |
| 37 | + |
| 38 | +1. **Components Tab** - Pre-built `WishList` with search, filters, and click handling |
| 39 | +2. **Hooks Tab** - Custom UI built with `useWishes` and `useVote` hooks |
| 40 | +3. **Roadmap Tab** - `RoadmapBoard` component in kanban layout |
| 41 | +4. **Releases Tab** - `ReleaseList` component in timeline layout |
| 42 | +5. **Help Tab** - `HelpCollections` component with search |
| 43 | +6. **Support Tab** - `SupportForm` for ticket submission |
| 44 | + |
| 45 | +## Development |
| 46 | + |
| 47 | +To develop the library and see changes in the demo: |
| 48 | + |
| 49 | +**Terminal 1** (library watch mode): |
| 50 | +```bash |
| 51 | +cd packages/appgram-react |
| 52 | +npm run dev |
| 53 | +``` |
| 54 | + |
| 55 | +**Terminal 2** (demo dev server): |
| 56 | +```bash |
| 57 | +cd packages/appgram-react/demo |
| 58 | +npm run dev |
| 59 | +``` |
| 60 | + |
| 61 | +Changes to library files will trigger a rebuild, and Vite will hot-reload the demo. |
| 62 | + |
| 63 | +## Testing with Mock Data |
| 64 | + |
| 65 | +If you don't have an Appgram project, the components will show loading states and then empty/error states. To test the UI: |
| 66 | + |
| 67 | +1. Set up a local Appgram API server |
| 68 | +2. Update `CONFIG.apiUrl` to point to your local server |
| 69 | +3. Or create a test project at appgram.dev |
0 commit comments