Skip to content

Commit

Permalink
Merge pull request #15 from swecc-uw/interview-read-endpoints
Browse files Browse the repository at this point in the history
added interview read endpoints and matching algo along with tests
  • Loading branch information
elimelt authored Aug 4, 2024
2 parents 86a5ca6 + c8d2fc7 commit c301f30
Show file tree
Hide file tree
Showing 18 changed files with 810 additions and 198 deletions.
17 changes: 17 additions & 0 deletions docker-compose.db.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
version: '3.8'

services:
db:
image: postgres:13
volumes:
- postgres_data:/var/lib/postgresql/data
ports:
- ${DB_PORT}:${DB_PORT}
environment:
- POSTGRES_DB=${DB_NAME}
- POSTGRES_USER=${DB_USER}
- POSTGRES_PASSWORD=${DB_PASSWORD}
- POSTGRES_PORT=${DB_PORT}

volumes:
postgres_data:
31 changes: 27 additions & 4 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"axios": "^1.6.7",
"jwt-decode": "^4.0.0",
"react": "^18.2.0",
"react-copy-to-clipboard": "^5.1.0",
"react-dom": "^18.2.0",
"react-router-dom": "^6.22.3",
"styled-components": "^6.1.11"
Expand Down
107 changes: 59 additions & 48 deletions frontend/src/App.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import react from "react";
import { BrowserRouter, Routes, Route, Navigate } from "react-router-dom";
import Login from "./pages/Login";
import Register from "./pages/Register";
Expand All @@ -10,6 +9,8 @@ import MemberPage from "./pages/MemberProfile";
import MemberOnboarding from "./pages/MemberOnboarding";
import InterviewPoolSignUp from "./pages/InterviewPool";
import DirectoryPage from "./pages/DirectoryPage";
import StupidAuthDebug from "./pages/StupidAuthDebug";
import Layout from "./components/Layout";

function Logout() {
localStorage.clear();
Expand All @@ -24,53 +25,63 @@ function RegisterAndLogout() {
function App() {
return (
<BrowserRouter>
<Routes>
<Route
path="/"
element={
<ProtectedRoute>
<Home />
</ProtectedRoute>
}
/>
<Route
path="/profile"
element={
<ProtectedRoute>
<MemberPage />
</ProtectedRoute>
}
/>
<Route path="/login" element={<Login />} />
<Route path="/logout" element={<Logout />} />
<Route path="/register" element={<RegisterAndLogout />} />
<Route
path="/topics"
element={
<ProtectedRoute>
<Topic />
</ProtectedRoute>
}
/>
<Route
path="/onboarding"
element={
<ProtectedRoute>
<MemberOnboarding />
</ProtectedRoute>
}
/>
<Route path="/interview" element={<InterviewPoolSignUp />} />
<Route
path="/directory"
element={
<ProtectedRoute>
<DirectoryPage />
</ProtectedRoute>
}
/>
<Route path="*" element={<NotFound />}></Route>
</Routes>
<Layout>
<Routes>
<Route
path="/"
element={
<ProtectedRoute>
<Home />
</ProtectedRoute>
}
/>
<Route
path="/profile"
element={
<ProtectedRoute>
<MemberPage />
</ProtectedRoute>
}
/>
<Route path="/login" element={<Login />} />
<Route path="/logout" element={<Logout />} />
<Route path="/register" element={<RegisterAndLogout />} />
<Route
path="/topics"
element={
<ProtectedRoute>
<Topic />
</ProtectedRoute>
}
/>
<Route
path="/onboarding"
element={
<ProtectedRoute>
<MemberOnboarding />
</ProtectedRoute>
}
/>
<Route
path="/api"
element={
<ProtectedRoute>
<StupidAuthDebug />
</ProtectedRoute>
}
/>
<Route path="/interview" element={<InterviewPoolSignUp />} />
<Route
path="/directory"
element={
<ProtectedRoute>
<DirectoryPage />
</ProtectedRoute>
}
/>
<Route path="*" element={<NotFound />}></Route>
</Routes>
</Layout>
</BrowserRouter>
);
}
Expand Down
26 changes: 26 additions & 0 deletions frontend/src/components/Layout.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { Link } from 'react-router-dom';
import '../styles/Layout.css';

const Layout = ({ children }) => {
return (
<div className="layout">
<nav className="navbar">
<ul>
<li><Link to="/">Home</Link></li>
<li><Link to="/profile">Profile</Link></li>
<li><Link to="/topics">Topics</Link></li>
<li><Link to="/onboarding">Onboarding</Link></li>
<li><Link to="/api">API Debug</Link></li>
<li><Link to="/interview">Interview Pool</Link></li>
<li><Link to="/directory">Directory</Link></li>
<li><Link to="/logout">Logout</Link></li>
</ul>
</nav>
<main>
{children}
</main>
</div>
);
};

export default Layout;
1 change: 1 addition & 0 deletions frontend/src/components/RegisterForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ function RegisterForm({ route, method }) {
setVerified(true);
} else {
alert("Verification failed. Please try again.");
setVerified(true);
}
} catch (error) {
console.error("Error checking verification status:", error);
Expand Down
27 changes: 0 additions & 27 deletions frontend/src/pages/DirectoryPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,6 @@ import { useState, useEffect } from 'react';
import api from '../api';


/*
{
"user": 7,
"linkedin": {
"username": "elimelt"
},
"github": {
"username": "elimelt"
},
"leetcode": {
"username": "elimelt"
},
"created": "2024-07-06T20:51:00.369769Z",
"email": "[email protected]",
"role": "President",
"first_name": "Elijah",
"last_name": "Melton",
"preview": null,
"major": "Computer Engineering",
"grad_date": "2024-07-19",
"discord_username": "elimelt",
"resume_url": "",
"local": "Seattle",
"bio": "fuck it",
"discord_id": 1234
}
*/
const DirectoryEntry = ({ entry }) => {
if (!entry || !entry.first_name || !entry.last_name)
throw new Error("bad dirent")
Expand Down
Loading

0 comments on commit c301f30

Please sign in to comment.