|
1 | | -GroundShare - Master AI Development Prompt & README.md |
2 | | -🎯 Project Overview |
3 | | -GroundShare is a mobile application designed to bridge the gap between complex official urban planning data and local community knowledge. It provides a transparent, map-based interface that aggregates municipal data (GIS, planning documents, infrastructure work) and crowdsourced community reports. The app empowers renters, homeowners, and real estate investors to make informed decisions and track real-time changes in their neighborhoods. |
| 1 | +# GroundShare |
4 | 2 |
|
5 | | -Target Language & UI: Strictly Hebrew (RTL - Right to Left). |
6 | | -Target Device: Google Pixel 7 (Android), strictly Mobile. |
| 3 | +Hebrew (RTL), mobile-first web app for urban planning transparency in Israel. |
| 4 | +Users view a map of their neighborhood, see official municipal planning data |
| 5 | +(construction permits, road work, city plans from Tel Aviv GIS, iplan, and |
| 6 | +mavat), and crowdsource community reports (noise, blockages, etc.). |
7 | 7 |
|
8 | | -🏗️ System Architecture & Tech Stack |
9 | | -The project follows a strict 3-tier architecture. |
| 8 | +Features: address comparison, favorites, reviews, voting, notifications, and a |
| 9 | +gamification system (XP / streaks). |
10 | 10 |
|
11 | | -1. Client-Side (Frontend) |
12 | | -Framework: React Native (Expo recommended for rapid development, or bare CLI if native modules demand it). |
| 11 | +## Live |
13 | 12 |
|
14 | | -State Management: Zustand or Redux Toolkit. |
| 13 | +- **Frontend**: hosted on Azure App Service (Israel Central) |
| 14 | +- **Backend API**: `https://app-groundshare-api.azurewebsites.net` |
| 15 | +- **Database**: Azure SQL Database (`sql-groundshare-il.database.windows.net`) |
15 | 16 |
|
16 | | -Navigation: React Navigation (Stack and Bottom Tabs). |
| 17 | +## Tech stack |
17 | 18 |
|
18 | | -Maps: react-native-maps (with custom markers and clustering). |
| 19 | +| Layer | Stack | |
| 20 | +|---|---| |
| 21 | +| Frontend | React 18, TypeScript, Vite, Tailwind CSS, React Router 7, `@vis.gl/react-google-maps` | |
| 22 | +| Mobile shell | Capacitor (iOS + Android) wrapping the Vite build | |
| 23 | +| Backend | ASP.NET Core 8 Web API (C#), pure ADO.NET (no EF Core), FluentValidation | |
| 24 | +| Database | Microsoft SQL Server with stored procedures | |
| 25 | +| Cloud | Azure App Service, Azure SQL, Azure Blob Storage, Azure Key Vault | |
| 26 | +| Auth | JWT (access 15min / refresh 14d with rotation), Google OAuth, BCrypt | |
19 | 27 |
|
20 | | -Styling: StyleSheet, styled-components, or NativeWind (Tailwind). Must strictly enforce RTL layout. |
| 28 | +## Project layout |
21 | 29 |
|
22 | | -2. Server-Side (Backend) |
23 | | -Framework: C# with ASP.NET Core Web API (.NET 8+). |
| 30 | +``` |
| 31 | +01-Database/ SQL schema + stored procedures (GroundShareDB.sql) |
| 32 | +02-Server/ ASP.NET Core 8 Web API (Controllers / DAL / BL / Services) |
| 33 | +03-Client/ React + Vite frontend + Capacitor native shell |
| 34 | +reference/ Design specs, screen mockups, Hebrew spec docs |
| 35 | +scripts/ Git hooks (gitleaks pre-commit) |
| 36 | +.github/ CI/CD workflows |
| 37 | +``` |
24 | 38 |
|
25 | | -Architecture: Clean Architecture or N-Tier (Controllers, Services, Repositories). |
| 39 | +## Documentation |
26 | 40 |
|
27 | | -ORM: Entity Framework Core (for basic CRUD) & Dapper (for executing complex Stored Procedures). |
| 41 | +- [SETUP.md](SETUP.md) — local development environment setup |
| 42 | +- [DEPLOY.md](DEPLOY.md) — Azure deployment guide |
| 43 | +- [SECURITY.md](SECURITY.md) — security architecture and policy |
| 44 | +- [CLAUDE.md](CLAUDE.md) — AI assistant context (architecture patterns, conventions) |
28 | 45 |
|
29 | | -Scraping/Integration: HtmlAgilityPack or PuppeteerSharp for scraping external governmental sites. |
| 46 | +## Quick start |
30 | 47 |
|
31 | | -AI Integration: Integration with an LLM API (OpenAI/Gemini) for the "Smart Comparison" text generation. |
| 48 | +```bash |
| 49 | +# Database: run 01-Database/GroundShareDB.sql in SSMS against local SQL Express |
32 | 50 |
|
33 | | -3. Database |
34 | | -Engine: Microsoft SQL Server. or firebase more likly to the active app |
| 51 | +# Backend (port 5227) |
| 52 | +cd 02-Server && dotnet run |
35 | 53 |
|
36 | | -Structure: Relational tables based on the provided ERD, utilizing explicit Primary/Foreign Keys. |
| 54 | +# Frontend (port 5173) |
| 55 | +cd 03-Client && npm install && npm run dev |
| 56 | +``` |
37 | 57 |
|
38 | | -Logic: Heavy use of Stored Procedures for complex queries (e.g., calculating the GroundShareScore, geospatial proximity searches). |
| 58 | +Backend requires `02-Server/appsettings.Development.json` (gitignored) with local |
| 59 | +SQL connection string, JWT key, and Google Maps API key. See |
| 60 | +[SETUP.md](SETUP.md) for the full config template. |
39 | 61 |
|
40 | | -📂 Directory Structure |
41 | | -The workspace must be organized exactly into these three root folders: |
| 62 | +## Security |
42 | 63 |
|
43 | | -Plaintext |
44 | | -/GroundShare_Project |
45 | | -│ |
46 | | -├── /Client # React Native application |
47 | | -│ ├── /src |
48 | | -│ │ ├── /assets # Images, fonts |
49 | | -│ │ ├── /components # Reusable UI components (Buttons, Inputs, Modals) |
50 | | -│ │ ├── /screens # Page-level components (Login, Map, Report, Compare) |
51 | | -│ │ ├── /navigation # React Navigation setup |
52 | | -│ │ ├── /services # Axios API calls |
53 | | -│ │ ├── /store # State management |
54 | | -│ │ └── /utils # Helpers, constants, RTL config |
55 | | -│ |
56 | | -├── /Server # C# .NET Web API |
57 | | -│ ├── /Controllers |
58 | | -│ ├── /Models # DTOs and Entities |
59 | | -│ ├── /Services # Business Logic, Scraping Services |
60 | | -│ ├── /Data # DbContext, Repositories |
61 | | -│ └── /Integrations # External API handlers (LLM, Gov APIs) |
62 | | -│ |
63 | | -└── /Database # SQL Scripts |
64 | | - ├── /Tables # CREATE TABLE scripts |
65 | | - ├── /Procedures # CREATE PROCEDURE scripts (e.g., CalculateScore) |
66 | | - └── /SeedData # Mock data for testing |
67 | | -⚙️ Core Business Logic & Features |
68 | | -1. Map & Data Aggregation |
69 | | -Official Data Integration: |
| 64 | +- All secrets live in Azure Key Vault in production (Managed Identity, no env vars) |
| 65 | +- Pre-commit hook runs `gitleaks protect --staged` to block accidental commits |
| 66 | +- Dependabot + CI scan every PR for vulnerable dependencies |
70 | 67 |
|
71 | | -Tel Aviv GIS: Scrape/pull data regarding infrastructure work. [Reference URL provided in prompt]. |
| 68 | +## License |
72 | 69 |
|
73 | | -Mavat (מנהל התכנון): Scrape Israeli planning documents. Use the Meirim open-source project as an architectural reference for parsing this complex data. |
74 | | - |
75 | | -GovMap/Gov API: Use Israeli government APIs for address autocomplete. |
76 | | - |
77 | | -Community Reports (Crowdsourcing): Users can report issues (noise, blockages) with images and coordinates. |
78 | | - |
79 | | -2. The Smart Element: "GroundShareScore" (AI Comparison) |
80 | | -Users can compare up to 3 addresses. |
81 | | - |
82 | | -The system calculates a score (0-100) based on 3 vectors: Official Planning (GIS/Mavat), Community Reports, and User Reviews. |
83 | | - |
84 | | -AI LLM Integration: The backend must send these raw calculated metrics to an LLM to generate a natural, conversational Hebrew summary explaining the pros, cons, and warnings for each address. |
85 | | - |
86 | | -3. Specific Business Rules (Strict Constraints) |
87 | | -Report Lifecycle: A community event expires after 3 days. The system must prompt the creator to verify if it's still active; otherwise, status changes to "Expired". |
88 | | - |
89 | | -Verification: An event receives a "Verified" badge (Blue Tick) only after 5 different users confirm it. |
90 | | - |
91 | | -Security: Passwords must be hashed. The frontend MUST NOT hold any external API keys (Mavat, OpenAI, GIS). All 3rd party integrations must route through the C# Server. Use JWT for authentication. |
92 | | - |
93 | | -🚀 Execution Instructions for the AI |
94 | | -Phase 1 Focus: The React Native Client |
95 | | -As per the human developer's request, initiate development with the Client folder. |
96 | | - |
97 | | -Initialize: Set up the React Native project with RTL (Hebrew) support enabled. |
98 | | - |
99 | | -Navigation: Scaffold the navigation map based on A4 Screens WorkFlow.jpg (Auth Stack -> Main Bottom Tabs: Search/Map, Favorites, Add Report, Comparison, Personal Area). |
100 | | - |
101 | | -Screens Development: Begin drafting the UI components exactly as shown in screens.pdf (Login/Registration, Map View with bottom sheets, Event Creation Form, AI Comparison Dashboard). |
102 | | - |
103 | | -Mocking: Create a mockData.ts file to simulate backend responses so the UI can be built and tested completely independently of the server. |
104 | | - |
105 | | -Implied Modern Best Practices to Enforce: |
106 | | -Frontend Security: Use .env variables for the internal API base URL. Do not expose sensitive endpoints. |
107 | | - |
108 | | -Error Handling: Implement global error boundaries in React Native and a global exception middleware in the .NET API. |
109 | | - |
110 | | -Geospatial Data: Ensure the map uses standard lat/lng coordinates and standardizes them before sending them to the backend. The SQL Server should eventually use geography spatial data types for radius-based queries. |
111 | | - |
112 | | -Performance: Optimize map rendering so clustering is used when hundreds of community reports or GIS points are loaded. |
| 70 | +Private project. All rights reserved. |
0 commit comments