COSMO系统服务端
 
 
 
 
Go to file
mula.liu acc1b16d9e 初步实现了3阶段 2025-12-06 17:06:10 +08:00
app 初步实现了3阶段 2025-12-06 17:06:10 +08:00
scripts 初步实现了3阶段 2025-12-06 17:06:10 +08:00
upload Phase 2 2025-12-06 00:36:39 +08:00
.dockerignore v1.0.1 2025-12-02 21:13:52 +08:00
.env.example Phase 2 2025-12-06 00:36:39 +08:00
.gitignore 1.0.0 2025-12-02 14:29:38 +08:00
ADMIN_PROGRESS.md 1.0.0 2025-12-02 14:29:38 +08:00
CONFIG.md Phase 2 2025-12-06 00:36:39 +08:00
DATABASE_SCHEMA.md 初步实现了3阶段 2025-12-06 17:06:10 +08:00
Dockerfile 添加了nasa接口的代理服务 2025-12-03 13:33:25 +08:00
README.md 1.0.0 2025-12-02 14:29:38 +08:00
pip.conf 添加了nasa接口的代理服务 2025-12-03 13:33:25 +08:00
requirements.txt 添加了nasa接口的代理服务 2025-12-03 13:33:25 +08:00

README.md

Cosmo Backend

Backend API for the Cosmo deep space explorer visualization system.

Setup

  1. Create virtual environment:
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
  1. Install dependencies:
pip install -r requirements.txt
  1. Copy environment file:
cp .env.example .env

Running

Start the development server:

cd backend
python -m app.main

Or using uvicorn directly:

uvicorn app.main:app --reload --host 0.0.0.0 --port 8000

The API will be available at:

API Endpoints

Get Celestial Positions

GET /api/celestial/positions

Query parameters:

  • start_time: ISO 8601 datetime (optional)
  • end_time: ISO 8601 datetime (optional)
  • step: Time step, e.g., "1d", "12h" (default: "1d")

Example:

http://localhost:8000/api/celestial/positions?start_time=2025-01-01T00:00:00Z&end_time=2025-01-10T00:00:00Z&step=1d

Get Body Info

GET /api/celestial/info/{body_id}

Example:

http://localhost:8000/api/celestial/info/-31

List All Bodies

GET /api/celestial/list

Clear Cache

POST /api/celestial/cache/clear