Skip to content

kadioko/MkulimaLink

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

82 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🌾 MkulimaLink β€” Agriculture Marketplace for Tanzania

Live API GitHub License

MkulimaLink connects farmers, buyers, and suppliers across Tanzania through a modern web marketplace with real-time market prices, weather data, and AI-powered insights.

πŸš€ Live Demo

Service URL Status
Frontend mkulimalink.vercel.app βœ… Live
Backend API mkulimalink-api-aa384e99a888.herokuapp.com βœ… Live
Health Check /api/health βœ… Running

Try it now β€” no login required to browse products, market prices, and weather.

✨ Features

Live & Working

  • Product Marketplace β€” Browse 19+ agricultural products with search, category/region filters
  • Market Prices β€” Real-time commodity prices across 6+ regions with trend indicators
  • Weather Forecasts β€” Current conditions for Dar es Salaam, Morogoro, Arusha, Iringa, Mbeya, Mwanza
  • User Authentication β€” Register/login with JWT, role-based access (farmer, buyer, supplier)
  • Dashboard β€” Personalized overview for logged-in users
  • AI Insights β€” Crop recommendations and market analysis
  • Premium Tier β€” Subscription plans for advanced features
  • Responsive Design β€” Mobile-first, works on all devices

Frontend Pages

Page Route Description
Home / Landing page with feature overview
Products /products Browse & filter all products
Product Detail /products/:id Individual product view
Market Prices /market Real-time commodity prices
Weather /weather Regional weather forecasts
Login / Register /login, /register Authentication
Dashboard /dashboard User dashboard (auth required)
Add Product /add-product List a product (auth required)
Transactions /transactions Order history (auth required)
AI Insights /ai-insights AI analysis (auth required)
Premium /premium Subscription plans (auth required)
Profile /profile User profile (auth required)

API Endpoints

Method Endpoint Description
GET /api/health Health check with data counts
GET /api/products List all products (19 items)
GET /api/market Market prices (8 price points)
GET /api/weather Weather data (6 regions)

πŸ›  Tech Stack

Frontend

Technology Purpose
React 18.3 UI framework
React Router 6 Client-side routing
React Query 3 Data fetching & caching
Zustand 4.5 State management
TailwindCSS 3.4 Styling
Lucide React Icons
Axios HTTP client
Framer Motion Animations
i18next Internationalization (EN/SW)
Recharts Charts & data visualization

Backend

Technology Purpose
Node.js 20+ Runtime
Express 4.21 Web framework
CORS Cross-origin support
MongoDB Atlas Database (connected)
Helmet Security headers

Deployment

Service Purpose
Vercel Frontend hosting + CI/CD
Heroku Backend API hosting
MongoDB Atlas Cloud database
GitHub Source control + auto-deploy triggers

πŸ“ Project Structure

