diff --git a/CarAIbou_full.egg-info/PKG-INFO b/CarAIbou_full.egg-info/PKG-INFO deleted file mode 100644 index 3646ac9..0000000 --- a/CarAIbou_full.egg-info/PKG-INFO +++ /dev/null @@ -1,8 +0,0 @@ -Metadata-Version: 2.1 -Name: CarAIbou-full -Version: 0.0.1 -Author: Vivian -Author-email: viviannnlyr23@gmail.com -Requires-Dist: pandas -Requires-Dist: numpy -Requires-Dist: seaborn diff --git a/CarAIbou_full.egg-info/SOURCES.txt b/CarAIbou_full.egg-info/SOURCES.txt deleted file mode 100644 index 0765602..0000000 --- a/CarAIbou_full.egg-info/SOURCES.txt +++ /dev/null @@ -1,7 +0,0 @@ -setup.py -CarAIbou_full.egg-info/PKG-INFO -CarAIbou_full.egg-info/SOURCES.txt -CarAIbou_full.egg-info/dependency_links.txt -CarAIbou_full.egg-info/requires.txt -CarAIbou_full.egg-info/top_level.txt -src/__init__.py \ No newline at end of file diff --git a/CarAIbou_full.egg-info/dependency_links.txt b/CarAIbou_full.egg-info/dependency_links.txt deleted file mode 100644 index 8b13789..0000000 --- a/CarAIbou_full.egg-info/dependency_links.txt +++ /dev/null @@ -1 +0,0 @@ - diff --git a/CarAIbou_full.egg-info/requires.txt b/CarAIbou_full.egg-info/requires.txt deleted file mode 100644 index 97d4bce..0000000 --- a/CarAIbou_full.egg-info/requires.txt +++ /dev/null @@ -1,3 +0,0 @@ -pandas -numpy -seaborn diff --git a/CarAIbou_full.egg-info/top_level.txt b/CarAIbou_full.egg-info/top_level.txt deleted file mode 100644 index 85de9cf..0000000 --- a/CarAIbou_full.egg-info/top_level.txt +++ /dev/null @@ -1 +0,0 @@ -src diff --git a/backend/server.js b/backend/server.js index 16e6da0..307f4b0 100644 --- a/backend/server.js +++ b/backend/server.js @@ -4,22 +4,24 @@ const express = require('express') const dotenv = require('dotenv').config() const port = process.env.PORT || 5000 const connectDB = require('./config/db') +const cors = require("cors"); connectDB() const app = express() app.use(express.json()) -app.use(express.urlencoded({extended: false})); +app.use(express.urlencoded({extended: false})) + +app.use( + cors({ + origin: ["http://localhost:3000", "https://CarAIbou-demo.onrender.com"], + }) +) + app.use('/api/users', require('./routes/userRoutes')) app.use('/api/habits', require('./routes/habitsRoutes')) app.use('/api/goals', require('./routes/goalsRoutes')) -// Serve frontend -if (process.env.NODE_ENV === 'production') { - app.use(express.static(path.join(__dirname, '../frontend/build'))) - - app.get('*', (req, res) => res.sendFile(path.resolve(__dirname, '../', 'frontend', 'build', 'index.html'))) -} app.listen(port, () => console.log(`Server started on port ${port}`)) \ No newline at end of file diff --git a/logs/09_09_2023_22_51_37.log/09_09_2023_22_51_37.log b/logs/09_09_2023_22_51_37.log/09_09_2023_22_51_37.log deleted file mode 100644 index e48f000..0000000 --- a/logs/09_09_2023_22_51_37.log/09_09_2023_22_51_37.log +++ /dev/null @@ -1 +0,0 @@ -[ 2023-09-09 22:51:37,891 ] 18 root - INFO - Logging has started diff --git a/logs/09_09_2023_22_59_58.log/09_09_2023_22_59_58.log b/logs/09_09_2023_22_59_58.log/09_09_2023_22_59_58.log deleted file mode 100644 index 2b35480..0000000 --- a/logs/09_09_2023_22_59_58.log/09_09_2023_22_59_58.log +++ /dev/null @@ -1 +0,0 @@ -[ 2023-09-09 22:59:58,854 ] 26 root - INFO - Logging Exceptions: Divide on zero error diff --git a/package-lock.json b/package-lock.json index 064d179..9cf9925 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,6 +10,7 @@ "license": "ISC", "dependencies": { "bcryptjs": "^2.4.3", + "cors": "^2.8.5", "dotenv": "^16.3.1", "express": "^4.18.2", "express-async-handler": "^1.2.0", @@ -447,6 +448,18 @@ "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==" }, + "node_modules/cors": { + "version": "2.8.5", + "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", + "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", + "dependencies": { + "object-assign": "^4", + "vary": "^1" + }, + "engines": { + "node": ">= 0.10" + } + }, "node_modules/date-fns": { "version": "2.30.0", "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.30.0.tgz", @@ -1474,7 +1487,6 @@ "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", - "dev": true, "engines": { "node": ">=0.10.0" } diff --git a/package.json b/package.json index 7d357b2..52dd878 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,4 @@ { - "homepage": "https://viviannnl.github.io/CarAIbou_full", "name": "caraibou_web_full", "version": "1.0.0", "description": "A full stack web for the project CarAIbou.", @@ -9,14 +8,13 @@ "start": "node backend/server.js", "server": "nodemon backend/server.js", "client": "npm start --prefix frontend", - "dev": "concurrently \"npm run server\" \"npm run client\"", - "predeploy": "npm run build", - "deploy": "gh-pages -d build" + "dev": "concurrently \"npm run server\" \"npm run client\"" }, "author": "", "license": "ISC", "dependencies": { "bcryptjs": "^2.4.3", + "cors": "^2.8.5", "dotenv": "^16.3.1", "express": "^4.18.2", "express-async-handler": "^1.2.0", diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 0937926..0000000 --- a/requirements.txt +++ /dev/null @@ -1,4 +0,0 @@ -pandas -numpy -seaborn --e . \ No newline at end of file diff --git a/setup.py b/setup.py deleted file mode 100644 index fe528f2..0000000 --- a/setup.py +++ /dev/null @@ -1,31 +0,0 @@ -# to build our application as a package - -from setuptools import find_packages, setup -from typing import List - - -HYPHEN_E_DOT = '-e .' -def get_requirements(file_path:str)->List[str]: - ''' - This funciton will return the list of requirements - ''' - requirements = [] - with open(file_path) as file_obj: - requirements=file_obj.readlines() - requirements = [req.replace("\n", "") for req in requirements] - - if HYPHEN_E_DOT in requirements: - requirements.remove(HYPHEN_E_DOT) - - return requirements - - -setup( - name='CarAIbou_full', - version='0.0.1', - author='Vivian', - author_email='viviannnlyr23@gmail.com', - packages=find_packages(), - install_requires=get_requirements('requirements.txt') - -) \ No newline at end of file diff --git a/src/__init__.py b/src/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/src/components/__init__.py b/src/components/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/src/components/data_ingestion.py b/src/components/data_ingestion.py deleted file mode 100644 index e69de29..0000000 diff --git a/src/components/data_transformation.py b/src/components/data_transformation.py deleted file mode 100644 index e69de29..0000000 diff --git a/src/components/model_trainer.py b/src/components/model_trainer.py deleted file mode 100644 index e69de29..0000000 diff --git a/src/exception.py b/src/exception.py deleted file mode 100644 index 8a8186f..0000000 --- a/src/exception.py +++ /dev/null @@ -1,28 +0,0 @@ -import sys -from src.logger import logging - -def error_message_detail(error, error_detail:sys): - _,_,exc_tb = error_detail.exc_info() #which file and line the exception occurs - file_name = exc_tb.tb_frame.f_code.co_filename - - error_message = "Error occured in python script name [{0}] line number [{1}] error message[{2}]".format( - file_name, exc_tb.tb_lineno,str(error) - ) - return error_message - -class CustomException(Exception): - def __init__(self, error_message, error_detail:sys): - super().__init__(error_message) - self.error_message = error_message_detail(error_message, error_detail=error_detail) - - def __str__(self): - return self.error_message - -''' -if __name__ == "__main__": - try: - a = 1/0 - except Exception as e: - logging.info("Logging Exceptions: Divide on zero error") - raise CustomException(e, sys) -''' \ No newline at end of file diff --git a/src/logger.py b/src/logger.py deleted file mode 100644 index e478e1f..0000000 --- a/src/logger.py +++ /dev/null @@ -1,20 +0,0 @@ -import logging -import os -from datetime import datetime - -LOG_FILE = f"{datetime.now().strftime('%m_%d_%Y_%H_%M_%S')}.log" -logs_path = os.path.join(os.getcwd(), "logs",LOG_FILE) -os.makedirs(logs_path, exist_ok=True) - -LOG_FILE_PATH = os.path.join(logs_path, LOG_FILE) - -logging.basicConfig( - filename=LOG_FILE_PATH, - format = "[ %(asctime)s ] %(lineno)d %(name)s - %(levelname)s - %(message)s", - level=logging.INFO, -) - -''' -if __name__ == "__main__": - logging.info("Logging has started") -''' \ No newline at end of file diff --git a/src/pipeline/__init__.py b/src/pipeline/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/src/pipeline/predict_pipeline.py b/src/pipeline/predict_pipeline.py deleted file mode 100644 index e69de29..0000000 diff --git a/src/pipeline/train_pipeline.py b/src/pipeline/train_pipeline.py deleted file mode 100644 index e69de29..0000000 diff --git a/src/utils.py b/src/utils.py deleted file mode 100644 index e69de29..0000000