Inspiration
Morocco has been living through one of its most severe droughts in decades. Reservoir levels have dropped sharply across the country, and small farmers who make up a huge share of the rural economy often have to decide when and how much to irrigate with almost no localized, timely information. As a Computer and Software Systems Engineering student from Essaouira, I've seen firsthand how this crisis affects communities close to home. I wanted to build something that turns real environmental data into a decision a farmer can actually act on not just another awareness dashboard.
What it does
Aquifer is an AI-powered water advisor for farming communities facing water stress. It lets a user select their region and crop type, then get a clear, plain-language recommendation on whether to irrigate this week with the reasoning behind it, not just a yes/no answer.
Beyond individual advice, Aquifer includes a fair water allocation simulator that models a small watershed as a network of farms sharing one limited water source, and distributes that water proportionally based on need when supply runs short treating water scarcity as a resource-allocation problem, similar to how bandwidth gets shared across a network.
The app also includes:
- A regional water stress dashboard showing current stress levels across Moroccan regions
- A 12-month historical trend view per region
- An AI crop recommendation engine suggesting the most water-efficient crops to plant given current conditions
- A critical-stress alert banner to flag regions in urgent need
- A shareable summary card farmers or cooperatives can screenshot and share
- A language toggle (English / French / Arabic) so it's usable by the actual communities it's meant to serve
How I built it
I built Aquifer as a Next.js (App Router) application with TypeScript and Tailwind CSS, deployed on Vercel. To keep the architecture simple with no dedicated backend server, all AI logic runs through Next.js API routes, which call the Groq API (Llama 3.3 70B) server-side so the API key is never exposed to the client. Regional water stress data, crop water-need tables, and historical trends are stored as static JSON files rather than a database, since the scope didn't require persistent or user-generated data.
The fair water allocation feature is a deterministic algorithm I designed and implemented directly in TypeScript no AI involved that proportionally distributes a limited water supply across a fixed set of farms based on their need, capped by total available supply.
I worked iteratively with Claude Code throughout the build, first scaffolding the core app (dashboard, advisor, allocation simulator), then expanding it in a second phase with the trend charts, crop recommender, alerts, share cards, and multi-language support while keeping every existing feature working.
Challenges I ran into
- Balancing a genuinely technical feature (the network-style water allocation algorithm) with an approachable, non-technical UI that a farmer or community member could actually use.
- Working within a free-tier AI API (Groq) and making sure the app degrades gracefully instead of breaking if rate limits are hit during heavy use.
- Adding several new features in a second development phase without breaking the features already built and tested in the first phase.
- Keeping the scope realistic for a ~20-hour build while still making the project feel complete rather than like a prototype.
Accomplishments that I'm proud of
- Building a project tied to a real, local environmental crisis rather than a generic climate concept.
- Designing an original technical angle modeling water scarcity as a network allocation problem that draws on my own engineering background.
- Shipping a fully working, deployed app with AI reasoning, a custom algorithm, data visualization, and multilingual support within the hackathon timeframe.
What I learned
- How to structure an AI feature so it's genuinely explainable (showing the "why" behind a recommendation) rather than a black box.
- How to design serverless AI integrations using Next.js API routes to keep API keys secure without standing up a separate backend.
- How to scope an ambitious idea down to something achievable and complete within a tight timeframe, and then extend it safely afterward.
What's next for Aquifer
- Replacing mocked regional and historical data with real data sources (Moroccan hydraulic basin agencies, satellite-based drought indices).
- Partnering with local agricultural cooperatives to validate the recommendations against real field conditions.
- Expanding the fair allocation model to handle larger, more realistic watershed networks with dynamic supply changes.
Built With
- groq
- json
- llama-3.3
- next.js
- node.js
- react
- recharts
- tailwind-css
- typescript
- vercel
Log in or sign up for Devpost to join the conversation.