This is a submission for Weekend Challenge: Generosity Edition
What I Built
Accessible Generosity Translator is a lightweight Java CLI application that bridges local grassroots initiatives with global support platforms.
In conflict zones and under-resourced regions—such as Gaza and Palestine—small volunteer groups often post urgent aid requests on social media in local dialects. These informal requests lack the language fluency and formal structure required by international donor networks.
This tool takes raw, unstructured local aid requests (e.g., informal Arabic notes) and leverages Google's Gemini API to instantly transform them into transparent, professional, English-language campaign briefs formatted in Markdown.
Demo
Sample Raw Input:
"نحن مجموعة متطوعين في خانيونس نحتاج بشكل عاجل 50 طرد غذائي و20 بطانية للأسر النازحة، التكلفة الإجمالية نحو 1500 دولار."
Generated Campaign Brief Output:
Emergency Food & Shelter Relief in Khan Younis
Urgent Need & Context
A local volunteer team in Khan Younis is requesting immediate assistance to provide basic food and shelter items for displaced families facing critical shortages.
| Item | Quantity | Estimated Cost (USD) |
|---|---|---|
| Food Packages | 50 | $1,100 |
| Blankets | 20 | $400 |
| Total | $1,500 |
Verification & Transparency Note
Direct grassroots request. Donors are advised to verify local delivery channels and request itemized purchase receipts upon distribution.
Code
View Full Source Code on GitHub Repository
// Core API Integration using Java 11+ Native HttpClient
private static String generateEnglishCampaign(String rawStory) throws Exception {
String systemInstruction = "You are an assistant for non-profit initiatives. "
+ "Translate and structure the following local initiative input into a transparent, professional English fundraising report. "
+ "Output MUST be formatted in Markdown with these headings: "
+ "1. Initiative Title, 2. Urgent Need & Context, 3. Breakdown of Items Needed (in a table), 4. Verification & Transparency Note. "
+ "Input story: " + rawStory.replace(""", "\"");
String jsonPayload = "{"
+ ""contents": [{"
+ " "parts": [{"text": "" + systemInstruction + ""}]"
+ "}]"
+ "}";
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create(GEMINI_URL))
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(jsonPayload))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
return parseResponse(response.body());
}
How I Built It
- Java 11+ HttpClient: Built completely dependency-free using Java's native HTTP features to ensure low memory footprint, instant execution, and portable deployment.
- Google Gemini 1.5 Flash: Used to parse raw contextual Arabic, extract pricing and quantity figures, translate intent accurately, and enforce structured Markdown tables.
- Prompt Engineering: Configured strict system instructions to guarantee every output includes a transparency disclaimer and itemized budgeting.
Prize Categories
- Best Use of Google AI: The application relies entirely on Google Gemini 1.5 Flash to perform multilingual context extraction, financial structuring, and fundraising report generation in real time.
Top comments (0)