Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Feedstack/.env.production
Original file line number Diff line number Diff line change
@@ -1 +1 @@
REACT_APP_API_URL=https://your-backend-will-be-here.onrender.com/api
REACT_APP_API_URL=http://feedstack-b2cc1.web.app/
3 changes: 3 additions & 0 deletions Feedstack/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,6 @@ env/
# OS
.DS_Store
Thumbs.db

#media folder
/media/uploads
2 changes: 1 addition & 1 deletion Feedstack/client/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@

npm-debug.log*
yarn-debug.log*
yarn-error.log*
yarn-error.log*
7 changes: 7 additions & 0 deletions Feedstack/client/firebase.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@
"**/node_modules/**"
],
"rewrites": [
{
"source": "/api/**",
"run": {
"serviceId": "feedstack",
"region": "us-east4"
}
},
{
"source": "**",
"destination": "/index.html"
Expand Down
33 changes: 16 additions & 17 deletions Feedstack/client/src/components/Feedback.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import axios from 'axios';
import MarkdownIt from 'markdown-it';
import popSound from '../assets/pop.mp3';
import API_URL from '../config';
import {db} from "../firebase"
import {serverTimestamp, addDoc, collection} from "firebase/firestore"

const md = new MarkdownIt({
html: false, // Disable HTML tags in source
Expand Down Expand Up @@ -146,8 +148,14 @@ function Feedback() {
setNewMessage('');

try {
// Log to console instead of Firebase
console.log('User message (Firebase disabled):', userMessage.content);
// Add user message to Firestore
const userMessageDoc = {
Message: userMessage.content,
Timestamp: serverTimestamp(),
Sender: "Participant"
};
await addDoc(collection(db, `Participants/${docId}/ChatLogs`), userMessageDoc);
console.log('User message added to Firestore:', userMessageDoc);

// Find the initial feedback about the design to maintain context
const initialFeedback = chatMessages.length > 0 && !chatMessages[0].is_user
Expand Down Expand Up @@ -176,16 +184,15 @@ function Feedback() {

const botMessage = response.data.bot_message;

// Log to console instead of Firebase
console.log('Bot message (Firebase disabled):', botMessage.content);
//Bot Message Check
console.log('Bot message:', botMessage.content);

const themeResponse = await axios.post(`${API_URL}/identify-theme/`, {
message: botMessage.content,
});

const newTheme = themeResponse.data.theme;
const newColor = themeColors[chapters.length % themeColors.length];

const summaryResponse = await axios.post(`${API_URL}/summarize/`, {
message: botMessage.content,
theme: newTheme
Expand All @@ -194,15 +201,6 @@ function Feedback() {
const { definition, relation, key_terms, summary } = summaryResponse.data;
botMessage.keyTerms = summaryResponse.data.key_terms || [];
setChatMessages(prevMessages => [...prevMessages, botMessage]);

// Log to console instead of Firebase
console.log('Theme (Firebase disabled):', {
theme: newTheme,
definition,
relation,
key_terms,
summary
});

// Generate a temporary ID for the theme
const tempThemeId = 'theme-' + Date.now();
Expand Down Expand Up @@ -427,10 +425,11 @@ function Feedback() {
// Improved navigation arrows function
const handleInstanceNavigation = (theme, direction) => {
if (!theme) return;

setChapters(prevChapters =>
prevChapters.map(item => {
if (item.theme === theme) {

// Safely get instances array and current index
const instances = item.instances || [];
const currentInstance = item.currentInstance || 0;
Expand Down
Binary file modified Feedstack/db.sqlite3
Binary file not shown.
16 changes: 13 additions & 3 deletions Feedstack/feedstack_project/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,20 @@
SECRET_KEY = os.environ.get('SECRET_KEY', 'django-insecure-srsjcch3)!h)2qd*3hd@a*3)2@lws#6e6v)mw01l%&t*k*3f1-')

# SECURITY WARNING: don't run with debug turned on in production!

DEBUG = os.environ.get('DEBUG', 'True') == 'True'
ALLOWED_HOSTS = [
'localhost',
'127.0.0.1',
'.fly.dev', # Fly.io's default domain
'.web.app', # Firebase Hosting
'.firebaseapp.com', # Firebase alternate domain
'.feedstack-b2cc1.web.app', # Firebase domain
'.feedstack-b2cc1.firebaseapp.com', # Firebase alternate
'.feedstack-515733206423.us-east4.run.app',
'.render.com'
]

ALLOWED_HOSTS = ['localhost', '127.0.0.1', '.render.com']

# Application definition

Expand Down Expand Up @@ -135,7 +146,6 @@
# https://docs.djangoproject.com/en/5.0/ref/settings/#default-auto-field

DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'

# CORS settings
CORS_ALLOW_ALL_ORIGINS = True
USE_X_FORWARDED_HOST = True
CORS_ALLOW_CREDENTIALS = True
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified Feedstack/media/uploads/design_image.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed Feedstack/media/uploads/design_image.png
Binary file not shown.
Binary file removed Feedstack/media/uploads/design_image_QDBJ4zO.jpeg
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed Feedstack/uploads/design_image.png
Binary file not shown.
Binary file removed Feedstack/uploads/design_image_AilAlu6.png
Binary file not shown.
Binary file removed Feedstack/uploads/design_image_VRBU8wC.png
Binary file not shown.
Binary file removed Feedstack/uploads/design_image_X7h7KwN.png
Binary file not shown.
Binary file removed Feedstack/uploads/design_image_chwbMck.png
Binary file not shown.
Binary file removed Feedstack/uploads/design_image_oaHigNe.png
Binary file not shown.