halfapi/README.md

87 lines
1.4 KiB
Markdown
Raw Normal View History

2020-07-14 15:14:23 +02:00
# HalfAPI
2020-06-30 17:50:35 +02:00
This Python-based ASGI application aims to provide the core functionality to
multiple API domains.
It's developed at the [LIRMM](https://lirmm.fr) in Montpellier, France.
The name "halfAPI" comes from the deep relationship between it and
2020-07-14 15:14:23 +02:00
[halfORM](https://gite.lirmm.fr/newsi/halfORM), a project authored by
2020-06-30 17:50:35 +02:00
[Joël Maizi](https://gite.lirmm.fr/maizi).
2020-07-14 15:14:23 +02:00
You'll need a database with the API details. You can find the database model in halfapi/models/api.sql
**TODO :** include a token generation tool for testing purpose.
## Dependencies
- python3
- python3-pip
2020-07-29 21:25:12 +02:00
- libgit2-dev
2020-07-14 15:14:23 +02:00
## Installing
2020-07-29 21:25:12 +02:00
With local folder :
2020-07-29 21:25:12 +02:00
`pip3 install -r requirements.txt .[cli]`
2020-07-29 21:25:12 +02:00
From the repository :
2020-07-29 21:25:12 +02:00
`pip3 install git+ssh://git@gite.lirmm.fr:malves/halfapi.git[cli]`
2020-07-14 15:14:23 +02:00
2020-07-29 21:25:12 +02:00
## CLI usage
2020-07-14 15:14:23 +02:00
## Running
2020-07-14 15:14:23 +02:00
### Development mode
2020-07-29 21:25:12 +02:00
In the project's folder :
2020-07-14 15:14:23 +02:00
2020-07-29 21:25:12 +02:00
`halfapi run`
2020-07-14 15:14:23 +02:00
2020-07-14 15:14:23 +02:00
### Production
2020-07-14 15:14:23 +02:00
The production server may use different init systems. As our main server is Debian-based, we use systemd services to manage the api server. Find the right service files and configure them properly in order to make your production setup perfect.
2020-07-15 00:11:31 +02:00
```
cp conf/systemd/lirmm_api* /etc/systemd/system/
systemctl daemon-reload
systemctl start lirmm_api
```
To make it start at boot :
`systemctl enable lirmm_api`
To get the logs :
```
journalctl -f --unit lirmm_api
```
2020-07-29 21:25:12 +02:00
## Testing
### Installing
pip3 install .[cli][tests]
### Running
pytest -v