├── .gitignore ├── LICENSE ├── README.md ├── Vagrantfile ├── bootstrap.sh ├── mase-core ├── .gitignore ├── pom.xml └── src │ ├── main │ ├── java │ │ └── io │ │ │ └── github │ │ │ └── javageeks │ │ │ └── mase │ │ │ ├── model │ │ │ ├── Todo.java │ │ │ └── User.java │ │ │ ├── repository │ │ │ ├── TodoRepository.java │ │ │ └── UserRepository.java │ │ │ └── service │ │ │ ├── TodoService.java │ │ │ ├── UserService.java │ │ │ └── impl │ │ │ ├── TodoServiceImpl.java │ │ │ └── UserServiceImpl.java │ └── resources │ │ └── spring │ │ └── mase-core-context.xml │ └── test │ └── java │ └── io │ └── github │ └── javageeks │ └── mase │ └── service │ └── test │ ├── TodoRepositoryTest.java │ ├── TodoServiceTest.java │ └── UserServiceTest.java ├── mase-web ├── .gitignore ├── pom.xml └── src │ └── main │ ├── java │ └── io │ │ └── github │ │ └── javageeks │ │ └── mase │ │ └── web │ │ ├── TodoController.java │ │ ├── UserController.java │ │ └── util │ │ ├── CORSFilter.java │ │ ├── DatabasePopulator.java │ │ ├── SessionData.java │ │ └── SessionHandlerInterceptor.java │ └── webapp │ ├── WEB-INF │ ├── spring │ │ └── mase-web-context.xml │ └── web.xml │ ├── css │ ├── app.css │ ├── bootstrap.min.css │ ├── font-awesome.min.css │ └── jumbotron-narrow.css │ ├── fonts │ ├── FontAwesome.otf │ ├── fontawesome-webfont.eot │ ├── fontawesome-webfont.svg │ ├── fontawesome-webfont.ttf │ ├── fontawesome-webfont.woff │ ├── glyphicons-halflings-regular.eot │ ├── glyphicons-halflings-regular.svg │ ├── glyphicons-halflings-regular.ttf │ └── glyphicons-halflings-regular.woff │ ├── index.html │ ├── js │ ├── app.js │ ├── controllers.js │ ├── directives.js │ ├── filters.js │ ├── lib │ │ └── angular │ │ │ ├── angular-animate.js │ │ │ ├── angular-animate.min.js │ │ │ ├── angular-animate.min.js.map │ │ │ ├── angular-cookies.js │ │ │ ├── angular-cookies.min.js │ │ │ ├── angular-cookies.min.js.map │ │ │ ├── angular-csp.css │ │ │ ├── angular-loader.js │ │ │ ├── angular-loader.min.js │ │ │ ├── angular-loader.min.js.map │ │ │ ├── angular-resource.js │ │ │ ├── angular-resource.min.js │ │ │ ├── angular-resource.min.js.map │ │ │ ├── angular-route.js │ │ │ ├── angular-route.min.js │ │ │ ├── angular-route.min.js.map │ │ │ ├── angular-sanitize.js │ │ │ ├── angular-sanitize.min.js │ │ │ ├── angular-sanitize.min.js.map │ │ │ ├── angular-scenario.js │ │ │ ├── angular-touch.js │ │ │ ├── angular-touch.min.js │ │ │ ├── angular-touch.min.js.map │ │ │ ├── angular.js │ │ │ ├── angular.min.js │ │ │ ├── angular.min.js.gzip │ │ │ ├── angular.min.js.map │ │ │ ├── errors.json │ │ │ ├── i18n │ │ │ ├── angular-locale_af-na.js │ │ │ ├── angular-locale_af-za.js │ │ │ ├── angular-locale_af.js │ │ │ ├── angular-locale_am-et.js │ │ │ ├── angular-locale_am.js │ │ │ ├── angular-locale_ar-001.js │ │ │ ├── angular-locale_ar-ae.js │ │ │ ├── angular-locale_ar-bh.js │ │ │ ├── angular-locale_ar-dz.js │ │ │ ├── angular-locale_ar-eg.js │ │ │ ├── angular-locale_ar-iq.js │ │ │ ├── angular-locale_ar-jo.js │ │ │ ├── angular-locale_ar-kw.js │ │ │ ├── angular-locale_ar-lb.js │ │ │ ├── angular-locale_ar-ly.js │ │ │ ├── angular-locale_ar-ma.js │ │ │ ├── angular-locale_ar-om.js │ │ │ ├── angular-locale_ar-qa.js │ │ │ ├── angular-locale_ar-sa.js │ │ │ ├── angular-locale_ar-sd.js │ │ │ ├── angular-locale_ar-sy.js │ │ │ ├── angular-locale_ar-tn.js │ │ │ ├── angular-locale_ar-ye.js │ │ │ ├── angular-locale_ar.js │ │ │ ├── angular-locale_bg-bg.js │ │ │ ├── angular-locale_bg.js │ │ │ ├── angular-locale_bn-bd.js │ │ │ ├── angular-locale_bn-in.js │ │ │ ├── angular-locale_bn.js │ │ │ ├── angular-locale_ca-ad.js │ │ │ ├── angular-locale_ca-es.js │ │ │ ├── angular-locale_ca.js │ │ │ ├── angular-locale_cs-cz.js │ │ │ ├── angular-locale_cs.js │ │ │ ├── angular-locale_da-dk.js │ │ │ ├── angular-locale_da.js │ │ │ ├── angular-locale_de-at.js │ │ │ ├── angular-locale_de-be.js │ │ │ ├── angular-locale_de-ch.js │ │ │ ├── angular-locale_de-de.js │ │ │ ├── angular-locale_de-li.js │ │ │ ├── angular-locale_de-lu.js │ │ │ ├── angular-locale_de.js │ │ │ ├── angular-locale_el-cy.js │ │ │ ├── angular-locale_el-gr.js │ │ │ ├── angular-locale_el.js │ │ │ ├── angular-locale_en-as.js │ │ │ ├── angular-locale_en-au.js │ │ │ ├── angular-locale_en-bb.js │ │ │ ├── angular-locale_en-be.js │ │ │ ├── angular-locale_en-bm.js │ │ │ ├── angular-locale_en-bw.js │ │ │ ├── angular-locale_en-bz.js │ │ │ ├── angular-locale_en-ca.js │ │ │ ├── angular-locale_en-dsrt-us.js │ │ │ ├── angular-locale_en-dsrt.js │ │ │ ├── angular-locale_en-fm.js │ │ │ ├── angular-locale_en-gb.js │ │ │ ├── angular-locale_en-gu.js │ │ │ ├── angular-locale_en-gy.js │ │ │ ├── angular-locale_en-hk.js │ │ │ ├── angular-locale_en-ie.js │ │ │ ├── angular-locale_en-in.js │ │ │ ├── angular-locale_en-iso.js │ │ │ ├── angular-locale_en-jm.js │ │ │ ├── angular-locale_en-mh.js │ │ │ ├── angular-locale_en-mp.js │ │ │ ├── angular-locale_en-mt.js │ │ │ ├── angular-locale_en-mu.js │ │ │ ├── angular-locale_en-na.js │ │ │ ├── angular-locale_en-nz.js │ │ │ ├── angular-locale_en-ph.js │ │ │ ├── angular-locale_en-pk.js │ │ │ ├── angular-locale_en-pr.js │ │ │ ├── angular-locale_en-pw.js │ │ │ ├── angular-locale_en-sg.js │ │ │ ├── angular-locale_en-tc.js │ │ │ ├── angular-locale_en-tt.js │ │ │ ├── angular-locale_en-um.js │ │ │ ├── angular-locale_en-us.js │ │ │ ├── angular-locale_en-vg.js │ │ │ ├── angular-locale_en-vi.js │ │ │ ├── angular-locale_en-za.js │ │ │ ├── angular-locale_en-zw.js │ │ │ ├── angular-locale_en.js │ │ │ ├── angular-locale_es-419.js │ │ │ ├── angular-locale_es-ar.js │ │ │ ├── angular-locale_es-bo.js │ │ │ ├── angular-locale_es-cl.js │ │ │ ├── angular-locale_es-co.js │ │ │ ├── angular-locale_es-cr.js │ │ │ ├── angular-locale_es-do.js │ │ │ ├── angular-locale_es-ea.js │ │ │ ├── angular-locale_es-ec.js │ │ │ ├── angular-locale_es-es.js │ │ │ ├── angular-locale_es-gq.js │ │ │ ├── angular-locale_es-gt.js │ │ │ ├── angular-locale_es-hn.js │ │ │ ├── angular-locale_es-ic.js │ │ │ ├── angular-locale_es-mx.js │ │ │ ├── angular-locale_es-ni.js │ │ │ ├── angular-locale_es-pa.js │ │ │ ├── angular-locale_es-pe.js │ │ │ ├── angular-locale_es-pr.js │ │ │ ├── angular-locale_es-py.js │ │ │ ├── angular-locale_es-sv.js │ │ │ ├── angular-locale_es-us.js │ │ │ ├── angular-locale_es-uy.js │ │ │ ├── angular-locale_es-ve.js │ │ │ ├── angular-locale_es.js │ │ │ ├── angular-locale_et-ee.js │ │ │ ├── angular-locale_et.js │ │ │ ├── angular-locale_eu-es.js │ │ │ ├── angular-locale_eu.js │ │ │ ├── angular-locale_fa-af.js │ │ │ ├── angular-locale_fa-ir.js │ │ │ ├── angular-locale_fa.js │ │ │ ├── angular-locale_fi-fi.js │ │ │ ├── angular-locale_fi.js │ │ │ ├── angular-locale_fil-ph.js │ │ │ ├── angular-locale_fil.js │ │ │ ├── angular-locale_fr-be.js │ │ │ ├── angular-locale_fr-bf.js │ │ │ ├── angular-locale_fr-bi.js │ │ │ ├── angular-locale_fr-bj.js │ │ │ ├── angular-locale_fr-bl.js │ │ │ ├── angular-locale_fr-ca.js │ │ │ ├── angular-locale_fr-cd.js │ │ │ ├── angular-locale_fr-cf.js │ │ │ ├── angular-locale_fr-cg.js │ │ │ ├── angular-locale_fr-ch.js │ │ │ ├── angular-locale_fr-ci.js │ │ │ ├── angular-locale_fr-cm.js │ │ │ ├── angular-locale_fr-dj.js │ │ │ ├── angular-locale_fr-fr.js │ │ │ ├── angular-locale_fr-ga.js │ │ │ ├── angular-locale_fr-gf.js │ │ │ ├── angular-locale_fr-gn.js │ │ │ ├── angular-locale_fr-gp.js │ │ │ ├── angular-locale_fr-gq.js │ │ │ ├── angular-locale_fr-km.js │ │ │ ├── angular-locale_fr-lu.js │ │ │ ├── angular-locale_fr-mc.js │ │ │ ├── angular-locale_fr-mf.js │ │ │ ├── angular-locale_fr-mg.js │ │ │ ├── angular-locale_fr-ml.js │ │ │ ├── angular-locale_fr-mq.js │ │ │ ├── angular-locale_fr-ne.js │ │ │ ├── angular-locale_fr-re.js │ │ │ ├── angular-locale_fr-yt.js │ │ │ ├── angular-locale_fr.js │ │ │ ├── angular-locale_gl-es.js │ │ │ ├── angular-locale_gl.js │ │ │ ├── angular-locale_gsw-ch.js │ │ │ ├── angular-locale_gsw.js │ │ │ ├── angular-locale_gu-in.js │ │ │ ├── angular-locale_gu.js │ │ │ ├── angular-locale_he-il.js │ │ │ ├── angular-locale_he.js │ │ │ ├── angular-locale_hi-in.js │ │ │ ├── angular-locale_hi.js │ │ │ ├── angular-locale_hr-hr.js │ │ │ ├── angular-locale_hr.js │ │ │ ├── angular-locale_hu-hu.js │ │ │ ├── angular-locale_hu.js │ │ │ ├── angular-locale_id-id.js │ │ │ ├── angular-locale_id.js │ │ │ ├── angular-locale_in.js │ │ │ ├── angular-locale_is-is.js │ │ │ ├── angular-locale_is.js │ │ │ ├── angular-locale_it-it.js │ │ │ ├── angular-locale_it-sm.js │ │ │ ├── angular-locale_it.js │ │ │ ├── angular-locale_iw.js │ │ │ ├── angular-locale_ja-jp.js │ │ │ ├── angular-locale_ja.js │ │ │ ├── angular-locale_kn-in.js │ │ │ ├── angular-locale_kn.js │ │ │ ├── angular-locale_ko-kr.js │ │ │ ├── angular-locale_ko.js │ │ │ ├── angular-locale_ln-cd.js │ │ │ ├── angular-locale_ln.js │ │ │ ├── angular-locale_lt-lt.js │ │ │ ├── angular-locale_lt.js │ │ │ ├── angular-locale_lv-lv.js │ │ │ ├── angular-locale_lv.js │ │ │ ├── angular-locale_ml-in.js │ │ │ ├── angular-locale_ml.js │ │ │ ├── angular-locale_mr-in.js │ │ │ ├── angular-locale_mr.js │ │ │ ├── angular-locale_ms-my.js │ │ │ ├── angular-locale_ms.js │ │ │ ├── angular-locale_mt-mt.js │ │ │ ├── angular-locale_mt.js │ │ │ ├── angular-locale_nl-cw.js │ │ │ ├── angular-locale_nl-nl.js │ │ │ ├── angular-locale_nl-sx.js │ │ │ ├── angular-locale_nl.js │ │ │ ├── angular-locale_no.js │ │ │ ├── angular-locale_or-in.js │ │ │ ├── angular-locale_or.js │ │ │ ├── angular-locale_pl-pl.js │ │ │ ├── angular-locale_pl.js │ │ │ ├── angular-locale_pt-br.js │ │ │ ├── angular-locale_pt-pt.js │ │ │ ├── angular-locale_pt.js │ │ │ ├── angular-locale_ro-ro.js │ │ │ ├── angular-locale_ro.js │ │ │ ├── angular-locale_ru-ru.js │ │ │ ├── angular-locale_ru.js │ │ │ ├── angular-locale_sk-sk.js │ │ │ ├── angular-locale_sk.js │ │ │ ├── angular-locale_sl-si.js │ │ │ ├── angular-locale_sl.js │ │ │ ├── angular-locale_sq-al.js │ │ │ ├── angular-locale_sq.js │ │ │ ├── angular-locale_sr-cyrl-rs.js │ │ │ ├── angular-locale_sr-latn-rs.js │ │ │ ├── angular-locale_sr.js │ │ │ ├── angular-locale_sv-se.js │ │ │ ├── angular-locale_sv.js │ │ │ ├── angular-locale_sw-tz.js │ │ │ ├── angular-locale_sw.js │ │ │ ├── angular-locale_ta-in.js │ │ │ ├── angular-locale_ta.js │ │ │ ├── angular-locale_te-in.js │ │ │ ├── angular-locale_te.js │ │ │ ├── angular-locale_th-th.js │ │ │ ├── angular-locale_th.js │ │ │ ├── angular-locale_tl.js │ │ │ ├── angular-locale_tr-tr.js │ │ │ ├── angular-locale_tr.js │ │ │ ├── angular-locale_uk-ua.js │ │ │ ├── angular-locale_uk.js │ │ │ ├── angular-locale_ur-pk.js │ │ │ ├── angular-locale_ur.js │ │ │ ├── angular-locale_vi-vn.js │ │ │ ├── angular-locale_vi.js │ │ │ ├── angular-locale_zh-cn.js │ │ │ ├── angular-locale_zh-hans-cn.js │ │ │ ├── angular-locale_zh-hk.js │ │ │ ├── angular-locale_zh-tw.js │ │ │ ├── angular-locale_zh.js │ │ │ ├── angular-locale_zu-za.js │ │ │ └── angular-locale_zu.js │ │ │ ├── version.json │ │ │ └── version.txt │ └── services.js │ └── partials │ ├── home.html │ ├── login.html │ ├── register.html │ └── todo-list.html ├── pom.xml └── site ├── mase.png └── mase.pptx /.gitignore: -------------------------------------------------------------------------------- 1 | # Eclipse 2 | .classpath 3 | .project 4 | .settings/ 5 | 6 | # Mac 7 | .DS_Store 8 | 9 | # Maven 10 | target/ 11 | 12 | # Vagrant 13 | .vagrant/ 14 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Mahmoud Ben Hassine, Titouan Compiègne 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | :exclamation: **Note: This project is not maintained anymore.** 2 | 3 | # About MASE 4 | 5 | MASE stands for Mongodb-Angularjs-Spring-Elasticsearch and is a simple yet complete online todo list manager using the following technologies: 6 | 7 | ![mase](https://github.com/Java-Geeks/mase/raw/master/site/mase.png) 8 | 9 | ## Client side 10 | 11 | * [AngularJS](http://angularjs.org/) 12 | * [Twitter bootstrap](http://getbootstrap.com/) and [Font Awesome](http://fortawesome.github.io/Font-Awesome/) 13 | * [HTML5](http://www.w3.org/TR/html5/) and [CSS3](http://www.w3schools.com/css/css3_intro.asp) 14 | 15 | ## Server side 16 | 17 | * [MongoDB](https://www.mongodb.org/) 18 | * [Spring Data MongoDB](http://projects.spring.io/spring-data-mongodb/) 19 | * [Spring MVC](http://docs.spring.io/spring/docs/current/spring-framework-reference/html/mvc.html) 20 | * [ElasticSearch](http://www.elasticsearch.org/) 21 | 22 | Backend services are exposed through RESTful APIs. 23 | 24 | # Run the application 25 | 26 | To keep running the application as simple as possible, we provide a pre-built [Virtual Box](https://www.virtualbox.org/) VM managed by [Vagrant](http://www.vagrantup.com/). 27 | 28 | To run the application, please ensure that you have Virtual Box and Vagrant correctly installed and running. 29 | 30 | Then, you can follow these instructions : 31 | 32 | 1. `git clone https://github.com/Java-Geeks/mase.git` 33 | 2. `cd mase` 34 | 3. `mvn install` 35 | 4. `vagrant up` 36 | 5. browse the following URL: `http://localhost:9100/mase-web` 37 | 38 | ### Optional : packaging the VM 39 | 40 | To package the VM for further reuse without re-installing all dependencies, you can proceed as follows: 41 | 42 | 1. Package the VM into a vagrant box: `vagrant package --output precise32-mase.box` 43 | 2. Add the box to vagrant managed VMs: `vagrant box add precise32-mase precise32-mase.box` 44 | 3. Edit the `Vagrantfile`, set the property `config.vm.box` to `precise32-mase` and comment properties `config.vm.box_url` and `config.vm.provision` 45 | 4. Remove or save the box file `precise32-mase.box` to a backup directory 46 | 5. Run `vagrant up` 47 | 48 | Your VM will now be up and running without re-installing all required packages to run the application. 49 | -------------------------------------------------------------------------------- /Vagrantfile: -------------------------------------------------------------------------------- 1 | # -*- mode: ruby -*- 2 | # vi: set ft=ruby : 3 | 4 | VAGRANTFILE_API_VERSION = "2" 5 | 6 | Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| 7 | 8 | # Every Vagrant virtual environment requires a box to build off of. 9 | config.vm.box = "precise32" 10 | 11 | # The url from where the 'config.vm.box' box will be fetched if it 12 | # doesn't already exist on the user's system. 13 | config.vm.box_url = "http://files.vagrantup.com/precise32.box" 14 | 15 | # Provision VM with mongodb, java, tomcat and elasticsearch 16 | config.vm.provision :shell, :path => "bootstrap.sh" 17 | 18 | # MongoDB port 19 | config.vm.network :forwarded_port, guest: 27017, host: 27017 20 | 21 | # Tomcat port 22 | config.vm.network :forwarded_port, guest: 8080, host: 9100 23 | 24 | # ElasticSearch port 25 | config.vm.network :forwarded_port, guest: 9200, host: 9200 26 | 27 | end 28 | -------------------------------------------------------------------------------- /bootstrap.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | sudo apt-get update 4 | 5 | #install mangodb 6 | echo '### Installing MongoDB ###' 7 | sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10 8 | echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list 9 | sudo apt-get update 10 | sudo apt-get install mongodb-10gen 11 | 12 | #install Java 7 13 | echo '### Installing Java7 ###' 14 | sudo apt-get install -y openjdk-7-jre-headless 15 | 16 | #install tomcat 7 17 | echo '### Installing Tomcat7 ###' 18 | sudo apt-get install -y tomcat7 19 | 20 | #install elasticsearch 21 | echo '### Installing ElasticSearch ###' 22 | wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.0.1.deb 23 | sudo dpkg -i elasticsearch-1.0.1.deb 24 | sudo service elasticsearch start 25 | 26 | #install Curl 27 | echo '### Installing Curl ###' 28 | sudo apt-get install -y curl 29 | 30 | #install Git 31 | echo '### Installing Git ###' 32 | sudo apt-get install -y git 33 | 34 | #create a symbolic link for the front-end to be served by apache tomcat 35 | if [ ! -d "/vagrant/mase-web/target/mase-web" ]; then 36 | mkdir -p /vagrant/mase-web/target/mase-web 37 | fi 38 | sudo ln -fs /vagrant/mase-web/target/mase-web /var/lib/tomcat7/webapps/mase-web 39 | -------------------------------------------------------------------------------- /mase-core/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | -------------------------------------------------------------------------------- /mase-core/src/main/java/io/github/javageeks/mase/model/Todo.java: -------------------------------------------------------------------------------- 1 | package io.github.javageeks.mase.model; 2 | 3 | import org.springframework.data.annotation.Id; 4 | import org.springframework.data.mongodb.core.mapping.Document; 5 | 6 | /** 7 | * Todo domain object. 8 | */ 9 | @Document(collection = "todos") 10 | public class Todo { 11 | 12 | @Id 13 | private String id; 14 | 15 | private String userId; 16 | 17 | private String title; 18 | 19 | private String description; 20 | 21 | private boolean status; 22 | 23 | public String getId() { 24 | return id; 25 | } 26 | 27 | public void setId(String id) { 28 | this.id = id; 29 | } 30 | 31 | public String getUserId() { 32 | return userId; 33 | } 34 | 35 | public void setUserId(String userId) { 36 | this.userId = userId; 37 | } 38 | 39 | public String getTitle() { 40 | return title; 41 | } 42 | 43 | public void setTitle(String title) { 44 | this.title = title; 45 | } 46 | 47 | public String getDescription() { 48 | return description; 49 | } 50 | 51 | public void setDescription(String description) { 52 | this.description = description; 53 | } 54 | 55 | public boolean getStatus() { 56 | return status; 57 | } 58 | 59 | public void setStatus(boolean status) { 60 | this.status = status; 61 | } 62 | 63 | @Override 64 | public String toString() { 65 | final StringBuilder sb = new StringBuilder("Todo{"); 66 | sb.append("id=").append(id); 67 | sb.append(", userId=").append(userId); 68 | sb.append(", title='").append(title).append('\''); 69 | sb.append(", description='").append(description).append('\''); 70 | sb.append(", status=").append(status); 71 | sb.append('}'); 72 | return sb.toString(); 73 | } 74 | 75 | } 76 | -------------------------------------------------------------------------------- /mase-core/src/main/java/io/github/javageeks/mase/model/User.java: -------------------------------------------------------------------------------- 1 | package io.github.javageeks.mase.model; 2 | 3 | import org.springframework.data.annotation.Id; 4 | import org.springframework.data.mongodb.core.mapping.Document; 5 | 6 | import java.io.Serializable; 7 | 8 | @Document(collection = "users") 9 | public class User implements Serializable { 10 | 11 | @Id 12 | private String id; 13 | 14 | private String firstName; 15 | 16 | private String lastName; 17 | 18 | private String email; 19 | 20 | private String password; 21 | 22 | public String getId() { 23 | return id; 24 | } 25 | 26 | public void setId(String id) { 27 | this.id = id; 28 | } 29 | 30 | public String getFirstName() { 31 | return firstName; 32 | } 33 | 34 | public void setFirstName(String firstName) { 35 | this.firstName = firstName; 36 | } 37 | 38 | public String getLastName() { 39 | return lastName; 40 | } 41 | 42 | public void setLastName(String lastName) { 43 | this.lastName = lastName; 44 | } 45 | 46 | public String getEmail() { 47 | return email; 48 | } 49 | 50 | public void setEmail(String email) { 51 | this.email = email; 52 | } 53 | 54 | public String getPassword() { 55 | return password; 56 | } 57 | 58 | public void setPassword(String password) { 59 | this.password = password; 60 | } 61 | 62 | @Override 63 | public String toString() { 64 | return "User[" + 65 | "id=" + id + 66 | ", firstName='" + firstName + '\'' + 67 | ", lastName='" + lastName + '\'' + 68 | ", email='" + email + '\'' + 69 | ", password='" + password + '\'' + 70 | ']'; 71 | } 72 | 73 | } -------------------------------------------------------------------------------- /mase-core/src/main/java/io/github/javageeks/mase/repository/TodoRepository.java: -------------------------------------------------------------------------------- 1 | package io.github.javageeks.mase.repository; 2 | 3 | import io.github.javageeks.mase.model.Todo; 4 | import org.springframework.data.mongodb.repository.MongoRepository; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * Interface for todo repository. 10 | */ 11 | public interface TodoRepository extends MongoRepository { 12 | 13 | /** 14 | * Find todo list by user id. 15 | * @param userId the user id 16 | * @return the todo list for the given user 17 | */ 18 | List findByUserId(String userId); 19 | 20 | /** 21 | * Find todo list by title. 22 | * @param userId the userId 23 | * @param title the todo title 24 | * @return the todo list with the given todo title 25 | */ 26 | List findByUserIdAndTitleLike(String userId, String title); 27 | 28 | /** 29 | * Find todo list by description. 30 | * @param userId the user id 31 | * @param description the todo description 32 | * @return the todo list with the given todo description 33 | */ 34 | List findByUserIdAndDescriptionLike(String userId, String description); 35 | 36 | /** 37 | * Find todo list by todo status. 38 | * @param userId the user id 39 | * @param status the todo status 40 | * @return the todo list with the given todo status 41 | */ 42 | List findByUserIdAndStatusIsTrue(String userId, boolean status); 43 | 44 | } 45 | -------------------------------------------------------------------------------- /mase-core/src/main/java/io/github/javageeks/mase/repository/UserRepository.java: -------------------------------------------------------------------------------- 1 | package io.github.javageeks.mase.repository; 2 | 3 | import io.github.javageeks.mase.model.User; 4 | import org.springframework.data.mongodb.repository.MongoRepository; 5 | 6 | /** 7 | * Interface for todo repository. 8 | */ 9 | public interface UserRepository extends MongoRepository { 10 | 11 | /** 12 | * Find user by id. 13 | * @param id the user id 14 | * @return the user with the given id or null if no user found 15 | */ 16 | User findById(String id); 17 | 18 | /** 19 | * Find user by email. 20 | * @param email the user email 21 | * @return the user with the given email or null if no user found 22 | */ 23 | User findByEmail(String email); 24 | 25 | /** 26 | * Find user by email and password. 27 | * @param email the user email 28 | * @param password the user password 29 | * @return the user with the given email/password or null if no user found 30 | */ 31 | User findByEmailAndPassword(String email, String password); 32 | 33 | } 34 | -------------------------------------------------------------------------------- /mase-core/src/main/java/io/github/javageeks/mase/service/TodoService.java: -------------------------------------------------------------------------------- 1 | package io.github.javageeks.mase.service; 2 | 3 | import io.github.javageeks.mase.model.Todo; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * Todo business service interface. 9 | */ 10 | public interface TodoService { 11 | 12 | /** 13 | * save or update a todo. 14 | * @param todo the todo to save or update 15 | * @return the created or updated todo 16 | */ 17 | Todo saveOrUpdate(Todo todo); 18 | 19 | /** 20 | * Delete a todo. 21 | * @param todo the todo to delete 22 | */ 23 | void delete(Todo todo); 24 | 25 | /** 26 | * Find a todo by its Id. 27 | * @param id the todo id 28 | * @return the todo with the given id or null if no todo found with the given id 29 | */ 30 | Todo findById(String id); 31 | 32 | /** 33 | * Return all todos for a given user. 34 | * @return all todos for the given user 35 | */ 36 | List findAll(String userId); 37 | 38 | } 39 | -------------------------------------------------------------------------------- /mase-core/src/main/java/io/github/javageeks/mase/service/UserService.java: -------------------------------------------------------------------------------- 1 | package io.github.javageeks.mase.service; 2 | 3 | import io.github.javageeks.mase.model.User; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * User business service interface. 9 | */ 10 | public interface UserService { 11 | 12 | /** 13 | * save or update a user. 14 | * @param user the user to save or update 15 | * @return the created or updated user 16 | */ 17 | User saveOrUpdate(User user); 18 | 19 | /** 20 | * Delete a user. 21 | * @param user the user to delete 22 | */ 23 | void delete(User user); 24 | 25 | /** 26 | * Find a user by its Id. 27 | * @param id the user id 28 | * @return the user with the given id or null if no user found with the given id 29 | */ 30 | User findById(String id); 31 | 32 | /** 33 | * Find a user by email and password. 34 | * @param email the user email 35 | * @return the user with the given email or null if no user found 36 | */ 37 | User findByEmail(String email); 38 | 39 | /** 40 | * Find a user by email and password. 41 | * @param email the user email 42 | * @param password the user password 43 | * @return the user with the given email and password or null if no user found 44 | */ 45 | User findByEmailAndPassword(String email, String password); 46 | 47 | /** 48 | * Find all users 49 | * 50 | * @return all users 51 | */ 52 | List findAll(); 53 | 54 | } 55 | -------------------------------------------------------------------------------- /mase-core/src/main/java/io/github/javageeks/mase/service/impl/TodoServiceImpl.java: -------------------------------------------------------------------------------- 1 | package io.github.javageeks.mase.service.impl; 2 | 3 | import io.github.javageeks.mase.model.Todo; 4 | import io.github.javageeks.mase.repository.TodoRepository; 5 | import io.github.javageeks.mase.service.TodoService; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Service; 8 | 9 | import java.util.List; 10 | 11 | /** 12 | * Todo business service implementation. 13 | */ 14 | @Service 15 | public class TodoServiceImpl implements TodoService { 16 | 17 | @Autowired 18 | private TodoRepository todoRepository; 19 | 20 | @Override 21 | public Todo saveOrUpdate(Todo todo) { 22 | return todoRepository.save(todo); 23 | } 24 | 25 | @Override 26 | public void delete(Todo todo) { 27 | todoRepository.delete(todo); 28 | } 29 | 30 | @Override 31 | public Todo findById(String id) { 32 | return todoRepository.findOne(id); 33 | } 34 | 35 | @Override 36 | public List findAll(String userId) { 37 | return todoRepository.findByUserId(userId); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /mase-core/src/main/java/io/github/javageeks/mase/service/impl/UserServiceImpl.java: -------------------------------------------------------------------------------- 1 | package io.github.javageeks.mase.service.impl; 2 | 3 | import java.util.List; 4 | 5 | import io.github.javageeks.mase.model.User; 6 | import io.github.javageeks.mase.repository.UserRepository; 7 | import io.github.javageeks.mase.service.UserService; 8 | 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | 11 | /** 12 | * User business service implementation. 13 | */ 14 | public class UserServiceImpl implements UserService { 15 | 16 | @Autowired 17 | UserRepository userRepository; 18 | 19 | @Override 20 | public User saveOrUpdate(User user) { 21 | return userRepository.save(user); 22 | } 23 | 24 | @Override 25 | public void delete(User user) { 26 | userRepository.delete(user); 27 | } 28 | 29 | @Override 30 | public User findById(String id) { 31 | return userRepository.findById(id); 32 | } 33 | 34 | @Override 35 | public User findByEmail(String email) { 36 | return userRepository.findByEmail(email); 37 | } 38 | 39 | @Override 40 | public User findByEmailAndPassword(String email, String password) { 41 | return userRepository.findByEmailAndPassword(email, password); 42 | } 43 | 44 | @Override 45 | public List findAll() { 46 | return userRepository.findAll(); 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /mase-core/src/main/resources/spring/mase-core-context.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /mase-core/src/test/java/io/github/javageeks/mase/service/test/TodoRepositoryTest.java: -------------------------------------------------------------------------------- 1 | package io.github.javageeks.mase.service.test; 2 | 3 | import io.github.javageeks.mase.model.Todo; 4 | import io.github.javageeks.mase.repository.TodoRepository; 5 | import org.junit.Ignore; 6 | import org.junit.Test; 7 | import org.junit.runner.RunWith; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.test.context.ContextConfiguration; 10 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 11 | 12 | import static org.junit.Assert.assertEquals; 13 | 14 | import java.util.List; 15 | 16 | @RunWith(SpringJUnit4ClassRunner.class) 17 | @ContextConfiguration(locations = {"classpath:spring/mase-core-context.xml"}) 18 | public class TodoRepositoryTest { 19 | 20 | @Autowired 21 | private TodoRepository todoRepository; 22 | 23 | 24 | @Ignore 25 | @Test 26 | public void testTodoRepository() { 27 | 28 | todoRepository.deleteAll(); 29 | 30 | Todo todo = new Todo(); 31 | todo.setUserId("1"); 32 | todo.setTitle("Todo1"); 33 | todo.setDescription("Todo1 for user1"); 34 | todo.setStatus(false); 35 | todoRepository.save(todo); 36 | 37 | List todos = todoRepository.findAll(); 38 | assertEquals(1, todos.size()); 39 | } 40 | 41 | } -------------------------------------------------------------------------------- /mase-core/src/test/java/io/github/javageeks/mase/service/test/TodoServiceTest.java: -------------------------------------------------------------------------------- 1 | package io.github.javageeks.mase.service.test; 2 | 3 | import io.github.javageeks.mase.model.Todo; 4 | import io.github.javageeks.mase.service.TodoService; 5 | import org.junit.Ignore; 6 | import org.junit.Test; 7 | import org.junit.runner.RunWith; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.test.context.ContextConfiguration; 10 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 11 | 12 | import java.util.List; 13 | 14 | import static org.junit.Assert.assertEquals; 15 | 16 | @RunWith(SpringJUnit4ClassRunner.class) 17 | @ContextConfiguration(locations = {"classpath:spring/mase-core-context.xml"}) 18 | public class TodoServiceTest { 19 | 20 | @Autowired 21 | private TodoService todoService; 22 | 23 | @Ignore 24 | @Test 25 | public void testTodoService() { 26 | 27 | //create a todo for test 28 | Todo todo = new Todo(); 29 | todo.setUserId("1"); 30 | todo.setTitle("Test Todo"); 31 | todo.setDescription("Todo used for test"); 32 | todo.setStatus(false); 33 | todoService.saveOrUpdate(todo); 34 | 35 | // test findById 36 | Todo t = todoService.findById("1"); 37 | assertEquals("1", t.getId()); 38 | assertEquals("1", t.getUserId()); 39 | assertEquals("Test Todo", t.getTitle()); 40 | assertEquals("Todo used for test", t.getDescription()); 41 | assertEquals(false, t.getStatus()); 42 | 43 | //test find all 44 | List todos = todoService.findAll("1"); 45 | assertEquals(1, todos.size()); 46 | 47 | } 48 | 49 | } -------------------------------------------------------------------------------- /mase-core/src/test/java/io/github/javageeks/mase/service/test/UserServiceTest.java: -------------------------------------------------------------------------------- 1 | package io.github.javageeks.mase.service.test; 2 | 3 | import io.github.javageeks.mase.model.User; 4 | import io.github.javageeks.mase.service.UserService; 5 | import org.junit.Ignore; 6 | import org.junit.Test; 7 | import org.junit.runner.RunWith; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.test.context.ContextConfiguration; 10 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 11 | 12 | import static org.junit.Assert.assertEquals; 13 | import static org.junit.Assert.assertNotNull; 14 | 15 | @RunWith(SpringJUnit4ClassRunner.class) 16 | @ContextConfiguration(locations = {"classpath:spring/mase-core-context.xml"}) 17 | public class UserServiceTest { 18 | 19 | @Autowired 20 | private UserService userService; 21 | 22 | @Ignore 23 | @Test 24 | public void testTodoService() { 25 | 26 | //create a user for test 27 | User user = new User(); 28 | user.setFirstName("Foo"); 29 | user.setLastName("Bar"); 30 | user.setEmail("foo@bar.org"); 31 | user.setPassword("foobar"); 32 | user = userService.saveOrUpdate(user); 33 | 34 | assertNotNull(user); 35 | assertEquals("Foo", user.getFirstName()); 36 | assertEquals("Bar", user.getLastName()); 37 | assertEquals("foo@bar.org", user.getEmail()); 38 | assertEquals("foobar", user.getPassword()); 39 | 40 | } 41 | 42 | } -------------------------------------------------------------------------------- /mase-web/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | -------------------------------------------------------------------------------- /mase-web/src/main/java/io/github/javageeks/mase/web/TodoController.java: -------------------------------------------------------------------------------- 1 | package io.github.javageeks.mase.web; 2 | 3 | import io.github.javageeks.mase.model.Todo; 4 | import io.github.javageeks.mase.service.TodoService; 5 | 6 | import java.util.List; 7 | 8 | import io.github.javageeks.mase.web.util.SessionData; 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.stereotype.Controller; 11 | import org.springframework.web.bind.annotation.*; 12 | 13 | /** 14 | * Todo rest web service. 15 | */ 16 | @Controller 17 | public class TodoController { 18 | 19 | @Autowired 20 | private TodoService todoService; 21 | 22 | @Autowired 23 | private SessionData sessionData; 24 | 25 | @RequestMapping(value = "/todos", method = RequestMethod.GET) 26 | public @ResponseBody 27 | List getAllTodo() { 28 | return todoService.findAll(sessionData.getUser().getId()); 29 | } 30 | 31 | @RequestMapping(value = "/todos/{todoId}", method = RequestMethod.GET) 32 | public @ResponseBody 33 | Todo getTodo(@PathVariable String todoId) { 34 | return todoService.findById(todoId); 35 | } 36 | 37 | @RequestMapping(value = "/todos", method = RequestMethod.POST) 38 | public @ResponseBody 39 | Todo createTodo(@RequestBody Todo todo) { 40 | return todoService.saveOrUpdate(todo); 41 | } 42 | 43 | @RequestMapping(value = "/todos/{todoId}", method = RequestMethod.PUT) 44 | public @ResponseBody 45 | Todo editTodo(@RequestBody Todo todo) { 46 | return todoService.saveOrUpdate(todo); 47 | } 48 | 49 | @RequestMapping(value = "/todos/{todoId}", method = RequestMethod.DELETE) 50 | public @ResponseBody 51 | void deleteTodo(@PathVariable String todoId) { 52 | Todo todo = todoService.findById(todoId); 53 | todoService.delete(todo); 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /mase-web/src/main/java/io/github/javageeks/mase/web/util/CORSFilter.java: -------------------------------------------------------------------------------- 1 | package io.github.javageeks.mase.web.util; 2 | 3 | import java.io.IOException; 4 | 5 | import javax.servlet.Filter; 6 | import javax.servlet.FilterChain; 7 | import javax.servlet.FilterConfig; 8 | import javax.servlet.ServletException; 9 | import javax.servlet.ServletRequest; 10 | import javax.servlet.ServletResponse; 11 | import javax.servlet.http.HttpServletResponse; 12 | 13 | import org.springframework.stereotype.Component; 14 | 15 | @Component 16 | public class CORSFilter implements Filter { 17 | 18 | public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException { 19 | HttpServletResponse response = (HttpServletResponse) res; 20 | response.setHeader("Access-Control-Allow-Origin", "*"); 21 | response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, PUT, DELETE"); 22 | response.setHeader("Access-Control-Max-Age", "3600"); 23 | response.setHeader("Access-Control-Allow-Headers", "x-requested-with,Content-Type"); 24 | chain.doFilter(req, res); 25 | } 26 | 27 | public void init(FilterConfig filterConfig) {} 28 | 29 | public void destroy() {} 30 | 31 | } -------------------------------------------------------------------------------- /mase-web/src/main/java/io/github/javageeks/mase/web/util/DatabasePopulator.java: -------------------------------------------------------------------------------- 1 | package io.github.javageeks.mase.web.util; 2 | 3 | import io.github.javageeks.mase.model.Todo; 4 | import io.github.javageeks.mase.model.User; 5 | import io.github.javageeks.mase.service.TodoService; 6 | 7 | import javax.annotation.PostConstruct; 8 | 9 | import io.github.javageeks.mase.service.UserService; 10 | import org.springframework.beans.factory.annotation.Autowired; 11 | import org.springframework.context.annotation.Profile; 12 | import org.springframework.stereotype.Component; 13 | 14 | /** 15 | * Utility bean used to populate the database with fake data at application's startup. 16 | */ 17 | @Profile("dev") 18 | @Component 19 | public class DatabasePopulator { 20 | 21 | @Autowired 22 | private TodoService todoService; 23 | 24 | @Autowired 25 | private UserService userService; 26 | 27 | @PostConstruct 28 | public void populateDatabase() { 29 | if (userService.findByEmail("foo@bar.org") == null) { 30 | User user = new User(); 31 | user.setFirstName("Foo"); 32 | user.setLastName("Bar"); 33 | user.setEmail("foo@bar.org"); 34 | user.setPassword("foobar"); 35 | user = userService.saveOrUpdate(user); 36 | 37 | Todo todo = new Todo(); 38 | todo.setUserId(user.getId()); 39 | todo.setTitle("Milk"); 40 | todo.setDescription("Remember the milk!"); 41 | todo.setStatus(false); 42 | todoService.saveOrUpdate(todo); 43 | } 44 | 45 | 46 | 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /mase-web/src/main/java/io/github/javageeks/mase/web/util/SessionData.java: -------------------------------------------------------------------------------- 1 | package io.github.javageeks.mase.web.util; 2 | 3 | import io.github.javageeks.mase.model.User; 4 | 5 | import java.io.Serializable; 6 | 7 | /** 8 | * A bean holding session data. 9 | */ 10 | public class SessionData implements Serializable { 11 | 12 | private static final long serialVersionUID = -1625404151359090932L; 13 | 14 | /** 15 | * The logged user. 16 | */ 17 | private User user; 18 | 19 | public User getUser() { 20 | return user; 21 | } 22 | 23 | public void setUser(User user) { 24 | this.user = user; 25 | } 26 | 27 | } -------------------------------------------------------------------------------- /mase-web/src/main/java/io/github/javageeks/mase/web/util/SessionHandlerInterceptor.java: -------------------------------------------------------------------------------- 1 | package io.github.javageeks.mase.web.util; 2 | 3 | import javax.servlet.http.HttpServletRequest; 4 | import javax.servlet.http.HttpServletResponse; 5 | 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.http.HttpMethod; 8 | import org.springframework.web.servlet.handler.HandlerInterceptorAdapter; 9 | 10 | public class SessionHandlerInterceptor extends HandlerInterceptorAdapter { 11 | 12 | @Autowired 13 | private SessionData sessionData; 14 | 15 | @Override 16 | public boolean preHandle(final HttpServletRequest request, final HttpServletResponse response, final Object handler) throws Exception { 17 | // Register functionality is authorized for anonymous user 18 | if (request.getMethod().equals(HttpMethod.POST.toString()) && request.getRequestURI().indexOf("/account") > 0) { 19 | return true; 20 | } 21 | 22 | if (sessionData.getUser() == null) { 23 | response.sendError(HttpServletResponse.SC_UNAUTHORIZED, "Unauthorized"); 24 | return false; 25 | } else { 26 | return true; 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /mase-web/src/main/webapp/WEB-INF/spring/mase-web-context.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /mase-web/src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 30 7 | 8 | 9 | 10 | 11 | contextConfigLocation 12 | classpath:spring/mase-core-context.xml 13 | 14 | 15 | spring.profiles.default 16 | dev 17 | 18 | 19 | org.springframework.web.context.ContextLoaderListener 20 | 21 | 22 | 23 | org.springframework.web.context.request.RequestContextListener 24 | 25 | 26 | 27 | 28 | 29 | mase 30 | org.springframework.web.servlet.DispatcherServlet 31 | 32 | contextConfigLocation 33 | /WEB-INF/spring/mase-web-context.xml 34 | 35 | 2 36 | 37 | 38 | mase 39 | / 40 | 41 | 42 | 43 | cors 44 | io.github.javageeks.mase.web.util.CORSFilter 45 | 46 | 47 | cors 48 | /* 49 | 50 | 51 | -------------------------------------------------------------------------------- /mase-web/src/main/webapp/css/app.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Java-Geeks/mase/19b97c1fdb58b89943955358a6e7ccfd349e03d0/mase-web/src/main/webapp/css/app.css -------------------------------------------------------------------------------- /mase-web/src/main/webapp/css/jumbotron-narrow.css: -------------------------------------------------------------------------------- 1 | /* Space out content a bit */ 2 | body { 3 | padding-top: 20px; 4 | padding-bottom: 20px; 5 | } 6 | 7 | /* Everything but the jumbotron gets side spacing for mobile first views */ 8 | .header, 9 | .marketing, 10 | .footer { 11 | padding-right: 15px; 12 | padding-left: 15px; 13 | } 14 | 15 | /* Custom page header */ 16 | .header { 17 | border-bottom: 1px solid #e5e5e5; 18 | } 19 | /* Make the masthead heading the same height as the navigation */ 20 | .header h3 { 21 | padding-bottom: 19px; 22 | margin-top: 0; 23 | margin-bottom: 0; 24 | line-height: 40px; 25 | } 26 | 27 | /* Custom page footer */ 28 | .footer { 29 | padding-top: 19px; 30 | color: #777; 31 | border-top: 1px solid #e5e5e5; 32 | } 33 | 34 | /* Customize container */ 35 | @media (min-width: 768px) { 36 | .container { 37 | max-width: 730px; 38 | } 39 | } 40 | .container-narrow > hr { 41 | margin: 30px 0; 42 | } 43 | 44 | /* Main marketing message and sign up button */ 45 | .jumbotron { 46 | text-align: center; 47 | border-bottom: 1px solid #e5e5e5; 48 | } 49 | .jumbotron .btn { 50 | padding: 14px 24px; 51 | font-size: 21px; 52 | } 53 | 54 | /* Supporting marketing content */ 55 | .marketing { 56 | margin: 40px 0; 57 | } 58 | .marketing p + h4 { 59 | margin-top: 28px; 60 | } 61 | 62 | /* Responsive: Portrait tablets and up */ 63 | @media screen and (min-width: 768px) { 64 | /* Remove the padding we set earlier */ 65 | .header, 66 | .marketing, 67 | .footer { 68 | padding-right: 0; 69 | padding-left: 0; 70 | } 71 | /* Space out the masthead */ 72 | .header { 73 | margin-bottom: 30px; 74 | } 75 | /* Remove the bottom border on the jumbotron for visual effect */ 76 | .jumbotron { 77 | border-bottom: 0; 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /mase-web/src/main/webapp/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Java-Geeks/mase/19b97c1fdb58b89943955358a6e7ccfd349e03d0/mase-web/src/main/webapp/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /mase-web/src/main/webapp/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Java-Geeks/mase/19b97c1fdb58b89943955358a6e7ccfd349e03d0/mase-web/src/main/webapp/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /mase-web/src/main/webapp/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Java-Geeks/mase/19b97c1fdb58b89943955358a6e7ccfd349e03d0/mase-web/src/main/webapp/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /mase-web/src/main/webapp/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Java-Geeks/mase/19b97c1fdb58b89943955358a6e7ccfd349e03d0/mase-web/src/main/webapp/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /mase-web/src/main/webapp/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Java-Geeks/mase/19b97c1fdb58b89943955358a6e7ccfd349e03d0/mase-web/src/main/webapp/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /mase-web/src/main/webapp/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Java-Geeks/mase/19b97c1fdb58b89943955358a6e7ccfd349e03d0/mase-web/src/main/webapp/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /mase-web/src/main/webapp/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Java-Geeks/mase/19b97c1fdb58b89943955358a6e7ccfd349e03d0/mase-web/src/main/webapp/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /mase-web/src/main/webapp/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Mase App 6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 |
14 | 21 |

