πŸ”

Egglaying

Poultry Farm Management System Β· Docs

Introduction & deployment

Egglaying documentation

Deploy the app on your own stack, then roll it out to your team. The first half of this page covers setup; the second half explains how farm staff use each area of the product.

Introduction

Egglaying is layer-farm software: flocks, egg production and sales, feed and medicine, vaccinations, and client or supplier records (where the user’s role allows). Menus and home screens differ for admin, manager, and worker roles.

Requirements

Browser (everyone)

  • Chrome, Firefox, Safari, or Edge (current versions)

Self-hosting

  • Node.js 18+ (LTS recommended)
  • npm or compatible package manager
  • MongoDB (Atlas or self-hosted) with a connection string

Installation

  1. Get the project β€” unzip or clone into a folder (e.g. egglaying).
  2. Install dependencies
    npm install
  3. Configure environment β€” create .env.local (see Environment).
  4. Seed admin
    npm run seed:admin

    Details under Database seeds.

  5. Run dev server
    npm run dev

    Open http://localhost:3000 β€” sign in at /auth/signin.

  6. Optional sample data
    npm run seed:sample

Environment variables

Seeds read .env.local via scripts/load-env.ts. Do not commit secrets.

MONGODB_URI=mongodb+srv://USER:PASSWORD@cluster.example.mongodb.net/?appName=Cluster0
NEXTAUTH_SECRET=generate-a-long-random-string-for-production
NEXTAUTH_URL=http://localhost:3000
MONGODB_URI
Full connection string (Atlas IP allowlist + DB user).
NEXTAUTH_SECRET
Session signing secret β€” long random string in production.
NEXTAUTH_URL
Public site URL, e.g. https://yourdomain.com

Database seeds

Run from project root with a valid .env.local.

npm run seed:admin

Creates or updates the default admin (admin role).

  • Email: admin@egg.com
  • Default password: 123456 β€” change in production.
npm run seed:admin

npm run seed:sample

Optional demo data: users, flocks, eggs, feed, clients, etc.

npm run seed:sample

Production: rotate default passwords after first login. The live demo uses the same default password as seeds β€” see Live demo.

Role migration (legacy)

One-time: map legacy superadmin to admin.

npm run migrate:roles

Build & deploy

npm run build
npm run start

Set NEXTAUTH_URL to your HTTPS origin. On Vercel (and similar), copy all variables from .env.local into project settings.

Troubleshooting

  • MongoDB β€” check URI, Atlas network access, and database user.
  • Login β€” match seeded passwords; reset via Profile or an admin.
  • Build β€” npm install, Node 18+.
  • Session β€” align NEXTAUTH_SECRET and NEXTAUTH_URL with the live URL.

Features & usage

For people using the app

Sign in, move through the sidebar, and record work for your flocks.

Getting started

Sign in at /auth/signin. Your home dashboard depends on your role. Use the sidebar for all modules; on small screens, open the menu from the header. On a fresh self-hosted install you can use the seeded admin or /auth/register when registration is enabled.

Profile (/dashboard/profile) β€” name, contact, password for everyone. Preferences (/dashboard/preferences) β€” language, currency, sidebar labels (admins).

First week

  • Confirm flocks and bird numbers
  • Record eggs and sales (if your role allows)
  • Track feed and vaccination schedules
  • Add users with the right roles (admins)

Roles & access

Admin

Users, preferences, languages, all flocks, commercial data, reports, profile.

Manager

Operations, reports, clients, suppliers, egg sales β€” not admin-only tools.

Worker

Daily entry; menus limited to assigned flocks.

Dashboard

Role-specific overview: KPIs, shortcuts, vaccine reminders, and recent activity. Everything else lives under the sidebar groups (flocks, eggs, feed, etc.).

Flocks, eggs, feed & medicine

Flocks hold schedules, health, breeds, and expenses. Eggs record production and sales. Feed and medicine track stock, purchases, and usage against your birds.

Vaccinations

Log doses and follow schedules. Due items can appear on the home dashboard.

Clients & suppliers

Available to admin and manager: contacts, commercial fields, and activity history.

Reports & profile

Analytics where your role allows. Every user can update profile and password; admins manage preferences and translation tools.

Languages

Use the sidebar language switcher (or header on mobile) for English, Bengali, or Arabic. The page may reload. Admins can open Languages to edit JSON files under messages/ (translations use next-intl).

Live demo

Password for each account: 123456 (same as default seed users).

egglaying.vercel.app β†—
  • admin@egg.com β€” 123456
  • manager@egg.com β€” 123456
  • worker@egg.com β€” 123456