Repository navigation
API Documentation
Tang ZhaoSheng edited this page Nov 8, 2024
·
7 revisions
- Overview
- System Architecture
- Authentication
- Python Backend API (Port 5106)
- Node.js Backend API (Port 5105)
- Data Models
- Error Handling
The Pioneer system provides ESG (Environmental, Social, and Governance) analysis and scoring capabilities through two backend servers:
| Server | Port | Primary Functions |
|---|---|---|
| Python Backend (FastAPI) | 5106 | Report processing, ESG calculations |
| Node.js Backend (Express) | 5105 | Authentication, Data retrieval |
graph TD
Client[Frontend Client]
PY[Python Backend :5106]
NODE[Node.js Backend :5105]
DB[(MySQL Database)]
FB[Firebase Auth]
S3[AWS S3 Storage]
Client --> PY
Client --> NODE
PY --> DB
NODE --> DB
NODE --> FB
PY --> S3
POST /reports/fetch/{file_name}POST /reports/extract/text/{report_name}POST /reports/extract/update/data/{report_name}POST /calculate-esgPOST /predictGET /dashboard/analysis/{company_id}GET /storage-statusPOST /cleanupPOST /cleanup/forcePOST /api/loginPOST /api/logoutGET /api/table/companyGET /api/table/socialGET /api/score/environmentGET /api/table/governanceGET /api/dashboard/esgGET /api/score/predictGET /api/s3/storage/filesPOST /api/firebase/uploadinterface Company {
CompanyID: number;
CompanyName: string;
Industry: string;
Country: string;
}interface ESGScore {
CompanyName: string;
CompanyID: number;
ReportYear: number;
Environmental_Score: number;
Social_Score: number;
Governance_Score: number;
Final_ESG_score: number;
}interface ESGPrediction {
CompanyName: string;
CompanyID: number;
Year: number;
Environmental_Score: number;
Social_Score: number;
Governance_Score: number;
ESG_score: number;
Data_Type: string;
}| Code | Description | Example |
|---|---|---|
| 200 | Success | Request completed successfully |
| 400 | Bad Request | Invalid parameters |
| 401 | Unauthorized | Invalid or missing token |
| 404 | Not Found | Resource doesn't exist |
| 500 | Server Error | Internal processing error |
{
"status": "error",
"code": "number",
"detail": "string",
"timestamp": "string"
}