Mase

22 |
23 |
24 | 25 | 28 |
29 | 30 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /mase-web/src/main/webapp/js/app.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | 4 | // Declare app level module which depends on filters, and services 5 | var maseApp = angular.module('maseApp', [ 6 | 'ngRoute', 7 | 'maseAppControllers', 8 | 'maseAppFilters', 9 | 'maseAppServices', 10 | 'maseAppDirectives' 11 | ]); 12 | 13 | maseApp.config(['$routeProvider', '$httpProvider', function($routeProvider, $httpProvider) { 14 | $httpProvider.responseInterceptors.push('httpInterceptor'); 15 | 16 | $routeProvider.when('/', {templateUrl: 'partials/home.html', controller: 'HomeCtrl'}); 17 | $routeProvider.when('/register', {templateUrl: 'partials/register.html', controller: 'RegisterCtrl'}); 18 | $routeProvider.when('/login', {templateUrl: 'partials/login.html', controller: 'LoginCtrl'}); 19 | $routeProvider.when('/todos', {templateUrl: 'partials/todo-list.html', controller: 'TodoListCtrl'}); 20 | $routeProvider.otherwise({redirectTo: '/'}); 21 | }]); 22 | -------------------------------------------------------------------------------- /mase-web/src/main/webapp/js/directives.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /* Directives */ 4 | 5 | 6 | angular.module('maseAppDirectives', []). 7 | directive('appVersion', ['version', function(version) { 8 | return function(scope, elm, attrs) { 9 | elm.text(version); 10 | }; 11 | }]); 12 | -------------------------------------------------------------------------------- /mase-web/src/main/webapp/js/filters.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /* Filters */ 4 | 5 | angular.module('maseAppFilters', []). 6 | filter('interpolate', ['version', function(version) { 7 | return function(text) { 8 | return String(text).replace(/\%VERSION\%/mg, version); 9 | } 10 | }]); 11 | -------------------------------------------------------------------------------- /mase-web/src/main/webapp/js/lib/angular/angular-cookies.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | AngularJS v1.3.0-beta.2 3 | (c) 2010-2014 Google, Inc. http://angularjs.org 4 | License: MIT 5 | */ 6 | (function(p,f,n){'use strict';f.module("ngCookies",["ng"]).factory("$cookies",["$rootScope","$browser",function(d,b){var c={},g={},h,k=!1,l=f.copy,m=f.isUndefined;b.addPollFn(function(){var a=b.cookies();h!=a&&(h=a,l(a,g),l(a,c),k&&d.$apply())})();k=!0;d.$watch(function(){var a,e,d;for(a in g)m(c[a])&&b.cookies(a,n);for(a in c)(e=c[a],f.isString(e))?e!==g[a]&&(b.cookies(a,e),d=!0):f.isDefined(g[a])?c[a]=g[a]:delete c[a];if(d)for(a in e=b.cookies(),c)c[a]!==e[a]&&(m(e[a])?delete c[a]:c[a]=e[a])}); 7 | return c}]).factory("$cookieStore",["$cookies",function(d){return{get:function(b){return(b=d[b])?f.fromJson(b):b},put:function(b,c){d[b]=f.toJson(c)},remove:function(b){delete d[b]}}}])})(window,window.angular); 8 | //# sourceMappingURL=angular-cookies.min.js.map 9 | -------------------------------------------------------------------------------- /mase-web/src/main/webapp/js/lib/angular/angular-cookies.min.js.map: -------------------------------------------------------------------------------- 1 | { 2 | "version":3, 3 | "file":"angular-cookies.min.js", 4 | "lineCount":7, 5 | "mappings":"A;;;;;aAKC,SAAQ,CAACA,CAAD,CAASC,CAAT,CAAkBC,CAAlB,CAA6B,CAmBtCD,CAAAE,OAAA,CAAe,WAAf,CAA4B,CAAC,IAAD,CAA5B,CAAAC,QAAA,CA2BW,UA3BX,CA2BuB,CAAC,YAAD,CAAe,UAAf,CAA2B,QAAS,CAACC,CAAD,CAAaC,CAAb,CAAuB,CAAA,IACxEC,EAAU,EAD8D,CAExEC,EAAc,EAF0D,CAGxEC,CAHwE,CAIxEC,EAAU,CAAA,CAJ8D,CAKxEC,EAAOV,CAAAU,KALiE,CAMxEC,EAAcX,CAAAW,YAGlBN,EAAAO,UAAA,CAAmB,QAAQ,EAAG,CAC5B,IAAIC,EAAiBR,CAAAC,QAAA,EACjBE,EAAJ,EAA0BK,CAA1B,GACEL,CAGA,CAHqBK,CAGrB,CAFAH,CAAA,CAAKG,CAAL,CAAqBN,CAArB,CAEA,CADAG,CAAA,CAAKG,CAAL,CAAqBP,CAArB,CACA,CAAIG,CAAJ,EAAaL,CAAAU,OAAA,EAJf,CAF4B,CAA9B,CAAA,EAUAL,EAAA,CAAU,CAAA,CAKVL,EAAAW,OAAA,CASAC,QAAa,EAAG,CAAA,IACVC,CADU,CAEVC,CAFU,CAIVC,CAGJ,KAAKF,CAAL,GAAaV,EAAb,CACMI,CAAA,CAAYL,CAAA,CAAQW,CAAR,CAAZ,CAAJ,EACEZ,CAAAC,QAAA,CAAiBW,CAAjB,CAAuBhB,CAAvB,CAKJ,KAAIgB,CAAJ,GAAYX,EAAZ,CAEE,CADAY,CACK,CADGZ,CAAA,CAAQW,CAAR,CACH,CAAAjB,CAAAoB,SAAA,CAAiBF,CAAjB,CAAL,EAMWA,CANX,GAMqBX,CAAA,CAAYU,CAAZ,CANrB,GAOEZ,CAAAC,QAAA,CAAiBW,CAAjB,CAAuBC,CAAvB,CACA,CAAAC,CAAA,CAAU,CAAA,CARZ,EACMnB,CAAAqB,UAAA,CAAkBd,CAAA,CAAYU,CAAZ,CAAlB,CAAJ,CACEX,CAAA,CAAQW,CAAR,CADF,CACkBV,CAAA,CAAYU,CAAZ,CADlB,CAGE,OAAOX,CAAA,CAAQW,CAAR,CASb,IAAIE,CAAJ,CAIE,IAAKF,CAAL,GAFAK,EAEahB,CAFID,CAAAC,QAAA,EAEJA,CAAAA,CAAb,CACMA,CAAA,CAAQW,CAAR,CAAJ,GAAsBK,CAAA,CAAeL,CAAf,CAAtB,GAEMN,CAAA,CAAYW,CAAA,CAAeL,CAAf,CAAZ,CAAJ,CACE,OAAOX,CAAA,CAAQW,CAAR,CADT,CAGEX,CAAA,CAAQW,CAAR,CAHF,CAGkBK,CAAA,CAAeL,CAAf,CALpB,CAlCU,CAThB,CAEA;MAAOX,EA1BqE,CAA3D,CA3BvB,CAAAH,QAAA,CA2HW,cA3HX,CA2H2B,CAAC,UAAD,CAAa,QAAQ,CAACoB,CAAD,CAAW,CAErD,MAAO,KAWAC,QAAQ,CAACC,CAAD,CAAM,CAEjB,MAAO,CADHP,CACG,CADKK,CAAA,CAASE,CAAT,CACL,EAAQzB,CAAA0B,SAAA,CAAiBR,CAAjB,CAAR,CAAkCA,CAFxB,CAXd,KA0BAS,QAAQ,CAACF,CAAD,CAAMP,CAAN,CAAa,CACxBK,CAAA,CAASE,CAAT,CAAA,CAAgBzB,CAAA4B,OAAA,CAAeV,CAAf,CADQ,CA1BrB,QAuCGW,QAAQ,CAACJ,CAAD,CAAM,CACpB,OAAOF,CAAA,CAASE,CAAT,CADa,CAvCjB,CAF8C,CAAhC,CA3H3B,CAnBsC,CAArC,CAAA,CA+LE1B,MA/LF,CA+LUA,MAAAC,QA/LV;", 6 | "sources":["angular-cookies.js"], 7 | "names":["window","angular","undefined","module","factory","$rootScope","$browser","cookies","lastCookies","lastBrowserCookies","runEval","copy","isUndefined","addPollFn","currentCookies","$apply","$watch","push","name","value","updated","isString","isDefined","browserCookies","$cookies","get","key","fromJson","put","toJson","remove"] 8 | } 9 | -------------------------------------------------------------------------------- /mase-web/src/main/webapp/js/lib/angular/angular-csp.css: -------------------------------------------------------------------------------- 1 | /* Include this file in your html if you are using the CSP mode. */ 2 | 3 | @charset "UTF-8"; 4 | 5 | [ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], 6 | .ng-cloak, .x-ng-cloak, 7 | .ng-hide { 8 | display: none !important; 9 | } 10 | 11 | ng\:form { 12 | display: block; 13 | } 14 | 15 | .ng-animate-block-transitions { 16 | transition:0s all!important; 17 | -webkit-transition:0s all!important; 18 | } 19 | -------------------------------------------------------------------------------- /mase-web/src/main/webapp/js/lib/angular/angular-loader.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | AngularJS v1.3.0-beta.2 3 | (c) 2010-2014 Google, Inc. http://angularjs.org 4 | License: MIT 5 | */ 6 | (function(){'use strict';function d(a){return function(){var c=arguments[0],b,c="["+(a?a+":":"")+c+"] http://errors.angularjs.org/1.3.0-beta.2/"+(a?a+"/":"")+c;for(b=1;b 2 |

