Rewrite Netbeans e-commerce tutorial using Spring framework
- Designing application:
- Scenario
- Requirements
- Mockups
- Architecture
- Setting up development environment:
- IDE: Spring Tool Suite
- DBMS: MySQL
- Create a new Spring MVC template project
- Template engine: Velocity or Thymeleaf; Layout: Bootstrap
- Preparing views and controllers (front-end).
- Designing data model:
- Identify the entities and their relationships
- Follow bottom up (reverse mapping) or top down approach using Hibernate
- Developing business logic.
- Integrating with front-end.
- Others:
- Securing the application
- Adding language support
- Testing
- Deploying on OpenShift -> visit demo app:
- The front store
- The admin console (username/password found in
scripts/sql/admin-console_data.sql
)
- Docker Compose (docker image of this demo)
- Install Docker Compose
docker-compose up -d
- To start in the next use:
docker-compose start|stop [affablebean-container|mysql-container]
- Standalone (given docker installed and currently in
affablebean-spring-tutorial
project folder)
docker run -d -v $(pwd)/scripts/sql:/docker-entrypoint-initdb.d -e MYSQL_ROOT_PASSWORD=password -e MYSQL_DATABASE=affablebean -p 3306:3306 --name mysql-container mysql:5.7.14
docker run -d --link mysql-container -p 8080:8080 --name affablebean-container sunshine55/affablebean
OR
mvn clean install
docker run -d -v $(pwd)/scripts/sql:/docker-entrypoint-initdb.d -e MYSQL_ROOT_PASSWORD=password -e MYSQL_DATABASE=affablebean -p 3306:3306 --name mysql-container mysql:5.7.14
docker build -t affablebean .
docker run -d --link mysql-container -p 8080:8080 --name affablebean-container affablebean
THEN
docker start|stop mysql-container
docker start|stop affablebean-container