• Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
eddie_walk

eddie_walk

crm_OBUO_FARMS

Public
Like
crm_OBUO_FARMS
Home
Code
4
backend
3
frontend
5
shared
2
README.md
Branches
1
Pull requests
Remixes
History
Environment variables
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Sign up now
Code
/
README.md
Code
/
README.md
Search
6/3/2025
Viewing readonly version of main branch: v137
View latest version
README.md

OBUO Farms CRM

A dual-interface CRM application for OBUO Farms with separate client and admin portals.

Recent Fixes

βœ… Order Creation Issue Resolved

  • Issue: Orders were being created successfully in the database but the API was not returning the created order data, causing frontend errors
  • Root Cause: SQLite result handling inconsistency - the createOrder function wasn't properly extracting the created order from different possible result structures
  • Solution: Implemented robust result handling with fallback mechanisms to handle different SQLite response formats
  • Status: βœ… RESOLVED - Orders now create successfully and return proper data to the frontend

Features

  • Client Portal: Clean, simple order form for customers
  • Admin Dashboard: Complete order management with authentication
  • SQLite database for storing orders
  • Automatic email confirmations to clients
  • RESTful API for order management

Interfaces

🐟 Client Portal (/)

  • Simple, customer-friendly order form
  • No backend data exposed to clients
  • Automatic email confirmations
  • Mobile-responsive design
  • Professional OBUO Farms branding

πŸ” Admin Dashboard (/admin)

  • Secure login required
  • Complete order management dashboard
  • Create new orders manually
  • View all orders with search/filter/sort
  • Order statistics and analytics
  • Logout functionality

Authentication

Default Admin Credentials:

  • Username: admin
  • Password: obuo2024

Note: Change these credentials for production use

Project Structure

β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ database/
β”‚   β”‚   β”œβ”€β”€ migrations.ts    # Database schema
β”‚   β”‚   └── queries.ts       # Database operations
β”‚   β”œβ”€β”€ routes/
β”‚   β”‚   β”œβ”€β”€ orders.ts        # Order API endpoints
β”‚   β”‚   └── static.ts        # Static file serving & routing
β”‚   └── index.ts             # Main Hono app
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”œβ”€β”€ App.tsx              # Main React app with routing
β”‚   β”‚   β”œβ”€β”€ ClientOrderForm.tsx  # Public order form
β”‚   β”‚   β”œβ”€β”€ LoginForm.tsx        # Admin login
β”‚   β”‚   β”œβ”€β”€ AdminDashboard.tsx   # Admin interface
β”‚   β”‚   β”œβ”€β”€ OrderForm.tsx        # Admin order creation
β”‚   β”‚   └── Dashboard.tsx        # Orders dashboard
β”‚   β”œβ”€β”€ index.html           # Main HTML template
β”‚   β”œβ”€β”€ index.tsx            # Frontend entry point
β”‚   └── style.css            # Styles
└── shared/
    β”œβ”€β”€ types.ts             # Shared TypeScript types
    └── auth.ts              # Authentication utilities

API Endpoints

  • POST /api/orders - Create a new order
  • GET /api/orders - Get all orders (admin only)
  • GET /api/orders/:id - Get specific order
  • PUT /api/orders/:id - Update order
  • DELETE /api/orders/:id - Delete order

Routes

  • / - Client order form (public)
  • /admin - Admin login/dashboard (protected)
  • /health - Health check endpoint

Database Schema

Orders table includes:

  • Client information (name, phone, email)
  • Order details (type, quantity, delivery date)
  • Notes and timestamps

Setup

The application automatically initializes the database on startup. No additional setup is required.

Usage

For Customers:

  1. Visit the main page (/) to place orders
  2. Fill out the simple order form
  3. Receive automatic email confirmation

For OBUO Farms Staff:

  1. Visit /admin to access the dashboard
  2. Login with admin credentials
  3. View all orders, create new orders, and manage the system
  4. Use the dashboard for analytics and order tracking

Security Features

  • βœ… Separate client and admin interfaces
  • βœ… Authentication required for admin access
  • βœ… Session management with 24-hour expiry
  • βœ… No sensitive data exposed to clients
  • βœ… Secure order creation and management

Order Types Available

  • Fresh Fish
  • Frozen Fish
  • Live Fish
  • Fish Fillet
  • Smoked Fish
  • Dried Fish
  • Catfish
  • Tilapia
  • Fish Feed
  • Other

Features

  • βœ… Dual Interface Design: Separate client and admin portals
  • βœ… Client Portal: Clean, simple order form without backend exposure
  • βœ… Admin Dashboard: Complete order management with authentication
  • βœ… Responsive design for mobile and desktop
  • βœ… Real-time order creation with validation
  • βœ… Automatic email confirmations to clients
  • βœ… Search and filter orders by multiple criteria
  • βœ… Sort orders by date, client name, or delivery date
  • βœ… Visual status indicators for delivery dates
  • βœ… SQLite database with proper schema
  • βœ… RESTful API with error handling
  • βœ… TypeScript for type safety
  • βœ… Session-based authentication for admin access
FeaturesVersion controlCode intelligenceCLIMCP
Use cases
TeamsAI agentsSlackGTM
DocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Open Source Pledge
Terms of usePrivacy policyAbuse contact
Β© 2025 Val Town, Inc.