Skip to content

"Multi-user platform connecting organic farmers and consumers for direct purchase of sustainable products. Built with Next.js ,PostgreSQL & Docker"

Notifications You must be signed in to change notification settings

gmartincor/Ecomama

Repository files navigation

Ecomama - Platform for Farmers and Consumers

A multi-tenancy platform that connects farmers and consumers in local communities for the direct purchase of organic products.

Tech Stack

  • Framework: Next.js 15+ (App Router)
  • Language: TypeScript
  • Database: PostgreSQL
  • ORM: Prisma
  • Authentication: NextAuth.js
  • Styling: Tailwind CSS
  • Validation: Zod
  • Package Manager: pnpm
  • PWA: Progressive Web App support

Features

  • 🌱 Progressive Web App: Installable on any device
  • 🏘️ Communities: Local farmer-consumer communities
  • 🌾 Listings: Direct product offers and demands
  • 📅 Events: Community gatherings and markets
  • 👥 Memberships: Community membership management
  • 🔐 Authentication: Secure user authentication with roles
  • 📱 Responsive: Mobile-first responsive design

Project Structure

ecomama/
├── app/                    # Next.js App Router
├── components/             # Shared components
│   ├── ui/                # Base UI components
│   ├── layout/            # Layout components
│   └── common/            # Common components
├── features/              # Feature modules
│   ├── auth/
│   ├── communities/
│   ├── memberships/
│   ├── profiles/
│   ├── listings/
│   ├── events/
│   ├── landing/          # Landing page components
│   ├── pwa/              # PWA functionality
│   └── admin/
├── lib/                   # Utilities and configurations
│   ├── prisma/           # Prisma client
│   ├── auth/             # NextAuth configuration
│   ├── validations/      # Zod schemas
│   └── utils/            # Utility functions
├── types/                 # Global TypeScript types
├── public/                # Static assets
│   ├── icons/            # PWA icons
│   ├── manifest.json     # PWA manifest
│   └── sw.js             # Service Worker
└── prisma/               # Schema and migrations

Getting Started

Prerequisites

  • Node.js 20+
  • pnpm (recommended) or npm
  • PostgreSQL 14+

Installation

  1. Clone the repository:
git clone https://github.com/gmartincor/Ecomama.git
cd Ecomama
  1. Install dependencies:
pnpm install
  1. Set up environment variables:
cp .env.example .env

Edit .env and configure your database URL and other variables.

  1. Set up the database:
# Generate Prisma Client
pnpm db:generate

# Run migrations
pnpm db:migrate

# Seed the database (optional)
pnpm db:seed
  1. Run the development server:
pnpm dev

Open http://localhost:3000 in your browser.

Deployment

See DEPLOYMENT.md for detailed instructions on deploying to Vercel with Postgres database.

Quick Deploy to Vercel

Deploy with Vercel

  1. Click the button above
  2. Add a Postgres database from the Storage tab
  3. Configure environment variables (AUTH_SECRET)
  4. Deploy!

PWA Installation

The app is installable as a Progressive Web App:

  1. Visit the landing page
  2. Click "Instalar App" button in the navigation
  3. Confirm installation in your browser
  4. App will be added to your home screen

To regenerate PWA icons:

pnpm pwa:icons

About

"Multi-user platform connecting organic farmers and consumers for direct purchase of sustainable products. Built with Next.js ,PostgreSQL & Docker"

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published