Skip to content

mucadoo/software-store

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Software Store

Project Description

The Software Store is a Java-based web application designed to manage and showcase various software products. It uses standard Java EE technologies like Servlets and JSP for the web layer and interacts with an Apache Derby database for persistent storage. The entire stack is containerized using Docker for ease of development and deployment.

Features

  • Browse Software: View a list of available software products.
  • Inventory Management: Create, update, and delete software entries.
  • Java Servlet/JSP: Leverages standard Java web technologies.
  • Persistent Storage: Uses Apache Derby as the database.
  • Dockerized Stack: Includes a pre-configured environment with Tomcat and Derby.

Technologies Used

  • Backend: Java (JDK 1.8)
  • Web Framework: Java Servlets and JSP
  • Build Tool: Maven
  • Database: Apache Derby
  • Containerization: Docker and Docker Compose
  • Server: Apache Tomcat 9.0.58

Setup and Installation

Prerequisites

Local Development Setup

  1. Clone the repository:

    git clone https://github.com/your-username/software-store.git
    cd software-store
  2. Build the application:

    mvn clean install

    This command compiles the source code, runs tests (if any), and packages the application into a software-store.war file in the target/ directory.

  3. Run with Docker Compose: The application and its database environment can be started using Docker Compose.

    docker-compose up --build

    This command will:

    • Build the Docker image using the Dockerfile.
    • Initialize the Apache Derby database if it's the first run.
    • Deploy the WAR file to Apache Tomcat.
    • Start both the database and the web server.
  4. Access the application: Once the containers are running, the application will be accessible at: http://localhost:8080/software-store

Database Configuration

The application uses an Apache Derby database. Configuration is handled via environment variables in docker-compose.yml:

  • Database Name: SW_STORE
  • User: adm
  • Password: adm
  • Port: 1527 (Derby Network Server)

Initialization

On the first run, the startup.sh script executes the init.sql script to set up the database schema and populate it with initial data. A flag file /app/db_initialized is created to prevent re-initialization on subsequent runs.

Scripts

  • Dockerfile: Defines the application's container environment (JDK 8, Tomcat 9, Derby).
  • docker-compose.yml: Orchestrates the application container and its dependencies.
  • startup.sh: A shell script that handles database initialization and starts the Tomcat server.
  • init.sql: Contains the SQL commands to create the database schema and insert initial data.

Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature/your-feature-name).
  3. Make your changes.
  4. Commit your changes (git commit -m 'Add some feature').
  5. Push to the branch (git push origin feature/your-feature-name).
  6. Open a Pull Request.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors