Project structure

Version 17 (Paul Carensac, 08/09/2016 11:29 am)

1 1 Paul Carensac
h1. Project structure
2 2 Paul Carensac
3 2 Paul Carensac
4 2 Paul Carensac
Schemas and descriptions of the project's architecture.
5 2 Paul Carensac
6 2 Paul Carensac
7 2 Paul Carensac
{{>toc}}
8 2 Paul Carensac
9 2 Paul Carensac
---
10 2 Paul Carensac
11 7 Paul Carensac
h2. %{margin-left:0px; font-weight:bold; font-size:25px;  display:block; color:red;}Pyros Design%
12 2 Paul Carensac
13 5 Paul Carensac
14 4 Paul Carensac
{{thumbnail(pyros_design_en.png, size=3000, title=Pyros workflow)}}
15 1 Paul Carensac
16 7 Paul Carensac
Each application is represented here, as well as the external agents.
17 7 Paul Carensac
We can see every interaction between the applications, with the main workflow in red.
18 3 Paul Carensac
19 8 Paul Carensac
All the applications are detailed [[Pyros_applications|here]].
20 8 Paul Carensac
21 3 Paul Carensac
---
22 2 Paul Carensac
23 2 Paul Carensac
h2. %{margin-left:0px; font-weight:bold; font-size:25px;  display:block; color:red;}Folders architecture%
24 2 Paul Carensac
25 2 Paul Carensac
26 5 Paul Carensac
{{thumbnail(folders_architecture.png , size=3000, title=Pyros workflow)}}
27 5 Paul Carensac
28 5 Paul Carensac
29 9 Paul Carensac
 * PYROS : Main folder of the project, root of the git repository
30 9 Paul Carensac
31 9 Paul Carensac
  * doc : Contains all the documentation
32 9 Paul Carensac
33 9 Paul Carensac
   * database : Contains the database files (schema, creation sql script)
34 9 Paul Carensac
   * uml : usecases and activities diagrams for the applications
35 9 Paul Carensac
   * diagrams : other useful diagrams
36 10 Paul Carensac
37 11 Paul Carensac
  * install : Everything needed at the installation
38 11 Paul Carensac
39 11 Paul Carensac
   * scripts & requirements : Files making the installation automatic
40 11 Paul Carensac
   * windows libs : Folder containing libraries copied from linux that cannot be found with the good version on windows
41 11 Paul Carensac
42 12 Paul Carensac
  * private : Folder not tracked by git
43 1 Paul Carensac
44 12 Paul Carensac
   * virtual environment : python version & libraries used by the project
45 12 Paul Carensac
   * Any unshared content : private is your own directory, you can add anything you want in it
46 12 Paul Carensac
47 12 Paul Carensac
  * simulators : Simulators for Devices & PLC
48 12 Paul Carensac
49 12 Paul Carensac
   * scripts : They start and stop the simulators
50 12 Paul Carensac
   * code : The python code for the simulators
51 12 Paul Carensac
   * configuration : A file describing the IP & Port for each simulator
52 12 Paul Carensac
53 12 Paul Carensac
  * src : Source folder containing most of the project's content (detailed below)
54 12 Paul Carensac
55 12 Paul Carensac
  * .gitignore, README, run script : A few additional useful files
56 12 Paul Carensac
57 16 Paul Carensac
Here are the details for the src folder :
58 12 Paul Carensac
59 12 Paul Carensac
 * src : Source folder containing most of the project's content
60 12 Paul Carensac
61 12 Paul Carensac
  * apps : Django applications folders (detailed in the next section)
62 14 Paul Carensac
  * fixtures : Contains the initial & test fixtures of the project (see [[Technical_components#Fixtures|Fixtures]])
63 15 Paul Carensac
  * images : Contains the "images" files created by the simulators, and the analysis files (they are to be placed in a better folder)
64 15 Paul Carensac
  * pyros : Django configuration folder
65 15 Paul Carensac
  * saved_requests : Used to store the request files when a user want to export a request (we create the file here, then it can be downloaded)
66 15 Paul Carensac
  * scripts : Folder containing all the scripts for the project (see [[Scripts]])
67 15 Paul Carensac
  * static : Contains all the static files, mostly (or entirely) for the web pages (CSS, JS, images, ...)
68 15 Paul Carensac
  * global templates : Templates that will be used in several application (only the base.html for the moment)
69 15 Paul Carensac
  * manage.py : Django python script to run the Django commands (startapp, makemigrations, migrate, runserver, ...)
70 13 Paul Carensac
71 2 Paul Carensac
---
72 2 Paul Carensac
73 2 Paul Carensac
h2. %{margin-left:0px; font-weight:bold; font-size:25px;  display:block; color:red;}Applications architecture%
74 5 Paul Carensac
75 1 Paul Carensac
76 6 Paul Carensac
{{thumbnail(applications_architecture.png , size=3000, title=Application architecture)}}
77 6 Paul Carensac
78 6 Paul Carensac
79 6 Paul Carensac
Django applications are created with the command :
80 6 Paul Carensac
<pre>
81 6 Paul Carensac
$ python manage.py startapp AppName
82 6 Paul Carensac
</pre>
83 6 Paul Carensac
84 6 Paul Carensac
This commands automatically create some files and folders :
85 6 Paul Carensac
86 6 Paul Carensac
 * migrations : A folder containing the DB modifications files (only used in the pyrosapp application)
87 6 Paul Carensac
 * templates : A folder containing the Django HTML templates for this application
88 6 Paul Carensac
 * __init__.py & apps.py : App configuration files (not used)
89 6 Paul Carensac
 * models.py & admin.py : Files desribing database objects, and their representation in the admin interface (only used in pyrosapp)
90 6 Paul Carensac
 * views.py : File containing the code called for each web page
91 6 Paul Carensac
92 6 Paul Carensac
We added some other files to every application :
93 6 Paul Carensac
94 6 Paul Carensac
 * urls.py : File describing the routing from urls to views. Directly linked to (and called by) the "pyros" folder's urls.py.
95 6 Paul Carensac
 * tasks.py : File containing the Celery tasks for this application.