Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

🐦 DataBird Store

A beautiful demo e-commerce application for exotic birds, built with Java Servlets. Perfect for demonstrating Datadog RUM Auto Instrumentation on Servlet webservers.

Java Servlet Tomcat

Features

  • 🛍️ Browse Birds - View a collection of exotic birds with beautiful imagery
  • 🔍 Search - Find birds by name, species, or description
  • 🛒 Shopping Cart - Add items, update quantities, remove items
  • 💳 Checkout - Complete orders with customer information
  • 📋 Order Management - View order history and details

Prerequisites

  • Java 11 or higher
  • Maven 3.6+

Quick Start

1. Build the Application

mvn clean compile

2. Run Locally

mvn exec:java -Dexec.mainClass="com.databird.Main"

The application will start at http://localhost:8080

3. (Optional) Package as WAR

mvn clean package

The WAR file will be created at target/databird-store-1.0.0.war

RUM Auto Instrumentation

This application is designed to work with Datadog RUM Injection on Java Web Application Servers.

How to Enable RUM Injection

  1. Install the Datadog Java Agent on your server
  2. Set the following environment variables:
export DD_RUM_ENABLED=true
export DD_RUM_APPLICATION_ID=<your-application-id>
export DD_RUM_CLIENT_TOKEN=<your-client-token>
export DD_RUM_REMOTE_CONFIGURATION_ID=<your-remote-config-id>
export DD_RUM_SITE=datadoghq.com
  1. Start the application with the Datadog Java Agent:
java -javaagent:/path/to/dd-java-agent.jar \
     -Ddd.rum.enabled=true \
     -Ddd.rum.application.id=<your-application-id> \
     -Ddd.rum.client.token=<your-client-token> \
     -Ddd.rum.remote.configuration.id=<your-remote-config-id> \
     -jar target/databird-store-1.0.0.war

The RUM JavaScript snippet will be automatically injected into all HTML pages!

Project Structure

src/
├── main/
│   ├── java/com/databird/
│   │   ├── Main.java              # Embedded Tomcat launcher
│   │   ├── model/                 # Data models (Bird, Cart, Order)
│   │   ├── store/                 # In-memory data store
│   │   ├── servlet/               # HTTP Servlets
│   │   └── filter/                # Servlet Filters
│   └── webapp/
│       └── WEB-INF/
│           ├── views/             # JSP templates
│           └── web.xml            # Servlet configuration
└── pom.xml                        # Maven configuration

Pages & Routes

Route Description
/ Home page with bird listings
/bird/{id} Bird detail page
/cart Shopping cart
/checkout Checkout form
/order/{id} Order confirmation/details
/orders Order history

Tech Stack

  • Backend: Java Servlets (Servlet API 4.0)
  • Server: Embedded Apache Tomcat 9
  • Views: JSP with JSTL
  • Build: Apache Maven
  • Data: In-memory store (demo purposes)

Customization

Change Port

Set the PORT environment variable:

PORT=3000 mvn exec:java -Dexec.mainClass="com.databird.Main"

Add More Birds

Edit BirdStore.java and add more birds in the initializeBirds() method.

License

MIT - This is a demo application for educational purposes.


Built with ❤️ for Datadog RUM Auto Instrumentation Demo

About

Online BirdStore

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages