Minimily is an application designed to help you keeping your life as simple as possible. We will help you to make decisions taking into account the impact on your health, family, living place, community and environment.
Minimily is a web application and it has 3 requirements:
PostgreSQL is a database that scales from a Raspberry PI to a high availability cluster. It requires some additional configuration at the beginning, but it is quite straightforward to work with.
The application is developed in Clojure, a language hosted on the Java Virtual Machine (JVM), which means it depends on a Java environment to work. The JVM is well known for its performance and large ecosystem.
Leiningen is a build tool for Clojure applications. It is used during development, packaging and deployment.
Execute the following commands to install PostgreSQL:
$ sudo apt-get install postgresql $ sudo su - postgres -c "createuser -s $USER"
Then create the database for the application:
$ createdb minimily $ createuser minimily -P $ psql -d minimily =# grant connect on database minimily to minimily; =# \q
Run from the terminal (dev profile):
$ lein run
Run from the REPL (dev profile):
$ lein repl minimily.web=> (start-server 3000) minimily.web=> (stop-server)
Package the application into a
jar file (uberjar profile with prod config):
$ lein uberjar
$ java $JVM_OPTS -cp target/minimily-standalone.jar clojure.main -m minimily.web
To deploy to Heroku, make sure you have a PostgreSQL database and an environment variable named DATABASE_URL.
The application is organized in decoupled modules. They are:
- accounting: manages the finances of the family
- documents: manages digitalized and phisical copies of documents
- family: define the family, its members and the relationship between them
- inventory: manages all objects in the house
- auth: manages the authentification of users
Each module contains two basic folders:
- model: contains the code that access sources of data to add, search, retrieve, modify and delete records
- web: contains the code renders the web user interface to enable all possible data operations
The model is divided in two parts:
- sql: a collection of sql queries organized by entity, keeping them separated from the model logic.
- model workspace: the model that manages the data of the entities.
The web is divided in four parts:
- routing: associates urls with controller functions that return web content.
- controller: functions that receive requests from web clients and interact with the model to generate responses expected by the clients.
- The prefix
get-indicates the function returns a single value or record.
- The prefix
find-indicates the function returns a collection of values or records.
Copyright © 2017-2018 Hildeberto Mendonca
Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.