|
1 | 1 | ## Getting Started for Developers |
2 | | -Please follow those steps to setup your development environment. Clone this directory (change branch if not default dev) with submodules using : |
3 | | - |
4 | | -``` |
5 | | -git clone --recursive -b dev https://github.com/introlab/opentera.git |
6 | | -``` |
7 | | - |
8 | | -### Requirements |
9 | | -1. Make sure you have a valid compiler installed: |
10 | | - 1. Linux : gcc/g++. Install it with ```sudo apt-get install build-essential``` |
11 | | - 2. Mac : LLVM through XCode from the App Store |
12 | | - 3. Windows: [Visual Studio C++ 2017 Community Edition](https://visualstudio.microsoft.com/fr/vs/older-downloads/) |
13 | | - |
14 | | -2. Install CMake |
15 | | - 1. Linux : ```sudo apt-get install cmake``` |
16 | | - 2. Mac & Windows: Download from [here.](https://cmake.org/download/) |
17 | | - |
18 | | -3. Install [Qt + QtCreator](https://www.qt.io/) |
19 | | - 1. Use the [Qt Online Installer](https://www.qt.io/download-open-source) (will require a free Qt Account) |
20 | | - 2. Linux: run the installer script, do not forget to make it executable first ```chmod +x <qt-unified-linux...>``` |
21 | | - 3. Install the latest Qt Open Source Edition (Qt 5.14.2 Desktop or later, will be useful for Qt client application) |
22 | | - 4. Install all components except "Android" and "WebAssembly". |
23 | | - 5. Use default directories |
24 | | - |
25 | | -4. Install MiniConda3 |
26 | | - 1. Use installer from [here](https://conda.io/miniconda.html) |
27 | | - 2. Install Python 3.x version for current user (in default user directory). |
28 | | - 3. Use default settings. |
29 | | - |
30 | | -5. Install [PyCharm Community Edition](https://www.jetbrains.com/pycharm/) |
31 | | - |
32 | | -6. Install PostgreSQL with default parameters |
33 | | - 1. Linux : ```sudo apt-get install postgresql``` |
34 | | - 2. Mac & Windows: Download and install from : https://www.postgresql.org/download/ |
35 | | - |
36 | | -7. Install redis server. |
37 | | - 1. Recommanded: Install redis from [Docker](https://hub.docker.com/_/redis) |
38 | | - 2. Linux, Install redis with apt with `sudo apt-get install redis-server` |
39 | | - 3. Windows: install [redis binaries](https://github.com/MicrosoftArchive/redis/releases) |
40 | | - |
41 | | -8. Install NGINX. |
42 | | - 1. Windows: http://nginx.org/en/docs/windows.html |
43 | | - 2. Mac: install with [brew](https://brew.sh/index) |
44 | | - 3. Linux: install with package manager : ```sudo apt-get install nginx``` |
45 | | - |
46 | | -### Step1 : Create the database and database users (only once) |
47 | | -This step needs to be done only once. |
48 | | - ``` |
49 | | - sudo -u postgres psql -c "ALTER USER postgres WITH PASSWORD 'test';" |
50 | | - sudo -u postgres psql -c "create database opentera;" |
51 | | - sudo -u postgres psql -c "create user TeraAgent with encrypted password 'test';" |
52 | | - sudo -u postgres psql -c "grant all privileges on database opentera to TeraAgent;" |
53 | | - sudo -u postgres psql -c "ALTER USER TeraAgent WITH PASSWORD 'tera';" |
54 | | - sudo -u postgres psql -c "create database openteralogs;" |
55 | | - sudo -u postgres psql -c "grant all privileges on database openteralogs to TeraAgent;" |
56 | | - sudo -u postgres psql -c "create database openterafiles;" |
57 | | - sudo -u postgres psql -c "grant all privileges on database openterafiles to TeraAgent;" |
58 | | - sudo -u postgres psql -c "create database bureauactif;" |
59 | | - sudo -u postgres psql -c "create user bureauactif with encrypted password 'bureauactif';" |
60 | | - sudo -u postgres psql -c "grant all privileges on database bureauactif to bureauactif;" |
61 | | - sudo -u postgres psql -c "ALTER USER bureauactif WITH PASSWORD 'bureauactif';" |
62 | | - sudo -u postgres psql -c "\l" |
63 | | - ``` |
64 | | -### Step 2 : Open the root CMakeLists.txt in QtCreator (only once) |
65 | | -1. Opening the root teraserver/CMakeLists.txt will allow to create and build the project |
66 | | - 1. Build the project **using the python-all target**, it will automatically generate the Python environment in env/python-3.6 |
67 | | - 2. Click on the "Projects" and change Build steps target by clicking on "Details" |
68 | | - 2. All python dependencies will be automatically downloaded |
69 | | - 3. Once the project is built, you will not need QtCreator (for now). |
70 | | - |
71 | | -### Step 3 : Create a PyCharm project (only once) |
72 | | -1. Using PyCharm, opening the directory "{PROJECT_ROOT}/python" |
73 | | - 1. Select the existing Python 3.6 environment in "{PROJECT_ROOT}/python/env/python-3.6" in the app menu: PyCharm->Preferences->Project:python->Project Interpreter |
74 | | - |
75 | | -### Step 4: Generate the TLS certicates (only once) |
76 | | -1. Using PyCharm, run the CreateCretificates.py script. This will generate the TLS certificates used by nginx. |
77 | | - |
78 | | -### Step 5 : Run the nginx reverse proxy (every time) |
79 | | -1. Go to the **{PROJECT_ROOT}/teraserver/python/config** directory. |
80 | | -2. Create the logs directory (only once) : ```mkdir logs``` |
81 | | -3. Run the script : ```./start_nginx.sh``` |
82 | | - |
83 | | -### Step 6 : Run the application (every time) |
84 | | -1. Run the TeraServer.py application from PyCharm |
85 | | -2. Edit the code as you would normally do in a python program. |
86 | | -3. Run tests in the tests directory |
87 | | - |
88 | | -### Step 7 : Try the API with swagger UI" (as needed) |
89 | | -1. Navigate to : [API](https://localhost:40075/doc) |
90 | | - |
91 | | -### Notes |
92 | | -1. In a near future, we hope to have everything in the QtCreator IDE. Stay tuned! |
93 | | - |
94 | | -Enjoy! |
| 2 | +Instructions to create a development setup are available here: |
| 3 | +https://introlab.github.io/opentera/developers/Developers.html |
0 commit comments