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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Dakota AI Demos Monorepo
|
| 2 |
+
|
| 3 |
+
A professional demo portfolio showcasing Dakota AI's machine learning and data science capabilities. Built with a modern monorepo structure using Vercel for deployment.
|
| 4 |
+
|
| 5 |
+
## π **Quick Start**
|
| 6 |
+
|
| 7 |
+
### Prerequisites
|
| 8 |
+
- Node.js 18+
|
| 9 |
+
- npm or yarn
|
| 10 |
+
- GitHub account
|
| 11 |
+
- Vercel account (optional for deployment)
|
| 12 |
+
|
| 13 |
+
### Setup
|
| 14 |
+
```bash
|
| 15 |
+
# Clone the repository
|
| 16 |
+
git clone https://github.com/neil-andrew-olson/dakotaai-demos.git
|
| 17 |
+
cd dakotaai-demos
|
| 18 |
+
|
| 19 |
+
# Install dependencies
|
| 20 |
+
npm install
|
| 21 |
+
|
| 22 |
+
# Run development server
|
| 23 |
+
npm run dev
|
| 24 |
+
```
|
| 25 |
+
|
| 26 |
+
## π **Project Structure**
|
| 27 |
+
|
| 28 |
+
```
|
| 29 |
+
dakotaai-demos/
|
| 30 |
+
βββ apps/ # Demo applications
|
| 31 |
+
β βββ image-classifier/ # AI Image Classification Demo
|
| 32 |
+
β β βββ pages/ # Next.js pages
|
| 33 |
+
β β βββ styles/ # Component styles
|
| 34 |
+
β β βββ public/ # Static assets
|
| 35 |
+
β β βββ package.json # App-specific dependencies
|
| 36 |
+
β βββ [future-demos]/ # Additional demos
|
| 37 |
+
βββ packages/ # Shared packages (future)
|
| 38 |
+
βββ vercel.json # Vercel configuration
|
| 39 |
+
βββ package.json # Root configuration
|
| 40 |
+
```
|
| 41 |
+
|
| 42 |
+
## π― **Current Demos**
|
| 43 |
+
|
| 44 |
+
### **AI Image Classifier**
|
| 45 |
+
π§ **Transfer Learning Demo**
|
| 46 |
+
- Upload any image for classification
|
| 47 |
+
- Uses VGG16 pre-trained model fine-tuned on CIFAR-10
|
| 48 |
+
- Intelligent feature analysis with confidence scoring
|
| 49 |
+
- Serverless API with Vercel functions
|
| 50 |
+
|
| 51 |
+
**URL:** `https://your-domain.vercel.app/` (or `http://localhost:3000`)
|
| 52 |
+
|
| 53 |
+
**Features:**
|
| 54 |
+
- Drag & drop image upload
|
| 55 |
+
- Real-time classification results
|
| 56 |
+
- Top 3 predictions with confidence bars
|
| 57 |
+
- Educational explanations
|
| 58 |
+
- Responsive design
|
| 59 |
+
|
| 60 |
+
## π§ **Development**
|
| 61 |
+
|
| 62 |
+
### **Starting Development**
|
| 63 |
+
```bash
|
| 64 |
+
# Install root dependencies
|
| 65 |
+
npm install
|
| 66 |
+
|
| 67 |
+
# Start development server
|
| 68 |
+
npm run dev
|
| 69 |
+
```
|
| 70 |
+
|
| 71 |
+
### **Adding a New Demo**
|
| 72 |
+
```bash
|
| 73 |
+
# Create new app directory
|
| 74 |
+
mkdir apps/new-demo
|
| 75 |
+
cd apps/new-demo
|
| 76 |
+
|
| 77 |
+
# Initialize Next.js app
|
| 78 |
+
npx create-next-app . --typescript --tailwind
|
| 79 |
+
|
| 80 |
+
# Add to root package.json workspaces
|
| 81 |
+
# "workspaces": ["apps/image-classifier", "apps/new-demo"]
|
| 82 |
+
```
|
| 83 |
+
|
| 84 |
+
### **Testing API Routes**
|
| 85 |
+
```bash
|
| 86 |
+
# Test the classification API
|
| 87 |
+
curl -X POST http://localhost:3000/api/classify \
|
| 88 |
+
-F "image=@your-image.jpg"
|
| 89 |
+
```
|
| 90 |
+
|
| 91 |
+
## π **Deployment**
|
| 92 |
+
|
| 93 |
+
### **Automatic Deployment with Vercel**
|
| 94 |
+
|
| 95 |
+
#### **Connect to GitHub:**
|
| 96 |
+
1. Go to [vercel.com](https://vercel.com) and sign in
|
| 97 |
+
2. Click "Import Project"
|
| 98 |
+
3. Connect your GitHub repository
|
| 99 |
+
4. Vercel will automatically detect the monorepo structure
|
| 100 |
+
|
| 101 |
+
#### **Monorepo Configuration:**
|
| 102 |
+
The `vercel.json` file handles routing for the monorepo:
|
| 103 |
+
- `/` β Image Classifier app
|
| 104 |
+
- `/api/*` β Serverless API routes
|
| 105 |
+
- Future apps can have their own routes
|
| 106 |
+
|
| 107 |
+
#### **Custom Domains:**
|
| 108 |
+
```bash
|
| 109 |
+
# Set up custom domain
|
| 110 |
+
vercel domains add classifier.dakotaai.us
|
| 111 |
+
vercel domains add analytics.dakotaai.us
|
| 112 |
+
vercel domains add forecasting.dakotaai.us
|
| 113 |
+
```
|
| 114 |
+
|
| 115 |
+
### **Environment Variables**
|
| 116 |
+
Add to Vercel dashboard or `.env.local`:
|
| 117 |
+
```env
|
| 118 |
+
VERCEL_URL=https://your-domain.vercel.app
|
| 119 |
+
# Add API keys for external services if needed
|
| 120 |
+
```
|
| 121 |
+
|
| 122 |
+
## π€ **AI Model Setup**
|
| 123 |
+
|
| 124 |
+
### **TensorFlow.js Model**
|
| 125 |
+
The demo includes tools to convert your trained models:
|
| 126 |
+
|
| 127 |
+
```bash
|
| 128 |
+
# Convert your .h5 model
|
| 129 |
+
pip install tensorflowjs
|
| 130 |
+
tensorflowjs_converter --input_format keras your-model.h5 model/
|
| 131 |
+
```
|
| 132 |
+
|
| 133 |
+
Place converted model files in `apps/image-classifier/public/models/`
|
| 134 |
+
|
| 135 |
+
### **Serverless API**
|
| 136 |
+
The `/api/classify` endpoint can be extended to:
|
| 137 |
+
1. Load your converted TensorFlow.js model
|
| 138 |
+
2. Process uploaded images
|
| 139 |
+
3. Return real AI predictions
|
| 140 |
+
|
| 141 |
+
## π¨ **Customization**
|
| 142 |
+
|
| 143 |
+
### **Styling**
|
| 144 |
+
- Uses CSS Modules for component styling
|
| 145 |
+
- Responsive design with mobile-first approach
|
| 146 |
+
- Easy theme customization in `styles/` directory
|
| 147 |
+
|
| 148 |
+
### **Adding Features**
|
| 149 |
+
- Add new pages in `pages/` directory
|
| 150 |
+
- Create API routes in `pages/api/` directory
|
| 151 |
+
- Use shared components from `packages/` (future)
|
| 152 |
+
|
| 153 |
+
## π **Analytics & Monitoring**
|
| 154 |
+
|
| 155 |
+
### **Vercel Analytics**
|
| 156 |
+
The app includes automatic performance monitoring:
|
| 157 |
+
- Page load speeds
|
| 158 |
+
- API response times
|
| 159 |
+
- Error tracking
|
| 160 |
+
- Real user metrics
|
| 161 |
+
|
| 162 |
+
### **Custom Analytics**
|
| 163 |
+
```javascript
|
| 164 |
+
// Add to _app.js
|
| 165 |
+
import { Analytics } from '@vercel/analytics/react';
|
| 166 |
+
|
| 167 |
+
export default function App({ Component, pageProps }) {
|
| 168 |
+
return (
|
| 169 |
+
<>
|
| 170 |
+
<Component {...pageProps} />
|
| 171 |
+
<Analytics />
|
| 172 |
+
</>
|
| 173 |
+
);
|
| 174 |
+
}
|
| 175 |
+
```
|
| 176 |
+
|
| 177 |
+
## π οΈ **Tech Stack**
|
| 178 |
+
|
| 179 |
+
- **Frontend:** Next.js 14, React, CSS Modules
|
| 180 |
+
- **Backend:** Vercel Serverless Functions
|
| 181 |
+
- **AI/ML:** TensorFlow.js, Python (for model training)
|
| 182 |
+
- **Deployment:** Vercel
|
| 183 |
+
- **Version Control:** Git, GitHub
|
| 184 |
+
|
| 185 |
+
## π **Performance Features**
|
| 186 |
+
|
| 187 |
+
- **Edge Functions:** Global CDN for fast responses
|
| 188 |
+
- **Automatic Scaling:** Handles traffic spikes
|
| 189 |
+
- **Static Optimization:** Fast page loads
|
| 190 |
+
- **Image Optimization:** Built-in Next.js optimization
|
| 191 |
+
|
| 192 |
+
## π **Security**
|
| 193 |
+
|
| 194 |
+
- **HTTPS:** Automatic SSL certificates
|
| 195 |
+
- **CORS Handling:** Proper API security
|
| 196 |
+
- **Input Validation:** Client and server-side validation
|
| 197 |
+
- **Error Handling:** Graceful error responses
|
| 198 |
+
|
| 199 |
+
## π **Future Enhancements**
|
| 200 |
+
|
| 201 |
+
- [ ] Add more demo applications
|
| 202 |
+
- [ ] Implement shared UI component library
|
| 203 |
+
- [ ] Add test suites
|
| 204 |
+
- [ ] Set up CI/CD pipelines
|
| 205 |
+
- [ ] Add monitoring dashboards
|
| 206 |
+
- [ ] Implement authentication for admin features
|
| 207 |
+
|
| 208 |
+
## π **Support**
|
| 209 |
+
|
| 210 |
+
For questions or contributions:
|
| 211 |
+
- Create GitHub issues
|
| 212 |
+
- Submit pull requests
|
| 213 |
+
- Contact Dakota AI team
|
| 214 |
+
|
| 215 |
+
## π **License**
|
| 216 |
+
|
| 217 |
+
MIT License - feel free to use for your own demo portfolios!
|
| 218 |
+
|
| 219 |
+
---
|
| 220 |
+
|
| 221 |
+
**Built with β€οΈ by Dakota AI team**
|