SolarMed AI Development Guide
Development Environment Setup
Node.js (v16 or higher)
Python (v3.8 or higher)
Git
Docker (optional)
VS Code or similar IDE
Install Node.js dependencies:
Configure environment variables:
cp .env.example .env
# Edit .env with your configuration
Start development server:
Create Python virtual environment:
cd backend
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
Install dependencies:
pip install -r requirements.txt
Start development server:
uvicorn main:app --reload
frontend/
├── src/
│ ├── components/ # Reusable Vue components
│ ├── views/ # Page components
│ ├── services/ # API and business logic
│ ├── stores/ # Vuex state management
│ ├── utils/ # Utility functions
│ ├── assets/ # Static assets
│ └── App.vue # Root component
├── public/ # Static files
└── package.json # Dependencies and scripts
backend/
├── app/
│ ├── api/ # API endpoints
│ ├── core/ # Core functionality
│ ├── models/ # Database models
│ ├── schemas/ # Pydantic schemas
│ └── services/ # Business logic
├── tests/ # Test suite
└── main.py # Application entry
Create feature branch:
git checkout -b feature/your-feature-name
Make changes and commit:
git add .
git commit -m " Description of changes"
Push changes:
git push origin feature/your-feature-name
Create pull request on GitHub
Frontend: ESLint + Prettier
Backend: Black + isort
Follow Vue.js style guide
Use TypeScript where possible
Frontend tests:
npm run test:unit # Unit tests
npm run test:e2e # End-to-end tests
Backend tests:
pytest # Run all tests
pytest -v # Verbose output
pytest -k " test_name" # Run specific test
Key Components Development
Create component file:
touch src/components/YourComponent.vue
Basic structure:
<template >
<!-- Component template -->
</template >
<script setup>
// Component logic
</script >
<style scoped>
/* Component styles */
</style >
Create store module:
// stores/yourModule.js
export const useYourStore = defineStore ( 'yourModule' , {
state : ( ) => ( {
// State properties
} ) ,
actions : {
// Actions
}
} ) ;
Create route file:
# api/your_endpoint.py
from fastapi import APIRouter
router = APIRouter ()
@router .get ("/your-endpoint" )
async def your_endpoint ():
return {"message" : "Hello World" }
Add to main router:
# api/router.py
from .your_endpoint import router as your_router
router .include_router (your_router )
Create model:
# models/your_model.py
from sqlalchemy import Column , Integer , String
from .base import Base
class YourModel (Base ):
__tablename__ = "your_table"
id = Column (Integer , primary_key = True )
name = Column (String )
Offline-First Development
Update service worker:
// public/sw.js
self . addEventListener ( 'install' , ( event ) => {
// Cache assets
} ) ;
self . addEventListener ( 'fetch' , ( event ) => {
// Handle requests
} ) ;
Create store:
// utils/offlineStorage.js
const db = {
yourStore : 'your_store'
} ;
Implement sync:
// services/syncManager.js
class SyncManager {
async sync ( ) {
// Sync logic
}
}
Code splitting
Lazy loading
Asset optimization
Caching strategies
Database indexing
Query optimization
Response caching
Connection pooling
Input validation
XSS prevention
CSRF protection
Secure storage
Authentication
Authorization
Data validation
Rate limiting
Start services:
# Frontend
npm run dev
# Backend
uvicorn main:app --reload
Build frontend:
Start backend:
uvicorn main:app --host 0.0.0.0 --port 8000
Build images:
Start containers:
Browser DevTools
Vue DevTools
Performance monitoring
Error tracking
Logging
Debug mode
Performance metrics
Error reporting
Fork the repository
Create feature branch
Make changes
Run tests
Submit PR
Check documentation
Search issues
Create new issue
Contact maintainers
Check existing issues
Create detailed report
Include reproduction steps
Provide environment info