Commit c16448c0 authored by Florent Chehab's avatar Florent Chehab

updated uml generation

parent 42992788
......@@ -24,7 +24,7 @@ run_backend: generate_backend
docs:
cd docs/UML && $(MAKE) all
cd docs && $(MAKE) all
docs_clean:
cd docs/UML && $(MAKE) clean
cd docs && $(MAKE) clean
all:
mkdir -p generated
../manage.py graph_models backend --disable-fields -g \
| tail -n +2 > generated/architecture.dot
dot -Tsvg generated/architecture.dot -o generated/architecture.svg
../manage.py graph_models backend --disable-abstract-fields -g -I \
MyModel,MyModelVersionned,BasicModule,Scholarship,UserRestrictedModule \
| tail -n +2 > generated/abstract.dot
dot -Tsvg generated/abstract.dot -o generated/abstract.svg
../manage.py graph_models backend --disable-abstract-fields -g -I \
Specialty,Offer,Semester,Department,University \
| tail -n +2 > generated/core.dot
dot -Tsvg generated/core.dot -o generated/core.svg
../manage.py graph_models backend --disable-abstract-fields -g -I \
University,UniversityScholarship,UniversityInfo,UniversitySemestersDates,UniversityTaggedItems,UniversityDri,Campus,CampusTaggedItems \
| tail -n +2 > generated/university.dot
dot -Tsvg generated/university.dot -o generated/university.svg
../manage.py graph_models backend --disable-abstract-fields -g -I \
Country,City,CountryTaggedItems,CityTaggedItems,CountryScholarship,CountryDri\
| tail -n +2 > generated/location.dot
dot -Tsvg generated/location.dot -o generated/location.svg
../manage.py graph_models backend --disable-abstract-fields -g -I \
RecommendationsList,Recommendation,UserData,PreviousDeparture,PreviousDepartureFeedback,Semester,University,Sepcialty\
| tail -n +2 > generated/user.dot
dot -Tsvg generated/user.dot -o generated/user.svg
.PHONY: clean
clean:
rm -rf generated/
@startuml
!include my_model__module.pu
!include other_core.pu
!include location.pu
!include university.pu
!include UserFunctions.pu
@enduml
TARGET=\
generated/Architecture.svg \
generated/other_core.svg \
generated/university.svg \
generated/my_model__module.svg \
generated/location.svg \
generated/UserFunctions.svg
all: $(TARGET)
generated/%.svg: %.pu
mkdir -p generated/
plantuml -tsvg -o $(abspath generated/) $<
.PHONY: clean
clean:
rm -rf generated/
@startuml
package UserFunctionalities #lightblue{
class UniversityCopy1 as "University" #red
class SpecialtyCopy1 as "Specialty" #red
class UserCopy1 as "User" #red
class SemesterCopy1 as "Semester" #red
class RecommendationsList{
+ title : string
+ public : bool
}
class Recommendation{
+ order_in_list : integer
+ comment : MD
+ grade : int in [0,20]
}
RecommendationsList "1"-right-"*" Recommendation
UniversityCopy1 "*" -up- "*" RecommendationsList
SpecialtyCopy1 "1..n" -up- "*" RecommendationsList
UserCopy1 "1" -left- "*" RecommendationsList
UserCopy1 "1" -right- "*" Recommendation
note on link #white
User <-> Recommendation
Required to controll access
end note
class PreviousDeparture{
+ is_anonymous : bool
+ courses : JSON
+ Utc_departure_id : int
}
class PreviousDepartureFeedback{
+ adequation_comment : MD
+ integration_comment : MD
+ adequation_grade : integer
+ adequation_grade : integer
+ courses_and_courses_feedback : JSON
}
PreviousDeparture "1" -right- "1" PreviousDepartureFeedback
PreviousDeparture "*" -left- "1" UserCopy1
PreviousDeparture "*" -up- "1" SpecialtyCopy1
PreviousDeparture "*" -up- "1" UniversityCopy1
PreviousDeparture "*" -up- "1..n" SemesterCopy1
class UserData{
+ contact_info : JSON
+ contact_info_is_public : bool
+ config : JSON
+ other_data : JSON
}
UserData "1"-up-"1" UserCopy1
}
@enduml
\ No newline at end of file
@startuml
package location{
class City #white {
+ name : string
+ local_name : string
+ area : string
}
class Country #white {
# iso_alpha2_code : string{2}
+ name : string
+ region_code : string{3}
+ region_name : string
+ sub_region_code : string{3}
+ sub_region_name : string
+ intermediate_region_code : string{3}
+ intermediate_region_name : string
}
City "*" -left-* Country
note "Countries are intially \n hardcoded in the db." as N2
N2 .up. Country
abstract class BasicModuleCopyLocation as "BasicModule" #red
class CountryDri
CountryDri -down-|> BasicModuleCopyLocation
Country "*"-down-"*" CountryDri
abstract class CountryTaggedItem
abstract class ScholarShipCopyCountry as "Scholarship" #red
class ScholarshipCountry
ScholarshipCountry -right-|> ScholarShipCopyCountry
ScholarshipCountry "*" -- "*" Country
CountryTaggedItem "*" -- "*" Country
CityTaggedItem "*" -- "*" City
class CityTaggedItem
}
@enduml
\ No newline at end of file
@startuml
package my_model #lightgrey{
abstract class MyModel{
+ moderated_by : user
+ moderated_on : date
+ updated_by : user
+ updated_on : date
}
abstract class MyModelVersionned <Will be versionned\n in the app>{
----
get_serializer()
}
MyModelVersionned -up-|> MyModel
}
package module #lightgrey{
abstract class BasicModule{
+ comment : string
+ usefull_links : JSON \n array of {url,description}
}
abstract class ScholarShip{
+ type : string
+ amount_min : float {currency}
+ amount_max : float {currency}
}
BasicModule -up-|> MyModelVersionned
ScholarShip -up-|> BasicModule
}
@enduml
\ No newline at end of file
@startuml
package Core {
Class Offer {
+ nb_seats_offered : int
}
Class Semester{
+ code : string {key}
}
Class Department{
+ code : string
+ name : string
+ active : bool
}
Class Specialty {
+ code : string
+ name : string
+ active : bool
}
Offer "*" -down- "1" Semester
Offer "*" -left- "1..n" Specialty
Specialty "1..n" -left- "1" Department
note "Initial data inserted in db." as N3
Semester .. N3
N3 .. Specialty
N3 .. Department
class UsefullLinks #green{
+ content : MD
}
note right of UsefullLinks: It will be a dynamic page \n on the website
}
' End of Core block
Offer "*" -right- "1" University
@enduml
\ No newline at end of file
@startuml
skinparam defaultFontName Inconsolata
package universityP{
class University #wheat {
+ name : string
+ accronyme : string
+ logo : image
+ website : url
}
abstract class UniversityTaggedItem
abstract class ScholarShipCopyUniversity as "Scholarship" #red
class SemestersDates{
+ autumn_begin : date
+ autumn_end : date
+ spring_begin : date
+ spring_end : date
}
class UniversityInfo{
+ cost_exchange : float
+ cost_double_degree : float
}
abstract class Campus{
+ is_main_campus : bool
+ name : string
+ Comment : MD
+ longitude : float
+ latitude : float
}
class UniversityDri
UniversityDri -down-|> BasicModuleCopyCore
University "*"-down-"*" UniversityDri
class CampusTaggedItem
Campus -left- CampusTaggedItem
Campus "1..n" -- "1" University
UniversityScholarship -down-|> ScholarShipCopyUniversity
UniversityInfo "1" -down[bold,#green]- "1" University
SemestersDates "1" -down[bold,#green]- "1" University
UniversityTaggedItem "*" -down- "*" University
UniversityScholarship "*" -down- "1" University
}
University "*" .right. "1" City
@enduml
......@@ -4,11 +4,11 @@ Architecture
Présentation de l'architecture du backend.
Vue complète :
![Architecture](UML/generated/Architecture.svg)
![Architecture](generated/architecture.svg)
Vue plus précise :
![other_core](UML/generated/other_core.svg)
![AbstractModules](UML/generated/university.svg)
![Architecture](UML/generated/location.svg)
![Architecture](UML/generated/my_model__module.svg)
![Architecture](UML/generated/UserFunctions.svg)
\ No newline at end of file
![other_core](generated/abstract.svg)
![other_core](generated/core.svg)
![AbstractModules](generated/university.svg)
![Architecture](generated/location.svg)
![Architecture](generated/user.svg)
\ No newline at end of file
......@@ -20,4 +20,4 @@ flake8
django-debug-toolbar==1.9.1
pandas
pyyaml
django-extensions==2.1.2
\ No newline at end of file
git+https://github.com/FloChehab/django-extensions.git@30c1a807aeb985739358d70907496e98d1857abb#egg=django-extensions
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment