A specialized data management system for AI applications with secure authentication and auto-launch capabilities for cloud environments.
This repository is pre-configured to automatically start in all major cloud development environments:
- β GitHub Codespaces - Auto-starts on workspace open
- β GitPod - Launches when workspace loads
- β Replit - Starts when repl opens
- β VS Code - Can auto-start on folder open
No more forgetting to launch your AI Hub! π
curl http://localhost:3000/api/health
# Response: {"status":"ok","message":"MongoDB AI Data Hub API is running"}
- JWT-based user authentication
- Password hashing with bcrypt
- Role-based access control (user/admin)
- Rate limiting and input validation
- Session management
- Store and organize AI prompts
- Categorize by use case (coding, analysis, etc.)
- Tag and search functionality
- Model-specific prompts (GPT-4, Claude, etc.)
- Version control and metadata
- Store vector embeddings for semantic search
- Multiple vector stores with namespaces
- Support for different embedding dimensions
- Metadata and search capabilities
- Integration with AI/ML pipelines
- Auto-launch in cloud environments
- Environment detection and configuration
- Health monitoring and status checks
- Container and serverless ready
- Open in any cloud environment (Codespaces, GitPod, Replit)
- Server starts automatically - no action needed!
- Access at: Check port 3000 forwarding in your environment
# Clone and setup
git clone https://github.com/d33disc/mongodb-ai-hub.git
cd mongodb-ai-hub
npm install
# Start the server
npm run dev
# Or use auto-start script
npm run auto-start
POST /api/auth/register # Create user account
POST /api/auth/login # User login
GET /api/auth/profile # Get user profile
PUT /api/auth/profile # Update profile
PUT /api/auth/change-password # Change password
GET /api/auth/verify # Verify token
GET /api/prompts # List prompts (public)
POST /api/prompts # Create prompt (auth required)
GET /api/prompts/:id # Get specific prompt
PUT /api/prompts/:id # Update prompt (auth required)
DELETE /api/prompts/:id # Delete prompt (auth required)
GET /api/prompts/search/text?query= # Search prompts
GET /api/vectorstores # List vector stores
POST /api/vectorstores # Create store (auth required)
GET /api/vectorstores/:id # Get specific store
PUT /api/vectorstores/:id # Update store (auth required)
DELETE /api/vectorstores/:id # Delete store (auth required)
POST /api/vectorstores/:id/embeddings # Add embeddings
DELETE /api/vectorstores/:id/embeddings/:embeddingId # Remove embedding
curl -X POST http://localhost:3000/api/auth/register \
-H "Content-Type: application/json" \
-d '{
"email": "user@example.com",
"password": "SecurePass123!",
"firstName": "John",
"lastName": "Doe"
}'
curl -X POST http://localhost:3000/api/auth/login \
-H "Content-Type: application/json" \
-d '{
"email": "user@example.com",
"password": "SecurePass123!"
}'
curl -X POST http://localhost:3000/api/prompts \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-d '{
"title": "Code Review Prompt",
"content": "Review this code for bugs and improvements:",
"category": "coding",
"model": "gpt-4"
}'
import requests
# Login and get token
response = requests.post('http://localhost:3000/api/auth/login', json={
'email': 'user@example.com',
'password': 'password'
})
token = response.json()['data']['tokens']['accessToken']
# Create a prompt
requests.post('http://localhost:3000/api/prompts',
headers={'Authorization': f'Bearer {token}'},
json={
'title': 'Data Analysis Prompt',
'content': 'Analyze this dataset and provide insights:',
'category': 'analysis'
})
const axios = require('axios');
// Login
const loginResponse = await axios.post('http://localhost:3000/api/auth/login', {
email: 'user@example.com',
password: 'password'
});
const token = loginResponse.data.data.tokens.accessToken;
// Create vector store
await axios.post('http://localhost:3000/api/vectorstores', {
name: 'Product Embeddings',
namespace: 'ecommerce',
vectorDimension: 1536,
model: 'text-embedding-ada-002'
}, {
headers: { Authorization: `Bearer ${token}` }
});
- Auto-starts: β
Enabled in
.devcontainer/devcontainer.json
- MongoDB: Auto-configured
- Access: Port forwarding automatically configured
- Auto-starts: β
Enabled in
.gitpod.yml
- MongoDB: Local instance setup
- Access:
https://3000-[workspace].gitpod.io
- Auto-starts: β
Enabled in
.replit
- MongoDB: Configured for Replit environment
- Access: Repl web view
- Auto-starts: β Optional via tasks
- MongoDB: Local or remote connection
- Access:
http://localhost:3000
# Health check
npm run health-check
# Full status
npm run status
# View logs
tail -f /tmp/ai-hub.log
Each environment will show the appropriate URL for access. Look for port 3000 forwarding in your cloud environment.
# Required
MONGODB_URI=mongodb://localhost:27017/mongodb-ai-hub
JWT_SECRET=your-secret-key
JWT_REFRESH_SECRET=your-refresh-secret
# Optional
PORT=3000
NODE_ENV=development
CORS_ORIGIN=http://localhost:3000
The auto-start feature is configured in:
.devcontainer/devcontainer.json
- GitHub Codespaces.gitpod.yml
- GitPod.replit
- Replit.vscode/tasks.json
- VS Code
- Fork the repository
- Create a feature branch
- Make your changes
- Test in a cloud environment
- Submit a pull request
MIT License - see LICENSE file for details.
- Documentation: cloud-deploy.md
- Issues: GitHub Issues
- Discussions: GitHub Discussions
Ready to use in any cloud environment with automatic startup! π