Skip to content
Merged
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
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# SafeForest - Cybersecurity Education Game
# BeSafe Hackathon 2026 🏆 2nd Place Winner
## QueenB X AppsFlyer - BeSafe Hackathon 2026
### SafeForest - Cybersecurity Education Game

**SafeForest**
is an interactive 3D educational cybersecurity game designed to teach digital safety and online security concepts through engaging gameplay.
Expand Down
11 changes: 1 addition & 10 deletions client/.gitignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
# אל תעלי את קובץ הסביבה עם המפתח לגיטהאב
.env
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
Expand All @@ -19,8 +14,4 @@ dist-ssr
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

13 changes: 0 additions & 13 deletions client/src/pages/Login.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@ const Login = ({ onClose, onLoginSuccess }) => {
const navigate = useNavigate();
const { handleLogin } = useContext(GameContext);

// Check if Google OAuth is available
const hasGoogleAuth = Boolean(import.meta.env.VITE_GOOGLE_CLIENT_ID);

// Always call the hook, but conditionally use it
const googleLogin = useGoogleLogin({
onSuccess: async (tokenResponse) => {
try {
Expand All @@ -38,16 +36,13 @@ const Login = ({ onClose, onLoginSuccess }) => {
const userData = serverResponse.data.user;
const googlePicture = userInfo.data.picture;

// Store user picture in localStorage
if (googlePicture) {
localStorage.setItem('userPicture', googlePicture);
}

// Call onLoginSuccess if provided (for backward compatibility)
if (onLoginSuccess) {
onLoginSuccess(userData, googlePicture);
} else {
// Otherwise, handle login directly
handleLogin(userData);
}

Expand All @@ -58,7 +53,6 @@ const Login = ({ onClose, onLoginSuccess }) => {
if (onClose) {
onClose();
} else {
// Redirect to game page
navigate('/game');
}
}, 1000);
Expand Down Expand Up @@ -117,11 +111,9 @@ const Login = ({ onClose, onLoginSuccess }) => {

console.log('🎮 Guest login:', guestUser);

// Call onLoginSuccess if provided (for backward compatibility)
if (onLoginSuccess) {
onLoginSuccess(guestUser, '');
} else {
// Otherwise, handle login directly
handleLogin(guestUser);
}

Expand All @@ -130,24 +122,20 @@ const Login = ({ onClose, onLoginSuccess }) => {
if (onClose) {
onClose();
} else {
// Redirect to game page
navigate('/game');
}
}, 1000);
};

return (
<div className={styles.loginContainer}>
{/* LEFT SIDE: Visual Branding */}
<div className={styles.visualSide}>
{/* Animated gradient background */}
<div className={styles.floatingShapes}>
<div className={styles.shape}></div>
<div className={styles.shape}></div>
<div className={styles.shape}></div>
</div>

{/* Branding Content */}
<div className={styles.brandingContent}>
<h1 className={styles.brandLogo}>SafeForest</h1>
<p className={styles.brandTagline}>Your Cybersecurity Sanctuary</p>
Expand All @@ -158,7 +146,6 @@ const Login = ({ onClose, onLoginSuccess }) => {
</div>
</div>

{/* RIGHT SIDE: Login Form */}
<div className={styles.formSide}>
<div className={styles.formContainer}>
{onClose && (
Expand Down
7 changes: 2 additions & 5 deletions client/src/styles/modules/App.module.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* App.module.css */
.appWrap {
position: relative;
min-height: 100vh;
Expand Down Expand Up @@ -63,7 +62,6 @@
align-items: center;
gap: 12px;

/* רקע זכוכית עדין עם פינות מעוגלות קלות (כמו ב-Side Panel) */
background: rgba(255, 255, 255, 0.1);
backdrop-filter: blur(10px);
padding: 6px 14px;
Expand All @@ -73,11 +71,10 @@
}

.userAvatar {
/* תמונה עגולה מושלמת */
width: 32px;
height: 32px;
border-radius: 50%; /* זה מה שהופך את התמונה לעיגול */
border: 2px solid #00f2ff; /* מסגרת ניאון דקה סביב העיגול */
border-radius: 50%;
border: 2px solid #00f2ff;
object-fit: cover;
display: block;
}
Expand Down
2 changes: 0 additions & 2 deletions client/vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,11 @@ export default defineConfig({
port: 5173,
strictPort: true,
proxy: {
// כל בקשה שמתחילה ב-api תופנה לשרת ה-Node.js
'/api': {
target: 'http://127.0.0.1:5000',
changeOrigin: true,
secure: false,
},
// הפניית בקשות לתמונות (אם יש תיקייה כזו בשרת)
'/images': {
target: 'http://127.0.0.1:5000',
changeOrigin: true,
Expand Down
1 change: 0 additions & 1 deletion db/db.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { fileURLToPath } from 'url';
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);

// טעינת ה-env מהתיקייה שמעל (server)
dotenv.config({ path: path.resolve(__dirname, '../server/.env') });

console.log("--- DB Connection Test ---");
Expand Down
Loading