This repository contains the official backend for the Sunscan project, a revolutionary solar imaging and analysis tool.
Sunscan is a spectroheliograph designed to capture images of the Sun in minutes, directly from a smartphone. This complete and autonomous device is the result of several months of work by the STAROS team (Guillaume Bertrand, Christian Buil, Valérie Desnoux, Olivier Garde, Matthieu Le Lain).
The Sunscan backend provides server-side functionality for the Sunscan application. It handles image processing, data management, and serves as the API for the frontend application.
- Control Sunscan via smartphone or tablet
- Capture solar images showing prominences, flares, and sunspots
- Intuitive interface requiring no special knowledge
- Server-side image processing and data management
- Python 3.9 or higher
- pip (Python package manager)
-
Clone the repository:
git clone https://github.com/your-username/sunscan-backend.git cd sunscan-backend
-
Create a virtual environment (optional but recommended):
python -m venv venv source venv/bin/activate # On Windows, use `venv\Scripts\activate`
-
Install the required dependencies:
pip install -r requirements.txt
-
Copy the example configuration file:
cp config.example.py config.py
-
Edit
config.py
to set up your specific configuration parameters if needed.
The Sunscan backend is a FastAPI application that uses Uvicorn as the ASGI server.
To start the backend server:
-
Ensure you're in the project directory and your virtual environment is activated (if you're using one).
-
Run the following command:
uvicorn main:app --host 0.0.0.0 --port 8000 --reload
This command does the following:
app.main
refers to themain.py
file in theapp
directory:app
refers to the FastAPI instance in themain.py
file--reload
enables auto-reloading, which is useful during development
# or just launch the start script ./start.sh
-
The server should start and display a message indicating it's running, along with the address and port (e.g., "Uvicorn running on http://127.0.0.1:8000").
-
You can now access the API endpoints using this address.
Note: Make sure all required environment variables are set and the database is properly configured before starting the server. Refer to the configuration section for more details.
An open-source mobile application, built using Expo, is currently under development to control the Sunscan instrument. You can find the application repository at: https://github.com/staros-projects/sunscan-app
Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
This project is distributed under the GPLv3 License. See LICENSE
file for more information.