Skip to main content

A Flask-based astrophotography web application

Project description

AstroSpace

AstroSpace is a Flask application for hosting and organizing astrophotography posts on your own infrastructure. It combines image publishing, equipment tracking, plate-solving overlays, and guiding-log visualization in one self-hosted site.

You can see a public instance here: astro.space-js.de

Features

  • User registration with a configurable user limit
  • Rich post creation for astrophotography images and acquisition details
  • Equipment inventory management for telescopes, cameras, filters, and accessories
  • FITS/XISF-assisted plate solving and generated overlays
  • PHD2 guiding log parsing and Plotly-based visualizations
  • Public collection pages and per-image detail views
  • Docker-friendly deployment
  • Optional opt-in debug logging for local development and container runs

Requirements

  • Python 3.11+
  • PostgreSQL
  • Optional: Node.js if you want to rebuild Tailwind CSS assets
  • Optional: Docker for containerized deployment

Quick Start

Local install

python -m venv .venv
.venv\Scripts\activate
python -m pip install --upgrade pip
python -m pip install -e .[dev]

Configuration

AstroSpace reads configuration from:

  1. environment variables
  2. the file pointed to by ASTROSPACE_SETTINGS
  3. instance/config.py

Required settings:

  • SECRET_KEY
  • DB_NAME
  • DB_USER
  • DB_PASSWORD
  • DB_HOST
  • DB_PORT
  • UPLOAD_PATH

Common optional settings:

  • TITLE
  • MAX_USERS
  • SESSION_COOKIE_SECURE

Example config file:

SECRET_KEY = "change-me"
DB_NAME = "astrospace"
DB_USER = "astrospace"
DB_PASSWORD = "change-me"
DB_HOST = "localhost"
DB_PORT = 5432
UPLOAD_PATH = r"C:\astrospace\uploads"
TITLE = "My AstroSpace"
MAX_USERS = 2

Run locally

set ASTROSPACE_SETTINGS=path\to\config.py
flask --app AstroSpace run

The app starts on http://127.0.0.1:5000 by default.

Debug Logging

AstroSpace includes opt-in runtime logging around the places most likely to block or fail: app startup, database bootstrapping, post creation, inventory updates, plate solving, and guide-log parsing.

Enable it in either of these ways:

flask --app AstroSpace run --debug
set ASTROSPACE_DEBUG=1
flask --app AstroSpace run

For the Docker image, append --debug to the container command or set ASTROSPACE_DEBUG=1.

Docker

Build the image locally:

docker build -t astrospace .

Run it:

docker run ^
  --name astrospace ^
  -p 9000:9000 ^
  -e SECRET_KEY=change-me ^
  -e DB_NAME=astrospace ^
  -e DB_USER=astrospace ^
  -e DB_PASSWORD=change-me ^
  -e DB_HOST=host.docker.internal ^
  -e DB_PORT=5432 ^
  -e TITLE=AstroSpace ^
  -e MAX_USERS=2 ^
  -e UPLOAD_PATH=/uploads ^
  -v C:\astrospace\uploads:/uploads ^
  astrospace

Run the same container in debug mode:

docker run ^
  --name astrospace-debug ^
  -p 9000:9000 ^
  -e SECRET_KEY=change-me ^
  -e DB_NAME=astrospace ^
  -e DB_USER=astrospace ^
  -e DB_PASSWORD=change-me ^
  -e DB_HOST=host.docker.internal ^
  -e DB_PORT=5432 ^
  -e TITLE=AstroSpace ^
  -e MAX_USERS=2 ^
  -e UPLOAD_PATH=/uploads ^
  -e ASTROSPACE_DEBUG=1 ^
  -v C:\astrospace\uploads:/uploads ^
  astrospace --debug

The image starts Gunicorn on 0.0.0.0:9000.

Development

Run the test suite:

python -m pytest -q

If you update Tailwind sources:

cd AstroSpace
npm install
npx tailwindcss -i ./static/input.css -o ./static/styles.css

Useful first-run steps:

  1. Register the first user. The first account becomes admin.
  2. Open My Profile and configure the site title and welcome message.
  3. Create a new post with a preview image and optional FITS/XISF metadata.
  4. Add or normalize inventory entries from the profile page if needed.

Release Workflow

Build and publish a wheel with Hatch:

python -m pip install hatch
python -m hatch build -t wheel
python -m hatch publish

Project Layout

  • AstroSpace/: application package
  • docs/: project documentation
  • tests/: automated tests
  • nginx/: example reverse-proxy and compose assets

License

This project is licensed under the GNU GPL-3.0 License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

astrospace-1.2.9.tar.gz (6.2 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

astrospace-1.2.9-py3-none-any.whl (6.2 MB view details)

Uploaded Python 3

File details

Details for the file astrospace-1.2.9.tar.gz.

File metadata

  • Download URL: astrospace-1.2.9.tar.gz
  • Upload date:
  • Size: 6.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Hatch/1.16.5 cpython/3.14.2 HTTPX/0.28.1

File hashes

Hashes for astrospace-1.2.9.tar.gz
Algorithm Hash digest
SHA256 2eb436c57abe66d2eed9a6bd36cefec6262714a4654595d5992795d172a55de2
MD5 ce79d739a14324998dd653b4bbc5f770
BLAKE2b-256 4556936099807829a7738571db987d899369ce733c23cc4bb7caaa51de7d9531

See more details on using hashes here.

File details

Details for the file astrospace-1.2.9-py3-none-any.whl.

File metadata

  • Download URL: astrospace-1.2.9-py3-none-any.whl
  • Upload date:
  • Size: 6.2 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Hatch/1.16.5 cpython/3.14.2 HTTPX/0.28.1

File hashes

Hashes for astrospace-1.2.9-py3-none-any.whl
Algorithm Hash digest
SHA256 88e1d6dd798485b16b24c69fc86cd0bfc3aef86752ff575c938b3d3b47ce35e5
MD5 a2020e49dc339308b38e8b96dde2a9c4
BLAKE2b-256 aeda0886ff3e6e5760a932db7248e1aa1fda845ae938be7a8ef2fb2651ab6413

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page