AI-MCP-Bio
AI-MCP-Bioは、ユーザーのプロフィールや経歴を管理するためのシンプルなHTMLテンプレートです。基本的な構造を持ち、カスタマイズが容易で、初心者でも扱いやすい設計になっています。機能は限られていますが、基本的な情報を表示するには十分です。
GitHubスター
0
ユーザー評価
未評価
お気に入り
0
閲覧数
24
フォーク
0
イシュー
0
AI-MCP-Bio Platform
A fullstack application with frontend and backend running in separate Docker containers. The platform bridges artificial intelligence with specialized bioinformatics tools through a secure Model Context Protocol framework.
Features
- Modern Frontend: React-inspired landing page with authentication modals
- Secure Backend: Node.js/Express API with JWT authentication and SQLite database
- Docker Containerized: Separate containers for frontend and backend
- User Authentication: Email-based registration and login system
- Responsive Design: Mobile-first design with modern UI/UX
- Production Ready: Optimized for VPS deployment
Quick Start
Prerequisites
- Docker and Docker Compose installed
- Ports 8000 and 8001 available
Development Setup
Clone the repository
git clone <repository-url> cd AI-MCP-Bio
Set up environment variables
cp env.example .env # Edit .env with your secure JWT secret
Build and run the containers
docker-compose up --build
Access the application
- Frontend: http://localhost:8000
- Backend API: http://localhost:8001
Production Deployment
For production deployment on a VPS:
Set up environment variables
# Generate a secure JWT secret openssl rand -base64 32 # Add this to your .env file
Build and deploy
docker-compose -f docker-compose.yml up -d --build
Configure reverse proxy (optional)
Set up nginx or another reverse proxy to handle SSL and domain routing.
Architecture
Frontend (Port 8000)
- Technology: Vanilla HTML/CSS/JavaScript
- Container: Nginx Alpine
- Features:
- Responsive design
- Authentication modals
- JWT token management
- Modern UI with animations
Backend (Port 8001)
- Technology: Node.js/Express
- Database: SQLite
- Container: Node.js Alpine
- Features:
- JWT authentication
- Password hashing (bcrypt)
- Rate limiting
- Input validation
- Security headers
API Endpoints
Authentication
POST /api/auth/register
- User registrationPOST /api/auth/login
- User loginGET /api/auth/profile
- Get user profile (protected)POST /api/auth/logout
- User logout
System
GET /health
- Health checkGET /api/protected
- Protected route example
Environment Variables
Variable | Description | Default |
---|---|---|
JWT_SECRET |
Secret key for JWT tokens | your-super-secret-jwt-key-change-this-in-production |
NODE_ENV |
Node environment | production |
PORT |
Backend server port | 3001 |
DB_PATH |
SQLite database path | /app/data/database.sqlite |
CORS_ORIGIN |
Allowed CORS origin | http://localhost:8000 |
Security Features
- JWT Authentication: Secure token-based authentication
- Password Hashing: bcrypt with salt rounds
- Rate Limiting: Protection against brute force attacks
- Input Validation: Server-side validation with express-validator
- Security Headers: Helmet.js for security headers
- CORS Protection: Configured CORS policy
- SQL Injection Protection: Parameterized queries
Database Schema
Users Table
CREATE TABLE users (
id INTEGER PRIMARY KEY AUTOINCREMENT,
email TEXT UNIQUE NOT NULL,
password TEXT NOT NULL,
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
last_login DATETIME,
is_active BOOLEAN DEFAULT 1
);
Development
Adding New Features
- Backend: Add routes in
backend/server.js
- Frontend: Add functionality in
frontend/
files - Database: Modify schema in
backend/server.js
Testing
# Test backend health
curl http://localhost:8001/health
# Test frontend
curl http://localhost:8000
Troubleshooting
Common Issues
- Port conflicts: Ensure ports 8000 and 8001 are available
- Docker issues: Try
docker-compose down
and rebuild - Authentication issues: Check JWT_SECRET is set correctly
- Database issues: Check volume permissions and SQLite file access
Logs
# View all logs
docker-compose logs
# View specific service logs
docker-compose logs backend
docker-compose logs frontend
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Support
For issues and questions, please create an issue in the repository or contact the development team.