Skip to content
Markus Koskela edited this page Mar 15, 2016 · 7 revisions

DiMe server is developed in Java using the Spring framework, specifically we are using Spring Boot which provides easy auto-configuration.

To start developing you just need the code, the Java 7 JDK (or newer) and you favourite text editor. Just typing make in the command line will run gradle which downloads any Java requirements, including Spring framework.

Unit tests

You can run the unit tests by typing:

make test

(or equivalently ./gradlew test if you don't have GNU Make). The tests among other things will run a temporary DiMe server, add various things to the database and then try to retrieve them back over the API. After the tests have finished you can access them by opening the file build/reports/tests/index.html in a web browser.

Directory structure:

config/

Contains various configurations used by the Makefile. In particular if you want to change your own configuration take a look at the Configuration documentation.

doc/

Various bits and pieces of "documentation". Most documentation should be here in the wiki.

scripts/

Various helper scripts and simple examples (in Python) on how to use the DiMe API.

loggers/

Various external loggers. These have been moved to a separate git repository https://github.com/HIIT/dime-loggers .

src/main/resources

Various non-code resources used by DiMe. E.g. templates contains the Thymeleaf sources for the web dashboard, static contains static parts of the web page such as images and CSS files.

db/changelog/db.changelog-master.xml is an important file, it's the SQL schema update rules used by liquibase to keep the SQL databases up-to-date over different versions.

application.properties contains the default configuration of DiMe, don't change this unless you want to change the defaults for all users. To change your own settings only use the files in the config directory.

java/fi/hiit/dime/

Java source code, main application and controllers. Some important files include:

  • Application.java, which is the main class that starts the whole server application.
  • AppConfig.java
  • WebSecurityConfig.java

The Controller classes respond to HTTP requests:

  • ApiController.java
  • DataController.java, for uploading data items
  • AnswerController.java
  • WebController.java

answer/

Classes for answers, i.e. feature extraction side. This has not really been used yet.

authentication/

Classes for handling user accounts.

data/

Classes for data types that are stored in DiMe. See also documentation of the DiMe data model and documentation on how to add new data classes.

database/

Classes for interfacing with the database (SQL). The DAO classes are meant to be used by the rest of the application, the Repository classes shouldn't be used directly.

search/

Classes related to the Lucene-based text search.

util/

Simple stand-alone utility classes.

src/test/

Unit tests live here.