A version of the petstore built without frameworks
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
domain
gradle/wrapper
persistence
server
tasks
webapp
.gitignore
.hgignore
.hgtags
.java-version
.rvmrc
.travis.yml
Gemfile
README.markdown
build.gradle
build.yaml
buildfile
gradlew
gradlew.bat
profiles.yaml
settings.gradle

README.markdown

Build Status

About

A fork of my petstore repository, but re-built with simple tools and no IoC container.

It uses the following tools:

  • Simple, an embeddable high-performance HTTP server
  • Molecule, a micro framework for web development
  • Mustache for logic-less templating
  • Plain JDBC
  • No IoC container
  • Gradle for the build system

Preparing

To prepare the development and test databases in MySQL:

create database petstore_dev;
create user 'petstore'@'localhost' identified by 'petstore';
grant all on petstore_dev.* to 'petstore'@'localhost';
create database petstore_test;
create user 'testbot'@'localhost' identified by 'petstore';
grant all on petstore_test.* to 'testbot'@'localhost';

Building

You need to install PhantomJS to run the end-to-end tests (tested on 1.9.7). Make sure you modify the end-to-end tests properties to indicate the path of the PhantomJS executable.

To build and run all tests:

./gradlew build

Migrating the database

To prepare your database:

./gradlew db-migrate

Use the seeds to populate your MySQL database with sample data:

mysql -u petstore -p petstore_dev < ./server/src/main/scripts/seeds/items.sql

Running

To run the application:

./gradlew run

IntelliJ

If you use IntelliJ, just import the gradle build.