Apache Tomcat: https://dlcdn.apache.org/tomcat/tomcat-9/v9.0.94/bin/apache-tomcat-9.0.94.zip
To get started with the SmartHomes project, follow these steps:
-
Place the Source Code: Copy the source code into the
webappsfolder of your Tomcat installation, specifically under theSmartHomesdirectory.# /usr/local/apache-tomcat-9.0.94/webapps/SmartHomes/.env OPENAI_API_KEY=your_openai_key_here UPLOAD_DIR=/usr/local/apache-tomcat-9.0.94/webapps/SmartHomes/uploads DB_URL=jdbc:mysql://localhost:3306/smartHomes DB_USERNAME=your_db_username DB_PASSWORD=your_db_password ELASTIC_API_KEY=your_elastic_api_key_here1.1 Run elastic search migration
cd seed-elastic-search npm install npm run migrate -
Start the Frontend Server: Navigate to the frontend directory and run the following commands to install dependencies and start the frontend server:
cd frontend npm install npm run dev -
Deploy the Java Servlets: Make the deployment script executable and run it to deploy the Java servlets:
chmod +x deploy.sh ./deploy.sh
-
Start MySQL Service: Use Homebrew to start the MySQL service:
brew services start mysql mysql -u root -p
-
Start MongoDB Service: Similarly, start the MongoDB service:
brew services start mongodb-community@6.0 mongosh
-
Create the Database: In the MySQL shell, create the
smarthomesdatabase and import the schema:CREATE DATABASE smarthomes;
-
Verify Services: Ensure that both MySQL and MongoDB services are running properly. You can check their status with:
brew services list
-
Create MongoDB Collections: In the MongoDB shell, create the
productReviewscollection:
use smarthomes
db.createCollection("productReviews")-
Import the mongo schema and data: In the MongoDB shell, import the
mongoSchema.jsfile:mongo smarthomes mongoSchema.mongo
-
Access the Application: Open your web browser and navigate to
http://localhost:5173to access the SmartHomes application.
