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
69 changes: 69 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: CI/CD Pipeline for Project Manager

on:
push:
branches: [ "main" ] # Triggers on push to the main branch
pull_request:
branches: [ "main" ] # Also triggers on pull requests to main

jobs:
#-------------------------
# BACKEND CI/CD
#-------------------------
backend:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./backend

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18' # Use a version compatible with your project

- name: Install dependencies
run: npm install

- name: Run backend tests
run: npm test
env:
MONGO_URI: ${{ secrets.MONGO_URI }} # Use secrets for sensitive data
JWT_SECRET: ${{ secrets.JWT_SECRET }}

# Add your backend deployment step here, e.g., to Render or Heroku

#-------------------------
# FRONTEND CI/CD
#-------------------------
frontend:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./frontend

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18'

- name: Install dependencies
run: npm install

- name: Run linter
run: npm run lint

- name: Build the frontend
run: npm run build
env:
VITE_API_URL: ${{ secrets.VITE_API_URL }}
VITE_SOCKET_URL: ${{ secrets.VITE_SOCKET_URL }}

# Add your frontend deployment step here, e.g., to Vercel or Netlify
1 change: 1 addition & 0 deletions frontend/eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export default defineConfig([
},
rules: {
'no-unused-vars': ['error', { varsIgnorePattern: '^[A-Z_]' }],
'react-refresh/only-export-components': 'warn' // Since exporting a provider and a custom hook from the same context file is a very common and accepted pattern, we can mark this as a warning.
},
},
])
44 changes: 0 additions & 44 deletions frontend/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,47 +25,3 @@ function App() {
}

export default App;


// import React from 'react';
// import { Routes, Route, Link, Navigate } from 'react-router-dom';
// import { useAuth } from './context/AuthContext';
// import LoginPage from './pages/LoginPage';
// import RegisterPage from './pages/RegisterPage';
// import DashboardPage from './pages/DashboardPage';
// import ProjectPage from './pages/ProjectPage';
// import HomePage from './pages/HomePage';

// // Styled HomePage component
// const HomePage = () => (
// <div className="flex flex-col items-center justify-center min-h-screen text-center">
// <h1 className="text-5xl font-bold mb-4">Welcome to the Project Manager</h1>
// <div className="space-x-4">
// <Link to="/login" className="px-6 py-2 font-semibold text-white bg-blue-600 rounded-md hover:bg-blue-700">
// Login
// </Link>
// <Link to="/register" className="px-6 py-2 font-semibold text-white bg-gray-600 rounded-md hover:bg-gray-700">
// Register
// </Link>
// </div>
// </div>
// );

// function App() {
// const { user } = useAuth();

// return (
// // Set global background and text color
// <div className="bg-gray-900 text-white min-h-screen font-sans">
// <Routes>
// <Route path="/" element={user ? <Navigate to="/dashboard" /> : <HomePage />} />
// <Route path="/login" element={user ? <Navigate to="/dashboard" /> : <LoginPage />} />
// <Route path="/register" element={user ? <Navigate to="/dashboard" /> : <RegisterPage />} />
// <Route path="/dashboard" element={user ? <DashboardPage /> : <Navigate to="/login" />} />
// <Route path="/project/:projectId" element={user ? <ProjectPage /> : <Navigate to="/login" />} />
// </Routes>
// </div>
// );
// }

// export default App;
2 changes: 2 additions & 0 deletions frontend/src/components/TaskCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ const TaskCard = ({ task, onEdit }) => {
<div className="flex justify-between items-start">
<h4 className="font-medium text-white">{task.title}</h4>
<button onClick={() => onEdit(task)} className="text-xs text-gray-400 hover:text-white">Edit</button>
{/* This comment will disable the 'no-undef' error for the next line only */}
{/* eslint-disable-next-line no-undef */}
<button onClick={() => onDelete(task._id)} className="text-xs text-red-400 hover:text-red-300">Delete</button>
</div>
<p className="text-sm text-gray-300 mt-1">{task.description}</p>
Expand Down
70 changes: 0 additions & 70 deletions frontend/src/index.css
Original file line number Diff line number Diff line change
@@ -1,73 +1,3 @@
@tailwind base;
@tailwind components;
@tailwind utilities;


/* :root {
font-family: system-ui, Avenir, Helvetica, Arial, sans-serif;
line-height: 1.5;
font-weight: 400;

color-scheme: light dark;
color: rgba(255, 255, 255, 0.87);
background-color: #242424;

font-synthesis: none;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}

a {
font-weight: 500;
color: #646cff;
text-decoration: inherit;
}
a:hover {
color: #535bf2;
}

body {
margin: 0;
display: flex;
place-items: center;
min-width: 320px;
min-height: 100vh;
}

h1 {
font-size: 3.2em;
line-height: 1.1;
}

button {
border-radius: 8px;
border: 1px solid transparent;
padding: 0.6em 1.2em;
font-size: 1em;
font-weight: 500;
font-family: inherit;
background-color: #1a1a1a;
cursor: pointer;
transition: border-color 0.25s;
}
button:hover {
border-color: #646cff;
}
button:focus,
button:focus-visible {
outline: 4px auto -webkit-focus-ring-color;
}

@media (prefers-color-scheme: light) {
:root {
color: #213547;
background-color: #ffffff;
}
a:hover {
color: #747bff;
}
button {
background-color: #f9f9f9;
}
} */
1 change: 1 addition & 0 deletions frontend/src/pages/LoginPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const LoginPage = () => {
await login({ email, password });
navigate('/dashboard');
} catch (err) {
console.error("Login failed:", err); // Good for debugging
setError('Invalid email or password. Please try again.');
}
};
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/ProjectPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
return () => {
socket.off('taskUpdated', handleTaskUpdate);
};
}, [projectId]);
}, [projectId], fetchProjectData);

Check warning on line 49 in frontend/src/pages/ProjectPage.jsx

View workflow job for this annotation

GitHub Actions / frontend

React Hook useEffect has a missing dependency: 'fetchProjectData'. Either include it or remove the dependency array

const handleInviteMember = async (e) => {
e.preventDefault();
Expand Down
1 change: 1 addition & 0 deletions frontend/src/pages/RegisterPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const RegisterPage = () => {
await register({ name, email, password });
navigate('/dashboard');
} catch (err) {
console.error("Register failed:", err); // Good for debugging
setError('Failed to register. The email might already be in use.');
}
};
Expand Down
Loading