Welcome to MASE !

3 |

MASE is a task manager, based on the latest web technologies which allows you to : 4 |

    5 |
  • Save and organize your todo list
  • 6 |
  • Search easily your todo list
  • 7 |
  • Sort and filter your todo list
  • 8 |
9 |

10 |

11 | Sign up 12 | or 13 | Sign in 14 |

15 |

16 | Go to my todo list 17 |

18 | -------------------------------------------------------------------------------- /mase-web/src/main/webapp/partials/login.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | Authentication failed! Please check your credentials and try again. 4 |
5 |
6 |
7 | 8 |
9 | 11 |
12 |
13 |
14 | 15 |
16 | 18 |
19 |
20 |
21 |
22 | 23 |
24 |
25 |
26 |

You don't have an account yet ? Register here for free! 27 |

-------------------------------------------------------------------------------- /mase-web/src/main/webapp/partials/register.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | Registration succeed ! 4 |
5 |
6 | Registration failed! 7 |
8 |
9 | The password and its confirmation do not match! 10 |
11 |
12 |
13 | 14 |
15 | 17 |
18 |
19 |
20 | 21 |
22 | 24 |
25 |
26 |
27 | 28 |
29 | 31 |
32 |
33 |
34 | 35 |
36 | 38 |
39 |
40 |
41 | 42 |
43 | 45 |
46 |
47 |
48 |
49 | 50 |
51 |
52 |
53 |

You have already an account? Sign in here 54 |

-------------------------------------------------------------------------------- /mase-web/src/main/webapp/partials/todo-list.html: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 27 | 28 | 34 | 36 | 37 |
Done ?TitleDescriptionAction
{{todo.title}} 22 |
23 | 24 | 25 |
26 |
{{todo.description}} 29 |
30 | 31 | 32 |
33 |
delete 35 |
38 |
-------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 4 | 4.0.0 5 | 6 | io.github.javageeks 7 | mase 8 | 1.0-SNAPSHOT 9 | pom 10 | MASE parent module 11 | 12 | 13 | mase-core 14 | mase-web 15 | 16 | 17 | 18 | 19 | 20 | 21 | org.apache.maven.plugins 22 | maven-compiler-plugin 23 | 3.1 24 | 25 | 1.7 26 | 1.7 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /site/mase.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Java-Geeks/mase/19b97c1fdb58b89943955358a6e7ccfd349e03d0/site/mase.png -------------------------------------------------------------------------------- /site/mase.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Java-Geeks/mase/19b97c1fdb58b89943955358a6e7ccfd349e03d0/site/mase.pptx --------------------------------------------------------------------------------