Skip to content
This repository was archived by the owner on Oct 25, 2019. It is now read-only.

Commit 6c9109f

Browse files
authored
Merge pull request #62 from ISTIC-M2-ILa-GM/dev
Initial release
2 parents 9096511 + 9a3f118 commit 6c9109f

File tree

293 files changed

+34765
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

293 files changed

+34765
-1
lines changed

.gitignore

Lines changed: 200 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,200 @@
1+
# Created by .ignore support plugin (hsz.mobi)
2+
### JetBrains template
3+
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm
4+
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
5+
6+
# User-specific stuff
7+
.idea/**/workspace.xml
8+
.idea/**/tasks.xml
9+
.idea/**/usage.statistics.xml
10+
.idea/**/dictionaries
11+
.idea/**/shelf
12+
13+
# Sensitive or high-churn files
14+
.idea/**/dataSources/
15+
.idea/**/dataSources.ids
16+
.idea/**/dataSources.local.xml
17+
.idea/**/sqlDataSources.xml
18+
.idea/**/dynamic.xml
19+
.idea/**/uiDesigner.xml
20+
.idea/**/dbnavigator.xml
21+
22+
# Gradle
23+
.idea/**/gradle.xml
24+
.idea/**/libraries
25+
26+
# Gradle and Maven with auto-import
27+
# When using Gradle or Maven with auto-import, you should exclude module files,
28+
# since they will be recreated, and may cause churn. Uncomment if using
29+
# auto-import.
30+
# .idea/modules.xml
31+
# .idea/*.iml
32+
# .idea/modules
33+
34+
# CMake
35+
cmake-build-*/
36+
37+
# Mongo Explorer plugin
38+
.idea/**/mongoSettings.xml
39+
40+
# File-based project format
41+
*.iws
42+
43+
# IntelliJ
44+
out/
45+
46+
# mpeltonen/sbt-idea plugin
47+
.idea_modules/
48+
49+
# JIRA plugin
50+
atlassian-ide-plugin.xml
51+
52+
# Cursive Clojure plugin
53+
.idea/replstate.xml
54+
55+
# Crashlytics plugin (for Android Studio and IntelliJ)
56+
com_crashlytics_export_strings.xml
57+
crashlytics.properties
58+
crashlytics-build.properties
59+
fabric.properties
60+
61+
# Editor-based Rest Client
62+
.idea/httpRequests
63+
### Eclipse template
64+
65+
.metadata
66+
bin/
67+
tmp/
68+
*.tmp
69+
*.bak
70+
*.swp
71+
*~.nib
72+
local.properties
73+
.settings/
74+
.loadpath
75+
.recommenders
76+
77+
# External tool builders
78+
.externalToolBuilders/
79+
80+
# Locally stored "Eclipse launch configurations"
81+
*.launch
82+
83+
# PyDev specific (Python IDE for Eclipse)
84+
*.pydevproject
85+
86+
# CDT-specific (C/C++ Development Tooling)
87+
.cproject
88+
89+
# CDT- autotools
90+
.autotools
91+
92+
# Java annotation processor (APT)
93+
.factorypath
94+
95+
# PDT-specific (PHP Development Tools)
96+
.buildpath
97+
98+
# sbteclipse plugin
99+
.target
100+
101+
# Tern plugin
102+
.tern-project
103+
104+
# TeXlipse plugin
105+
.texlipse
106+
107+
# STS (Spring Tool Suite)
108+
.springBeans
109+
110+
# Code Recommenders
111+
.recommenders/
112+
113+
# Annotation Processing
114+
.apt_generated/
115+
116+
# Scala IDE specific (Scala & Java development for Eclipse)
117+
.cache-main
118+
.scala_dependencies
119+
.worksheet
120+
### SublimeText template
121+
# Cache files for Sublime Text
122+
*.tmlanguage.cache
123+
*.tmPreferences.cache
124+
*.stTheme.cache
125+
126+
# Workspace files are user-specific
127+
*.sublime-workspace
128+
129+
# Project files should be checked into the repository, unless a significant
130+
# proportion of contributors will probably not be using Sublime Text
131+
# *.sublime-project
132+
133+
# SFTP configuration file
134+
sftp-config.json
135+
136+
# Package control specific files
137+
Package Control.last-run
138+
Package Control.ca-list
139+
Package Control.ca-bundle
140+
Package Control.system-ca-bundle
141+
Package Control.cache/
142+
Package Control.ca-certs/
143+
Package Control.merged-ca-bundle
144+
Package Control.user-ca-bundle
145+
oscrypto-ca-bundle.crt
146+
bh_unicode_properties.cache
147+
148+
# Sublime-github package stores a github token in this file
149+
# https://packagecontrol.io/packages/sublime-github
150+
GitHub.sublime-settings
151+
### Example user template template
152+
### Example user template
153+
154+
# IntelliJ project files
155+
.idea
156+
*.iml
157+
out
158+
gen### VisualStudioCode template
159+
.vscode/*
160+
!.vscode/settings.json
161+
!.vscode/tasks.json
162+
!.vscode/launch.json
163+
!.vscode/extensions.json
164+
### Java template
165+
# Compiled class file
166+
*.class
167+
168+
# Log file
169+
*.log
170+
171+
# BlueJ files
172+
*.ctxt
173+
174+
# Mobile Tools for Java (J2ME)
175+
.mtj.tmp/
176+
177+
# Package Files #
178+
*.jar
179+
*.war
180+
*.nar
181+
*.ear
182+
*.zip
183+
*.tar.gz
184+
*.rar
185+
186+
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
187+
hs_err_pid*
188+
### Maven template
189+
target/
190+
pom.xml.tag
191+
pom.xml.releaseBackup
192+
pom.xml.versionsBackup
193+
pom.xml.next
194+
release.properties
195+
dependency-reduced-pom.xml
196+
buildNumber.properties
197+
.mvn/timing.properties
198+
.mvn/wrapper/maven-wrapper.jar
199+
200+
.scannerwork/

.travis.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
language: java
2+
3+
jdk: oraclejdk8
4+
addons:
5+
mariadb: '10.0'
6+
sonarcloud:
7+
organization: istic-m2-ila-gm
8+
token:
9+
secure: gB1i45TRkllllH3ZmGja1naGsIEv5Jm7AespiBy+oXP2p1NPyfJB9YoeUDhluuN9pfOluOVDcBb12On47QptbDAFiDxc28s9RIj5QzPgeH0KQlppiNUzIrQADWk/gUrrdV5A4Y6sj7UC3BVJL3Wnr/DVDQ6Htneioo88b8cXms58rJ81WhqskYOX/Mh3AxCpa8mSQf+l5/eCpCWFKo5R9Et2o/0I0LWA6ahgz7ar+HCcl7sOeMXVziI3LZufzQs0eIQb/yhj9S7FJ2tUxiyA6RbSv3WIW/ItKjXuaeutz7jb/nyH5MVCfyhdkxbSHpmGlQ9b0bEU9aIbkU/L9iXFdKeZ85YdlSD1Kwf02XOUpfV3a6fF3dI3xVqwFCU813NPXPdahyS7QUUgBwGzB3SN9RG73D/+RWr1P4+t3HQhpd6ulYHa1ACbuMyVG2mnujfv4TN1gU0xrZriDtbWsLtuF74oQEPLABft7Oh75X0GtjU0392EiCGJX/b59YDEuzmlGTUOqmneuHRT3A/ToOTUhTuc98HFoA6wUArNm+p3F8XQa1/5UOOumKdDrdjkZ4DjnwutUvippG9QaH0LtMF6hhpeQIS7beZ/QEEVXtX7ct8BvgeedukU5uSulyHZvWhIOn2fUqbRo37BFfygJUSSw3quBonRKEOOWEMSa9mtlyQ=
10+
11+
env:
12+
- NODE_VERSION="8"
13+
14+
before_install:
15+
- nvm install $NODE_VERSION
16+
- node --version
17+
- npm --version
18+
- npm i -g angular-cli
19+
- mysql -e 'CREATE DATABASE IF NOT EXISTS weplan;'
20+
- mysql -u root -e "CREATE USER 'weplan'@'localhost' IDENTIFIED BY 'weplan';"
21+
- mysql -u root -e "GRANT ALL ON weplan.* TO 'weplan'@'localhost';"
22+
23+
cache:
24+
directories:
25+
- "$HOME/.m2/repository"
26+
- "$HOME/.sonar/cache"
27+
- "front/node_modules"
28+
29+
jobs:
30+
include:
31+
- script: mvn -B org.jacoco:jacoco-maven-plugin:prepare-agent verify failsafe:integration-test && sonar-scanner
32+
name: Unit, Integration Tests & Quality

DESIGN.md

Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
# WePlan Design
2+
3+
## Model
4+
5+
![Model](http://www.plantuml.com/plantuml/proxy?src=https://raw.githubusercontent.com/ISTIC-M2-ILa-GM/WePlan/dev/spec/model.puml)
6+
7+
## Architecture
8+
9+
To develop this project, we use test driven developpment (TDD) and pair programming.
10+
11+
### Front end
12+
13+
The front end application runs with the Angular 6+ framework.
14+
15+
The web-app sends and receives data asynchronously to the back-end server using services stored in `src/app/services`.
16+
17+
All pages (templates) are written in HTML and stored in `src/app/components`. The app is designed using [Materialize CSS](https://materializecss.com/) wrapped in the [ngx-materialize](https://github.com/sherweb/ngx-materialize) Angular module.
18+
19+
### Back end
20+
21+
The Back end application used the hexagonal architecture (also known as *Ports and Adapters*). The domain layer isn't depending on any other layer. It provides some interfaces for the infrastructure layer known as Service Provider Interfaces (SPI), we can found them at *domain/src/main/java/fr/istic/gm/weplan/domain/adapter*. It also provides others interfaces for the server layer known as Application Provider Interfaces (API), wan found them at *domain/src/main/java/fr/istic/gm/weplan/domain/service*.
22+
23+
## Technology
24+
25+
* Languages: TypeScript/Java
26+
* Front end: Angular - Single page application (SPA)
27+
* Back end: Spring Boot - Restful webserver
28+
* Build: maven + npm
29+
* Deploy: docker
30+
31+
32+
* Package: fr.istic.gm.weplan
33+
* Artifact: we-plan
34+
* Server artifact: we-plan-server
35+
36+
## Modules
37+
38+
we-plan: Parent module.
39+
we-plan-front: It contains the presentation layer.
40+
we-plan-domain: It contains the business logic and defines how the layer outside of it can interact with it.
41+
we-plan-infra: It contains all the infrastructure logic and communication likes external API or databases communications.
42+
we-plan-server: It contains all the server logic and the API exposure.
43+
44+
## Restful API
45+
46+
See more information at [spec/endpoint.md](https://github.com/ISTIC-M2-ILa-GM/WePlan/blob/dev/spec/endpoint.md)
47+
48+
## Build
49+
50+
You need to configure the token of the weatherbit API, rename and configure the file:
51+
52+
server/src/main/resources/application-weather.properties.default
53+
54+
You need to create an account on the weatherbit api: https://www.weatherbit.io/api
55+
It's quick, easy and free on a limit usage.
56+
57+
Build
58+
59+
mvn install
60+
61+
Maven will also build the front application and the docker image.
62+
63+
### Quicker build without starting tests
64+
65+
mvn install -DskipTests
66+
67+
### Build docker image
68+
69+
mvn package -DskipTests
70+
71+
## Start
72+
73+
with Docker compose:
74+
75+
docker-compose up
76+
77+
connect to the docker database:
78+
79+
sudo mysql -uroot -pweplan -h$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' CONTAINER_ID)
80+
81+
CONTAINER_ID the container_id of the mariadb container.
82+
83+
### Available profile
84+
85+
dev: for the development database h2
86+
prod: for the production database mariadb
87+
weather: always required for the weather api
88+
89+
## Project Management
90+
91+
We use a KANBAN board to manage the project.
92+
93+
### Features done
94+
95+
#### Project
96+
97+
- [X] Use continous integration with travis
98+
- [X] Use quality code checking with sonarqube
99+
- [X] Generate an API documentation with swagger
100+
- [X] Make some UML diagram with plantuml
101+
- [X] Use the hexagonal architecture
102+
- [X] Use test driven development
103+
- [X] Use pair programming
104+
- [X] Deploy the application with docker compose
105+
106+
#### Back end
107+
108+
- [X] Develop API to manage User, City, Department, Region, Activity, Event, and Authentication
109+
- [X] Generate event with an algorithm which use a weather api at thursday 6:00pm
110+
- [X] Broadcast event generated with STOMP websocket protocol
111+
- [X] Use aspect to parse all exception of the application with a custom format
112+
- [X] Use aspect to display all logging message
113+
- [X] Validate all API request params to protect the domain layer
114+
- [X] Communication with a weather API and generate client with swagger
115+
- [X] Encrypt user's password in the database
116+
- [X] Protect the API with a security config
117+
- [X] Test the application with a coverage higher than 95%
118+
- [X] Make some automatic and manual (postman) integration testing
119+
- [X] Generate some data in the database at the start of the application
120+
121+
#### Front end
122+
123+
- [X] Develop the API communication
124+
- [X] Implement a proxy in develop mode
125+
- [X] Use an angular front library which implement Material Design
126+
- [X] Create some view like login, register, user's profile, user's preference and events list
127+
- [X] Develop an authentication management
128+
129+
### Features todo
130+
131+
- [ ] Enhance entities (more validation)
132+
- [ ] Add missing units and integrations tests
133+
- [ ] Add support of deletedAt of child entities
134+
- [ ] Implement API to patch an activity
135+
- [ ] Add admin view/API to manage all entities and to search them
136+
- [ ] Add authentication support on the websocket event api
137+
- [ ] Correct patch api to support custom data / object likes password
138+
- [ ] Add ssl support
139+
- [ ] Switch authentication to JWT token
140+
- [ ] Add errors messages to the front
141+
- [ ] Add websocket event api support to the front

0 commit comments

Comments
 (0)