MkulimaLink/
β”œβ”€β”€ frontend/                    # React SPA
β”‚   β”œβ”€β”€ public/
β”‚   β”‚   β”œβ”€β”€ index.html
β”‚   β”‚   └── manifest.json       # PWA config
β”‚   └── src/
β”‚       β”œβ”€β”€ api/axios.js         # API client (baseURL config)
β”‚       β”œβ”€β”€ components/
β”‚       β”‚   β”œβ”€β”€ Layout.js        # Main layout with nav
β”‚       β”‚   β”œβ”€β”€ ErrorBoundary.js # Error handling
β”‚       β”‚   └── Toast.js         # Notifications
β”‚       β”œβ”€β”€ pages/
β”‚       β”‚   β”œβ”€β”€ Home.js          # Landing page
β”‚       β”‚   β”œβ”€β”€ Products.js      # Product marketplace
β”‚       β”‚   β”œβ”€β”€ ProductDetail.js # Single product view
β”‚       β”‚   β”œβ”€β”€ Market.js        # Market prices
β”‚       β”‚   β”œβ”€β”€ Weather.js       # Weather forecasts
β”‚       β”‚   β”œβ”€β”€ Dashboard.js     # User dashboard
β”‚       β”‚   β”œβ”€β”€ Login.js         # Authentication
β”‚       β”‚   β”œβ”€β”€ Register.js      # Registration
β”‚       β”‚   β”œβ”€β”€ AddProduct.js    # Product listing form
β”‚       β”‚   β”œβ”€β”€ Transactions.js  # Order management
β”‚       β”‚   β”œβ”€β”€ AIInsights.js    # AI analysis
β”‚       β”‚   β”œβ”€β”€ Premium.js       # Subscription plans
β”‚       β”‚   └── Profile.js       # User profile
β”‚       β”œβ”€β”€ store/authStore.js   # Zustand auth state
β”‚       β”œβ”€β”€ i18n/                # Translations (EN/SW)
β”‚       └── App.js               # Routes & providers
β”œβ”€β”€ backend/                     # Express API (full version)
β”‚   β”œβ”€β”€ models/                  # Mongoose schemas
β”‚   β”œβ”€β”€ routes/                  # API route handlers
β”‚   β”œβ”€β”€ middleware/              # Auth, validation
β”‚   β”œβ”€β”€ services/                # Business logic
β”‚   └── server.js                # Express app entry
β”œβ”€β”€ index-final.js               # Production API server (Heroku)
β”œβ”€β”€ seedData.js                  # Database seeding script
β”œβ”€β”€ vercel.json                  # Vercel build config
β”œβ”€β”€ Procfile                     # Heroku process config
β”œβ”€β”€ package.json                 # Root dependencies
└── docker-compose.yml           # Docker setup

πŸš€ Quick Start

Prerequisites

Local Development

# Clone
git clone https://github.com/kadioko/MkulimaLink.git
cd MkulimaLink

# Install dependencies
npm install
cd frontend && npm install --legacy-peer-deps && cd ..

# Start frontend (connects to live API)
cd frontend && npm start
# Opens at http://localhost:3000

The frontend is pre-configured to connect to the live backend API at https://mkulimalink-api-aa384e99a888.herokuapp.com.

Environment Variables

Frontend (Vercel):

REACT_APP_API_URL=https://mkulimalink-api-aa384e99a888.herokuapp.com

Backend (Heroku):

MONGODB_URI=<MongoDB Atlas connection string>
NODE_ENV=production
PORT=<assigned by Heroku>

🚒 Deployment

Frontend β†’ Vercel

Automatic deployment on push to main branch.

  • Build command: cd frontend && npm install --legacy-peer-deps && npm run build
  • Output directory: frontend/build
  • SPA rewrites: All routes β†’ index.html

Backend β†’ Heroku

Automatic deployment via GitHub integration.

  • Procfile: web: node index-final.js
  • CORS: Configured for https://mkulimalink.vercel.app

🌍 Data Available

Products (19 items)

Vegetables, Grains, Fruits, Legumes, Dairy, Seeds, Inputs β€” across Dar es Salaam, Morogoro, Arusha, Iringa, Dodoma, Mwanza, Mbeya, Kilimanjaro.

Market Prices (8 price points)

Tomatoes, Maize, Onions, Bananas, Beans, Rice β€” with trend indicators (up/down/stable).

Weather (6 regions)

Temperature, humidity, and conditions for major farming regions.

🀝 Contributing

  1. Fork the repository
  2. Create feature branch (git checkout -b feature/your-feature)
  3. Commit changes (git commit -m 'Add your feature')
  4. Push to branch (git push origin feature/your-feature)
  5. Open a Pull Request

πŸ“„ License

MIT License β€” see LICENSE for details.

πŸ“ž Support


Made with ❀️ for Tanzania's Farmers

About

🌾 Agriculture super-app for East Africa - Marketplace, micro-loans, insurance, delivery tracking, group buying, equipment rental & AI insights. Built with MERN stack + Socket.io.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors