Metadata-Version: 2.4
Name: openflexure-management-server
Version: 0.0.1
Summary: A service for the OpenFlexure Microscope that manages the microscope.
Project-URL: Homepage, https://openflexure.org/
Project-URL: Bug Tracker, https://gitlab.com/openflexure/openflexure-management-server/-/issues
Project-URL: Source, https://gitlab.com/openflexure/openflexure-management-server/
Author-email: OpenFlexure Project <contact@openflexure.org>
License-File: LICENSE
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.11
Requires-Dist: fastapi[standard]>=0.123.6
Requires-Dist: psutil
Provides-Extra: dev
Requires-Dist: codespell~=2.4; extra == 'dev'
Requires-Dist: mypy[reports]; extra == 'dev'
Requires-Dist: pytest; extra == 'dev'
Requires-Dist: pytest-asyncio; extra == 'dev'
Requires-Dist: pytest-cov; extra == 'dev'
Requires-Dist: pytest-mock==3.14; extra == 'dev'
Requires-Dist: python-gitlab~=6.2; extra == 'dev'
Requires-Dist: ruff~=0.15.1; extra == 'dev'
Requires-Dist: types-psutil; extra == 'dev'
Description-Content-Type: text/markdown

# OpenFlexure Management Server

A server that run on an OpenFlexure Microscope to manage the microscope.

This server is just starting to be written so doesn't yet do much. Currently it is able to:

* Report the microscope server and service status
* Shut down or restart the microscope
* Shut down or restart the server

Eventually it will be able to:

* Configure the server for different hardware
* Install microscope extensions
* Update the microscope

# Installation

This is experimental. When it moves out of the experiment phase it will automatically be installed on microscpe SD images. **It only works on the new Trixie images.**

For now to install a test version on a microscope for developing:

1. Run `ofm activate`
1. Clone the repository
1. Navigate into the repo and run `npm install -e .[dev]`
1. Create a systemd `service` file that mirrors the one used by the microscope (`/etc/systemd/system/openflexure-microscope-server.service`) replacing `openflexure-microscope-server` to `openflexure-management-server`.
1. Run `sudo systemctl enable openflexure-management-server`


# Developing on a Microscope


## Developing the webapp

Use Node 24. If you donlt have node 24, consider using [NVM](https://www.nvmnode.com/) to manage node versions on your computer.

To install, navigate to the webapp directory and run:

```bash
npm install
```

## Running the dev server

To run the dev server run:

```bash
npm run serve
```

The server will update the API endpoints by default to `http://localhost:5001`. To Redirect to a microscope run:

```bash
npm run serve:microscope
```

This will update the API endpoints to point at `http://microscope.local:5001`. To use a different host name use an `.env.local` file with your hostname set to `VITE_MICROSCPOPE_HOST`:

```bash
# Save as .env.local
VITE_MICROSCPOPE_HOST=http://hostname.local:5001
```

This `.env.local` file is ignored by git.


