Skip to content

Commit 0723a9c

Browse files
authored
Docs getting started (#194)
* docs: Added code of conduct * docs: Updated README to run project localy with ease * style: fixed some typos * Deleted unclear example
1 parent e2ef5b9 commit 0723a9c

File tree

1 file changed

+83
-45
lines changed

1 file changed

+83
-45
lines changed

README.md

+83-45
Original file line numberDiff line numberDiff line change
@@ -1,90 +1,128 @@
11
# Pyronear Platform
22
[![License: Apache 2.0](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE) [![Codacy Badge](https://app.codacy.com/project/badge/Grade/0e4490e06eaf41a3a5faea69dad5caa9)](https://www.codacy.com/gh/pyronear/pyro-platform/dashboard?utm_source=github.com&utm_medium=referral&utm_content=pyronear/pyro-platform&utm_campaign=Badge_Grade) ![Build Status](https://github.com/pyronear/pyro-platform/workflows/dash-project/badge.svg)
33

4-
The building blocks of our wildfire detection & monitoring API.
4+
The open-source platform for managing early wildfire detection
55

66

7-
## Quick Tour
7+
# Installation
88

9-
### Running/stopping the service
9+
## Prerequisites
1010

11-
You can run the app container using this command for dev purposes:
11+
- [Docker](https://docs.docker.com/engine/install/)
12+
- [Docker compose](https://docs.docker.com/compose/)
13+
- [Poetry](https://python-poetry.org/)
14+
- [Make](https://www.gnu.org/software/make/) (optional)
15+
16+
The project was designed so that everything runs with Docker orchestration (standalone virtual environment), so you won't need to install any additional libraries.
17+
18+
## Configuration
19+
20+
In order to run the project, you will need to specific some information, which can be done using a `.env` file.
1221

22+
This file will have to hold the following information:
23+
- `API_URL`: URL to the endpoint of [Pyronear Alert API](https://github.com/pyronear/pyro-api)
24+
- `API_LOGIN`: your login for the API
25+
- `API_PWD`: your password for the API
26+
27+
Optionally, the following information can be added:
28+
- `SENTRY_DSN`: the URL of the [Sentry](https://sentry.io/) project, which monitors back-end errors and report them back.
29+
- `SENTRY_SERVER_NAME`: the server tag to apply to events.
30+
- `DEBUG`: whether the app is in debug or production mode
31+
32+
The file should be placed at the root folder of your local copy of the project.
33+
34+
35+
## Running you service locally
36+
37+
### Clone the repository
1338
```shell
14-
make run_dev
39+
git clone https://github.com/pyronear/pyro-platform.git && cd pyro-platform
1540
```
1641

17-
or for production:
42+
Here, there are several ways to start the service
43+
- Either you have access to a pyronear alert api online through a specific API_URL
44+
- Otherwise, you'll need to create a development environment. Don't panic, here's a tutorial on how to do it smoothly
45+
46+
### Run the service directly with the URL of a pyronear alert api
1847

48+
#### 1 - Set your environment variables
49+
First copy the example environment setup
1950
```shell
20-
make run
51+
cp .env.example .env
2152
```
53+
Fill it with your API_URL and credentials
2254

23-
You can now navigate to `http://localhost:8050/` to interact with the app.
55+
#### 2 - You can run the app container using this command for dev purposes:
56+
```shell
57+
make run_dev
58+
```
59+
60+
### Run the service via a development environment
61+
62+
#### 1 - clone pyro-envdev repository
63+
Move to a directoty where to clone the [pyro-envdev repo](https://github.com/pyronear/pyro-envdev), then
2464

25-
In order to stop the service, run:
2665
```shell
27-
make stop
66+
git clone https://github.com/pyronear/pyro-envdev.git && cd pyro-envdev
2867
```
2968

30-
If you need to launch the pyro-api in your development environment you can use the pyro-devops project.
31-
You can use it in two different ways :
32-
=> by building the pyro-platform image and launch the full development environment with the command :
69+
#### 2 - build & launch required pyro-envdev services
3370
```shell
34-
make run
71+
make build
3572
```
36-
=> by launching the development environment without the platform :
73+
Then, with the following command, you will run the API locally and services that simulate 2 cameras generating alerts
74+
3775
```shell
3876
make run-engine
3977
```
40-
adding this line in your /etc/hosts :
78+
### 3 - Let your webbrowser access images from development environment
79+
by adding this line in your /etc/hosts
80+
4181
```
4282
127.0.0.1 www.localstack.com localstack
4383
```
44-
and launching your project locally :
84+
85+
#### 4 - Go back to pyro-platform & setup credentials
86+
```shell
87+
cd PATH_TO_PYRO-PLATFORM
4588
```
46-
python3 app/index.py
89+
90+
Fill credentials to access your local API, the example below shall work properly as the API_URL give access to your local pyronear api and (API_LOGIN, API_PWD) are taken from [default credentials in the development environment](https://github.com/pyronear/pyro-envdev/blob/main/data/csv/API_DATA_DEV%20-%20users.csv)
91+
92+
```
93+
API_URL='http://host.docker.internal:5050/'
94+
API_LOGIN='github-engine'
95+
API_PWD='passwrd6'
4796
```
4897

49-
## Installation
98+
### 4 - Start your local pyro-plateform
5099

51-
### Prerequisites
100+
Now, you can run the app container using this command for dev purposes:
52101

53-
- [Docker](https://docs.docker.com/engine/install/)
54-
- [Docker compose](https://docs.docker.com/compose/)
55-
- [Poetry](https://python-poetry.org/)
56-
- [Make](https://www.gnu.org/software/make/) (optional)
102+
```shell
103+
make run_dev
104+
```
57105

58-
The project was designed so that everything runs with Docker orchestration (standalone virtual environment), so you won't need to install any additional libraries.
106+
or launch your project locally directly with python:
59107

60-
## Configuration
108+
```shell
109+
python3 app/index.py
110+
```
61111

62-
In order to run the project, you will need to specific some information, which can be done using a `.env` file.
63-
This file will have to hold the following information:
64-
- `API_URL`: URL to the endpoint of [Pyronear Alert API](https://github.com/pyronear/pyro-api)
65-
- `API_LOGIN`: your login for the API
66-
- `API_PWD`: your password for the API
112+
### Check how what you've deployed
67113

68-
Optionally, the following information can be added:
69-
- `SENTRY_DSN`: the URL of the [Sentry](https://sentry.io/) project, which monitors back-end errors and report them back.
70-
- `SENTRY_SERVER_NAME`: the server tag to apply to events.
71-
- `DEBUG`: whether the app is in debug or production mode
114+
You can now navigate to `http://localhost:8050/` to interact with the app.
72115

73-
So your `.env` file should look like something similar to:
74-
```
75-
API_URL='https://alert.mydomain.com/api'
76-
API_LOGIN='forest_saver'
77-
API_PWD='ILoveForest!'
78-
SENTRY_DSN='https://replace.with.you.sentry.dsn/'
79-
SENTRY_SERVER_NAME=my_storage_bucket_name
116+
In order to stop the service, run:
117+
```shell
118+
make stop
80119
```
81120

82-
The file should be placed at the root folder of your local copy of the project.
83121

84-
Also please note that you should use docker-compose-dev.yml file for dev as we do not need reverse proxy:
122+
## Running your service in production
85123

86124
```shell
87-
docker-compose -f docker-compose-dev.yml up
125+
make run
88126
```
89127

90128
For production we use docker-compose.yml in which there is the [Traefik Reverse Proxy](https://traefik.io/traefik/).

0 commit comments

Comments
 (0)