BioLumin
Hey everyone,
I wanted to share a bit about what I've been busy building lately. It's been an exciting period of diving deep into full-stack development with Next.js, exploring AI integrations, and solidifying foundational templates. Here's a rundown of four key projects:
1. BioLumin: AI-Powered AgriTech for a Greener Future
BioLumin is an ambitious AI-powered web application designed to revolutionize farm management and bio-production, particularly tailored for a fictional setting involving "Lumin Bioproducers" in "Valyria."
Purpose of BioLumin
The core idea behind BioLumin is to empower agricultural producers with data-driven insights and intelligent tools to optimize their yields, promote sustainable practices, and connect with a broader ecosystem. It aims to make advanced AgriTech accessible, helping producers manage everything from soil health to market sales in one integrated platform.
Core Functions
BioLumin is packed with features, including:
- AI-Powered Farm Management: Detailed soil analysis, crop health monitoring, and optimized bioproduction strategies.
- Precision Fertilizer Advisor: Tailored fertilizer recommendations based on soil data and crop needs, leveraging AI (like Google's Gemini).
- Comprehensive Dashboard: At-a-glance overview with stats cards (
BioStatCards
), activity charts (FarmActivityChart
), recent activity tables (RecentActivityTable
), weather widgets (WeatherWidget
), and quick farm input forms (QuickFarmInput
). - Farm & Crop Cycle Management: Detailed tracking of farms, crop cycles, soil analyses, and growth records.
- Marketplace: A platform for users to list and discover agricultural products.
- Education Hub: A curated space for learning about bio-farming and sustainable agriculture.
- News & Hiring Portals: Keeping users updated and facilitating connections for agricultural work.
- Social Map (
FarmMap
): A Leaflet-based map to visualize farm locations and foster community. - AI Chatbot: Farm-specific advice powered by Google's Generative AI, with conversation history.
- User Messaging System: Direct user-to-user communication.
- User Search & Profiles: Public user profiles showcasing contributions.
- API Key Management: For programmatic access to BioLumin services.
Technical Requirements
- Technology Stack:
- Frontend: Next.js (App Router), React 19, Tailwind CSS, Shadcn/UI components (extensive use, e.g.,
Card
,Button
,Table
,Select
), Recharts (for charts), Leaflet.js (for maps). - Backend: tRPC, Prisma ORM.
- Database: PostgreSQL.
- Authentication: NextAuth.js (Auth.js) with Google and Credentials providers.
- AI Integration: Google Generative AI (
@google/generative-ai
) for chatbot, soil AI, and fertilizer advisor features. - File Uploads: UploadThing for image uploads (marketplace items, user profiles, etc.).
- PWA Features: Service Worker, Push Notifications via
web-push
.
- Frontend: Next.js (App Router), React 19, Tailwind CSS, Shadcn/UI components (extensive use, e.g.,
- Database Schema Highlights:
User
,ApiKey
Farm
,SoilAnalysis
,Crop
,BioproductionCycle
,GrowthRecord
MarketplaceItem
,MarketplaceCategory
EducationalContent
,UserViewedContent
NewsArticle
JobPosting
ChatSession
,ChatMessage
,UserMessage
- Key Features:
- Responsive design with a modular dashboard layout (
AppSidebar
,SiteHeader
). - Extensive use of server components and client components with
"use client"
. - Robust form handling with
react-hook-form
andzod
for validation (e.g.,farmFormSchema.ts
). - Dynamic routing for detailed views and editing (e.g.,
/dashboard/farms/[farmId]
). - Comprehensive settings area for managing profile, API keys, and user-generated content.
- PWA support with
manifest.json
and service worker.
- Responsive design with a modular dashboard layout (
BioLumin showcases a full-featured platform approach, integrating various technologies to solve complex domain-specific problems with a user-centric dashboard and a public-facing landing page (components in landing/
).
2. Next.js SaaS Boilerplate: Accelerating Development
Underpinning projects like BioLumin is a powerful Next.js SaaS Boilerplate I've developed. This boilerplate is designed to be a robust foundation for building full-stack SaaS applications quickly and efficiently.
Purpose of the Boilerplate
The goal is to minimize repetitive setup and provide a feature-rich starting point for new projects. It incorporates best practices for structure, authentication, data management, and UI development, allowing developers to focus on unique application logic.
Core Features & Structure
- Project Structure: Organized into
app/
(routing & UI),components/
(reusable UI),lib/
(utilities & validators),server/
(backend logic - tRPC, DB, Auth), andpublic/
. - Authentication: Pre-configured NextAuth.js (Auth.js) with Prisma adapter, supporting OAuth (e.g., Google) and Credentials-based login.
- API Layer: tRPC for type-safe client-server communication, with clear router organization (
server/api/routers/
). - Database: Prisma ORM setup for PostgreSQL, including a base schema and DB client (
server/db.ts
). - UI Foundation:
- Tailwind CSS for styling.
- A comprehensive library of UI components (largely based on Shadcn/UI principles) located in
components/ui/
. Examples includeButton
,Card
,Input
,Select
,Table
,Dialog
,Sheet
,Sidebar
,Tooltip
, etc. - Pre-built layouts for dashboard (
dashboard/layout.tsx
) and landing pages.
- State Management & Forms:
react-hook-form
andzod
for robust form handling and validation. - Server Actions & API Routes: Demonstrates patterns for both Next.js Server Actions (
app/actions.ts
) and traditional API routes for NextAuth and UploadThing. - File Uploads: Integrated UploadThing (
app/api/uploadthing/
) for easy file storage. - PWA Ready: Includes basic PWA setup (
PWAHandler
,PWAContext
,PWAProvider
,sw.js
,manifest.json
). - Settings Pages: A modular settings area (
dashboard/settings/
) for profile, API keys, and content management, leveraging aSettingsLayout
andManageCategorySection
component for DRY principles. - Type Safety: End-to-end type safety with TypeScript, tRPC, and Zod.
Technical Stack
- Framework: Next.js (App Router)
- Language: TypeScript
- Styling: Tailwind CSS
- UI Components: Custom Radix UI-based components (Shadcn/UI style)
- API: tRPC
- ORM: Prisma
- Database: PostgreSQL
- Authentication: NextAuth.js (Auth.js)
- File Uploads: UploadThing
This boilerplate is the backbone that allows for rapid development of complex applications like BioLumin, ensuring consistency and maintainability.
3. PWA Foundation: Engaging User Experiences
Integrated within the SaaS boilerplate (and thus, BioLumin) is a PWA (Progressive Web App) foundation designed to enhance user engagement through app-like features.
Purpose of the PWA Foundation
To provide a seamless, installable experience and enable features like push notifications, aiming for better user retention and direct communication channels.
Core Features
- Service Worker: A custom service worker (
public/sw.js
) for caching strategies (though not detailed in provided files, it's a standard PWA component) and handling push notifications. - Manifest File:
public/manifest.json
to define app metadata for installability (name, icons, start URL, display mode). - Push Notifications:
- Backend setup using
web-push
library (app/actions.ts
) to send notifications. - Client-side subscription management via
PWAProvider
andPWAContext
(app/_providers/PWAProvider.tsx
,app/_context/PWAContext.tsx
). - Server actions (
app/actions.ts
) forsubscribeUser
,unsubscribeUser
, andsendNotification
.
- Backend setup using
- Install Prompt: Logic to handle the
beforeinstallprompt
event for custom install UI (though the UI componentsInstallPrompt
andPushNotificationManager
were removed fromPWAHandler.tsx
, the underlying capability can be re-added). - Environment Variable Configuration: Relies on VAPID keys (public and private) and a contact email stored in environment variables.
Technical Stack
- Next.js
- Service Workers API
- Push API
web-push
(Node.js library)- VAPID protocol for secure push notifications
This foundation makes it straightforward to add PWA capabilities to any Next.js project built on the boilerplate.
4. TRNC (KKTC) Identity Validator CLI: A Niche Utility
While not directly part of the web applications, the Prisma schema hints at a utility for validating Turkish Republic of Northern Cyprus (TRNC / KKTC) national identity numbers, as evidenced by the KktcIdRecord
model. This suggests a backend function or a standalone CLI tool.
Purpose of the Validator
To provide a quick and reliable way to check the validity of TRNC national identity numbers. This is often used in systems requiring user verification or data entry validation specific to that region.
Core Features (Inferred)
- Input: Takes a TRNC ID number.
- Validation Logic: Implements the specific checksum or structural validation algorithm for TRNC IDs.
- Output: Indicates whether the provided ID is valid or invalid.
- Logging (Optional): The
KktcIdRecord
model (with fields likeidentityNumber
,isValid
,validatedAt
,sourceIp
,userAgent
,userId
) strongly suggests that validation attempts could be logged to the database, possibly for auditing or tracking usage if exposed via an API.
Technical Stack (Assumed for a CLI/Backend Utility)
- Language: Node.js (likely TypeScript, given the project context).
- Database Interaction (Optional Logging): Prisma ORM if logging attempts to the PostgreSQL database.
- Core Logic: Custom algorithm for TRNC ID validation.
This utility, though smaller in scope, demonstrates attention to specific regional requirements and data validation, which can be crucial in many applications.