The Java EE POS System is a robust Point of Sale (POS) backend solution that manages orders, customers, and inventory. Built using Java EE technologies, it includes servlets, JSON processing, JNDI for database connectivity, and MySQL for data storage.
- Order Management: Create and retrieve orders.
- Customer Management: Add, view, update, and delete customer records.
- Item Management: Add, view, update, and delete items in the inventory.
- Java EE: Backend development with servlets and Java Beans.
- Jakarta JSON Binding (JSON-B): JSON serialization and deserialization.
- JNDI (Java Naming and Directory Interface): Database connection management.
- MySQL: Relational database for data storage.
- SLF4J: Logging.
- Java Development Kit (JDK) 11 or higher
- Apache Tomcat (or any compatible servlet container)
- MySQL database and JDBC driver
-
Clone the Repository:
git clone https://github.com/CharakaMihiranga/JavaEE-POS.git cd javaee-pos-system
-
Configure Database:
-
MySQL Setup: Ensure MySQL is installed and a database is created for the POS system.
-
JNDI Configuration: Update the JNDI resource configuration in your servlet container (e.g., Tomcat) to include a DataSource resource for MySQL.
Example JNDI configuration for Tomcat:
<Resource name="jdbc/posSystem" auth="Container" type="javax.sql.DataSource" maxActive="100" maxIdle="30" maxWait="10000" username="your_db_username" password="your_db_password" driverClassName="com.mysql.cj.jdbc.Driver" url="jdbc:mysql://localhost:3306/your_db_name"/>
-
-
Build and Deploy:
- If using Maven:
mvn clean install
- Deploy the generated WAR file to your servlet container (e.g., Tomcat).
- If using Maven:
-
Start the Server:
Start your servlet container and deploy the application.
The API provides endpoints for managing orders, customers, and items. For detailed API documentation, including request and response formats, please refer to the API Documentation.
The project uses JNDI for managing database connections, abstracting connection details from application code for more flexible configuration.
- JNDI Resource Lookup: Database connection is obtained through JNDI lookup, configured in the servlet container (e.g., Tomcat).
- Database Setup: MySQL is used for data storage. Ensure MySQL is properly installed and a database is created for this application.
- Schema: Set up the database schema to include tables for customers, items, and orders.
Logging is handled using SLF4J with default configuration. Logs are available in server logs and can be adjusted as needed.
Contributions are welcome! Please fork the repository and submit a pull request with your changes, adhering to the project's coding standards and including appropriate tests.
This project is licensed under the MIT License - see the LICENSE file for details.