@dcl-regenesislabs/mobile-hub 1.0.0-20601593503.commit-26e252e → 1.0.0-20602542878.commit-e36a386

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,136 @@
1
+ # Mobile Curation
2
+
3
+ A web application for curating and managing Decentraland parcels and scene groups on mobile devices.
4
+
5
+ ## Features
6
+
7
+ ### Map View
8
+ - Interactive canvas-based map rendering of Decentraland's Genesis City
9
+ - Satellite tile images from the [genesis-city repository](https://github.com/decentraland/genesis-city)
10
+ - Pan and zoom controls with mouse/touch support
11
+ - Hover coordinates display
12
+ - Click-to-select parcels
13
+
14
+ ### Scene Groups
15
+ - Create, view, edit, and delete groups of parcels
16
+ - Visual selection of parcels on the map
17
+ - Floating top bar for mode selection (View/Create/Edit/Delete)
18
+ - Persisted to backend API (mobile-bff)
19
+
20
+ ### Authentication
21
+ - Decentraland SSO integration via `@dcl/single-sign-on-client`
22
+ - Wallet connection using `decentraland-connect`
23
+ - Navbar with Sign In/Sign Out and avatar display
24
+ - `signedFetch` for authenticated API requests with cryptographic signatures
25
+ - `useAuthenticatedFetch` hook for easy authenticated requests
26
+
27
+ ## Tech Stack
28
+
29
+ - **React 18** with TypeScript
30
+ - **Vite** for development and build
31
+ - **decentraland-connect** for wallet connections
32
+ - **@dcl/crypto** for request signing
33
+ - **react-router-dom** for routing
34
+
35
+ ## Project Structure
36
+
37
+ ```
38
+ src/
39
+ ├── components/
40
+ │ └── Navbar/ # Decentraland navbar with auth
41
+ ├── config/
42
+ │ ├── env/
43
+ │ │ ├── dev.json # Development config (MOBILE_BFF_URL, etc.)
44
+ │ │ └── prd.json # Production config
45
+ │ └── index.ts # Config loader
46
+ ├── contexts/
47
+ │ └── auth/
48
+ │ ├── AuthProvider.tsx # Auth context provider
49
+ │ ├── types.ts # Auth types
50
+ │ ├── utils.ts # Auth utilities
51
+ │ └── index.ts
52
+ ├── features/
53
+ │ └── map/
54
+ │ ├── api/
55
+ │ │ └── sceneGroupsApi.ts # Scene groups API client
56
+ │ ├── components/
57
+ │ │ ├── GroupsSidebar/ # Scene groups sidebar UI
58
+ │ │ ├── MapCanvas.tsx # Canvas rendering
59
+ │ │ └── ...
60
+ │ ├── context/
61
+ │ │ ├── GroupsContext.tsx # Scene groups state + API
62
+ │ │ ├── MapContext.tsx # Map viewport state
63
+ │ │ └── useGroupsHooks.ts # Custom hooks
64
+ │ ├── types/
65
+ │ │ └── index.ts # Type definitions
66
+ │ └── utils/
67
+ │ └── groupUtils.ts # Group utilities
68
+ ├── hooks/
69
+ │ └── useAuthenticatedFetch.ts # Authenticated fetch hook
70
+ ├── pages/
71
+ │ └── MapPage.tsx # Main map view
72
+ ├── utils/
73
+ │ └── fetch.ts # signedFetch implementation
74
+ └── App.tsx
75
+ ```
76
+
77
+ ## Getting Started
78
+
79
+ ```bash
80
+ # Install dependencies
81
+ npm install
82
+
83
+ # Start development server
84
+ npm run dev
85
+
86
+ # Build for production
87
+ npm run build
88
+ ```
89
+
90
+ ## Environment Variables
91
+
92
+ Set `VITE_REACT_APP_DCL_DEFAULT_ENV` to control the environment:
93
+ - `dev` - Development (uses decentraland.zone)
94
+ - `prd` - Production (uses decentraland.org)
95
+
96
+ ---
97
+
98
+ ## API Integration
99
+
100
+ Scene groups are persisted to the [mobile-bff](../mobile-bff) backend.
101
+
102
+ ### Backend API (mobile-bff)
103
+
104
+ | Method | Path | Description |
105
+ |--------|------|-------------|
106
+ | GET | `/backoffice/scene-groups` | List all scene groups |
107
+ | POST | `/backoffice/scene-groups` | Create a new scene group |
108
+ | PUT | `/backoffice/scene-groups/:id` | Update a scene group |
109
+ | DELETE | `/backoffice/scene-groups/:id` | Delete a scene group |
110
+
111
+ All backoffice endpoints require:
112
+ 1. Signed requests via `signedFetch`
113
+ 2. Wallet address in `ALLOWED_USERS` env var on the backend
114
+
115
+ ### Frontend Implementation
116
+
117
+ - **API Client**: `src/features/map/api/sceneGroupsApi.ts`
118
+ - **State Management**: `src/features/map/context/GroupsContext.tsx`
119
+ - **Hooks**: `useGroupsState()`, `useGroupsDispatch()`, `useGroupsApi()`
120
+
121
+ Groups are loaded automatically when a user signs in.
122
+
123
+ ### Configuration
124
+
125
+ Set `MOBILE_BFF_URL` in config files:
126
+ - `src/config/env/dev.json` - Development (localhost:3000)
127
+ - `src/config/env/prd.json` - Production
128
+
129
+ ---
130
+
131
+ ## Future Enhancements
132
+
133
+ - [ ] **Parcel metadata fetching** - Load parcel names/descriptions from Decentraland API
134
+ - [ ] **Scene preview** - Show scene thumbnails when hovering groups
135
+ - [ ] **Sharing** - Generate shareable links for scene groups
136
+ - [ ] **Offline mode** - Cache groups locally when offline
Binary file
package/index.html CHANGED
@@ -2,9 +2,9 @@
2
2
  <html lang="en">
3
3
  <head>
4
4
  <meta charset="UTF-8" />
5
- <link rel="icon" type="image/svg+xml" href="/vite.svg" />
5
+ <link rel="icon" type="image/svg+xml" href="/dcl-regenesislabs.png" />
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
- <title>mobile-curation</title>
7
+ <title>DCL Regenesis Labs Mobile Hub</title>
8
8
  <script type="module" crossorigin src="/assets/index-BH66FyTx.js"></script>
9
9
  <link rel="stylesheet" crossorigin href="/assets/index-CcyN_bjy.css">
10
10
  </head>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dcl-regenesislabs/mobile-hub",
3
- "version": "1.0.0-20601593503.commit-26e252e",
3
+ "version": "1.0.0-20602542878.commit-e36a386",
4
4
  "description": "Mobile Hub",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -18,5 +18,5 @@
18
18
  "url": "git+https://github.com/decentraland/mobile-hub.git"
19
19
  },
20
20
  "homepage": "",
21
- "commit": "26e252ea7da4655ec42244cf0e3f8da7e256833e"
21
+ "commit": "e36a386f5cb29236d003282dbe9c0ade4b37c84a"
22
22
  }
package/vite.svg DELETED
@@ -1 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>