A comprehensive log hosting service built specifically for Formula SAE teams to manage and access log files efficiently.
- File Upload: Support for multiple log file formats (.mcap, .bag, .can, .log, .csv)
- Automatic Metadata Extraction: Extracts metadata from MCAP files including timestamps, message counts, and channels
- Google Cloud Storage Integration: Secure file storage with signed URL downloads
- MongoDB Indexing: Fast search and filtering capabilities
- Real-time Indexing: Background service automatically indexes new files
- RESTful API: FastAPI backend with automatic documentation
- Modern Frontend: React 18 with Vite for fast development
- Authentication: Token-based API security
- Docker Deployment: Easy local development and production deployment
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ React App │ │ FastAPI │ │ Indexer │
│ (Frontend) │◄──►│ (Backend API) │ │ (Background) │
│ Port: 3000 │ │ Port: 8000 │ │ │
└─────────────────┘ └─────────────────┘ └─────────────────┘
│ │ │
│ │ │
▼ ▼ ▼
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ MongoDB │ │ Google Cloud │ │ MongoDB │
│ Port: 27017 │ │ Storage │ │ (Indexing) │
└─────────────────┘ └─────────────────┘ └─────────────────┘
- Docker and Docker Compose
- Google Cloud Platform account with Storage API enabled
- Service account key for GCS access
-
Clone the repository
git clone <repository-url> cd cloud-nix-sandbox
-
Create environment file
cp .env.example .env
-
Configure environment variables Edit
.env
with your configuration:# MongoDB Configuration MONGO_INITDB_ROOT_USERNAME=admin MONGO_INITDB_ROOT_PASSWORD=your-secure-password MONGO_EXPRESS_USERNAME=admin MONGO_EXPRESS_PASSWORD=your-express-password # Google Cloud Storage GCS_BUCKET=your-bucket-name GOOGLE_APPLICATION_CREDENTIALS=/app/service-account-key.json # API Security API_TOKEN=your-secure-api-token
-
Add your GCS service account key Place your service account JSON file as
service-account-key.json
in the root directory. -
Start the services
docker-compose -f compose.prod.yaml up -d
-
Access the application
- Frontend: http://localhost:3000
- API Documentation: http://localhost:8000/docs
- MongoDB Admin: http://localhost:8082
POST /upload
Authorization: Bearer {token}
Content-Type: multipart/form-data
Form Data:
- file: Log file to upload
- car_name: Name of the car (required)
- label: Optional description/label
GET /logs?car_name={car}&log_type={type}&start_date={date}&end_date={date}
Authorization: Bearer {token}
GET /logs/{log_id}/download
Authorization: Bearer {token}
GET /health
cd backend/api
pip install -r requirements.txt
uvicorn main:app --reload --host 0.0.0.0 --port 8000
cd frontend
npm install
npm run dev
cd backend/indexer
pip install -r requirements.txt
python main.py