Project structure

Version 13 (Paul Carensac, 08/09/2016 10:59 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 12 Paul Carensac
Here is the detail of 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 13 Paul Carensac
  * fixtures : Contains the initial & test fixtures of the project (see [[Technical_components#Fixtures]])
63 13 Paul Carensac
64 13 Paul Carensac
65 2 Paul Carensac
---
66 2 Paul Carensac
67 2 Paul Carensac
h2. %{margin-left:0px; font-weight:bold; font-size:25px;  display:block; color:red;}Applications architecture%
68 5 Paul Carensac
69 1 Paul Carensac
70 6 Paul Carensac
{{thumbnail(applications_architecture.png , size=3000, title=Application architecture)}}
71 6 Paul Carensac
72 6 Paul Carensac
73 6 Paul Carensac
Django applications are created with the command :
74 6 Paul Carensac
<pre>
75 6 Paul Carensac
$ python manage.py startapp AppName
76 6 Paul Carensac
</pre>
77 6 Paul Carensac
78 6 Paul Carensac
This commands automatically create some files and folders :
79 6 Paul Carensac
80 6 Paul Carensac
 * migrations : A folder containing the DB modifications files (only used in the pyrosapp application)
81 6 Paul Carensac
 * templates : A folder containing the Django HTML templates for this application
82 6 Paul Carensac
 * __init__.py & apps.py : App configuration files (not used)
83 6 Paul Carensac
 * models.py & admin.py : Files desribing database objects, and their representation in the admin interface (only used in pyrosapp)
84 6 Paul Carensac
 * views.py : File containing the code called for each web page
85 6 Paul Carensac
86 6 Paul Carensac
We added some other files to every application :
87 6 Paul Carensac
88 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.
89 6 Paul Carensac
 * tasks.py : File containing the Celery tasks for this application.