A RESTful API for managing a product catalog. This project leverages Java Servlets and JDBC for database interaction and is designed to run on Apache Tomcat. It employs Maven for build and dependency management.
- Overview
- Environment Requirements
- Dependencies
- Project Setup
- Building and Deploying
- Usage
- Future Enhancements
The Product Catalog Project provides a RESTful API for creating, reading, updating, and deleting product and its categories entries. It is designed to be lightweight and efficient, making use of the Jakarta Servlet API and JDBC for backend operations and Gson for JSON processing.
To run the application, ensure you have the following installed:
- Tomcat 10 or higher: For deploying and running the web application.
- MySQL 8.1: As the primary relational database.
- Maven: For managing project dependencies and building the application.
The project uses the following libraries:
- Jakarta Servlet API: For building RESTful endpoints.
- Gson: For converting Java objects to JSON and vice versa.
- MySQL Java Connector: For establishing JDBC connections with the MySQL database.
-
Database Initialization:
- Execute the provided
init.sqlscript on your MySQL server. This script will create the necessary database and tables.
- Execute the provided
-
Building the Project:
-
Navigate to the project directory and execute:
mvn clean install
-
-
Build:
- The above Maven command will compile and package the project into a WAR file.
-
Deploy:
- Copy the generated WAR file (typically located in the
targetdirectory) to the Tomcatwebappsfolder. - Start or restart Tomcat. The application will be deployed automatically.
- Copy the generated WAR file (typically located in the
-
Configuration:
- Ensure that the database connection parameters (URL, username, password) are correctly set in the project's configuration files
dbconfig.properties.
- Ensure that the database connection parameters (URL, username, password) are correctly set in the project's configuration files
- For testing APIs endpoints
- Please take a look at the postman collection I've attached.
- Security: Implementation of authentication and authorization mechanisms.
- Scalability: Exploration of connection pooling and caching mechanisms to improve performance under load.
- Testing: Integration and unit tests to ensure reliability and maintainability.