Skip to content

unithonBeReal/pysv

Repository files navigation

Flask API Server

A basic Flask backend API server with hello world endpoints.

Setup

  1. Install dependencies:
pip install -r requirements.txt
  1. Set up environment variables:
# Copy the example environment file
cp env.example .env

# Edit .env file with your desired values
# FLASK_HOST=0.0.0.0
# FLASK_PORT=5000
  1. Run the server:
python app.py

The server will start on http://localhost:8000 by default.

Docker Production Setup

Building and Running with Docker

  1. Build the Docker image:
docker build -t pysv .
  1. Run the container:
docker run -d \
  --name pysv-app \
  -p 8000:8000 \
  -v $(pwd)/data:/app/data \
  -e GEMINI_API_KEY=your_api_key_here \
  pysv

Using Docker Compose (Recommended)

  1. Create a .env file with your environment variables:
cp env.example .env
# Edit .env file with your values, especially GEMINI_API_KEY
  1. Run with Docker Compose:
docker-compose -f docker-compose.prod.yml up -d
  1. Check logs:
docker-compose -f docker-compose.prod.yml logs -f
  1. Stop the service:
docker-compose -f docker-compose.prod.yml down

The application will be available at http://localhost:8000.

Environment Variables

The app loads environment variables from a .env file. You can customize the host and port by editing the .env file:

# Copy the example file
cp env.example .env

# Edit .env file
FLASK_HOST=127.0.0.1
FLASK_PORT=8000
DATA_PATH=./data
CONFIG_FILE_PATH=./data/config.json

Configs

./data/config.json

{
  "dee_token": "",
  "dee_user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36"
}

Service Key

./google-service-key.json

API

  • GET /api/tasks
  • POST /api/tasks
  • GET /api/tasks/<task_id>/result
  • GET /api/tasks/<task_id>/thumbnail

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •