Skip to content

Commit bae1199

Browse files
committed
incorporate directus as CMS
1 parent 4b0100b commit bae1199

File tree

7 files changed

+79
-11
lines changed

7 files changed

+79
-11
lines changed

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ build/
2525
.env.development.local
2626
.env.test.local
2727
.env.production.local
28-
.env
2928
/.vscode
3029
/vscode
3130
.vscode

backend/.env

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
DISCORD_CLIENT_ID=your-discord-client-id
2+
DISCORD_CLIENT_SECRET=your-discord-client-secret
3+
DISCORD_REDIRECT_URI=https://samgu-nrx.github.io/LuminAI/auth/discord/callback
4+
5+
PROJECT_ID=luminai-bootcamps
6+
PRIVATE_KEY_ID=01099d54ab1e7786f7a6892966bb27e25543712f
7+
PRIVATE_KEY="-----BEGIN PRIVATE KEY-----\nMIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCfUQogwQNdwbA/\n3TYuRZkZmjd84r00VltF2RPUjZqoYHESbtxjkiQkH6wHDs9YnKHNZyrJ89Kr0+DI\n6r1V0w5+VcnQAgMLn5slNDpwe3NhWnvzFya5EJVZmOBF5K6TJGzHtPnXPm1k59zN\n9WQggJOqYORORus5PkwK7VqBHliI1KyjEWCKBYjYo6If3bRT6ZDiu2gMK4v3YCmJ\nBOyIBblcCFVAy6WxDMqV8AqmJnPpKZ5SXBW2PhvxM1NN5FiqhWoe3h6JdZPlTbvD\nge/gXS5//XiAQqSZQbW8DyEs1wEPCu2ufjm3gdfDtSKA5eTKU48n4ABEMM4Vu6rb\nd47+zYuxAgMBAAECggEASRnPMt49ZCy2aWdgL/UhXb0ETtpfBH/HW5JSZgofd7jg\nyRtzJoDs8mJR9d8Wxsr/9xaqbIXjGZKbprUG8TVphhBpDHeP3Cp87qI7WldaxsXU\n7+KkkvAIB1d9OLTIYZ2qCCyDIv9zBITbLOm26q70ko3o0/34eoiaLb1g9LPu3cE2\niGK/1jmbddMVBrZ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n"
8+
CLIENT_EMAIL=firebase-adminsdk-ooddl@luminai-bootcamps.iam.gserviceaccount.com
9+
CLIENT_ID=116588898614403594826
10+
AUTH_URI=https://accounts.google.com/o/oauth2/auth
11+
TOKEN_URI=https://oauth2.googleapis.com/token
12+
AUTH_PROVIDER_X509_CERT_URL=https://www.googleapis.com/oauth2/v1/certs
13+
CLIENT_X509_CERT_URL=https://www.googleapis.com/robot/v1/metadata/x509/firebase-adminsdk-ooddl%40luminai-bootcamps.iam.gserviceaccount.com
14+
UNIVERSE_DOMAIN=googleapis.com

frontend/.env

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
VITE_API_URL='https://manage.redevs.com'
2+
VITE_DISCORD_REDIRECT_URI=https://samgu-nrx.github.io/LuminAI/auth/discord/callback

frontend/src/context/AuthContext.jsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ export const AuthContextProvider = ({ children }) => {
2929
};
3030
}, []);
3131

32-
// const logOut = () => {
33-
// signOut();
34-
// }
32+
const logOut = () => {
33+
signOut(auth);
34+
}
3535

3636
return (
37-
<AuthContext.Provider value={{ googleSignIn }}>
37+
<AuthContext.Provider value={{ googleSignIn, logOut, user}}>
3838
{children}
3939
</AuthContext.Provider>
4040
);

frontend/src/routes/Dashboard.jsx

Whitespace-only changes.

frontend/src/routes/Staff.jsx

+42-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { useEffect } from 'react';
22
import { createFileRoute } from '@tanstack/react-router';
33
import { Helmet } from 'react-helmet-async';
4+
import { getItems } from '../services/directus';
45

56
import AOS from 'aos';
67
import 'aos/dist/aos.css';
@@ -17,39 +18,52 @@ export const Route = createFileRoute('/Staff')({
1718
function Staff() {
1819
const colorMode = getMode();
1920

21+
// TODO: Change to items & setItems to "teamMembers" to use as CMS database
22+
const [items, setItems] = useState([]);
23+
24+
useEffect(() => {
25+
const fetchStaffMembers = async () => {
26+
const data = await getItems('luminai_team_members');
27+
setItems(data.data);
28+
};
29+
30+
fetchStaffMembers();
31+
}, []);
32+
2033
const teamMembers = [
2134
{
2235
name: 'John Doe',
2336
role: 'President',
24-
fact: 'Developed a state-of-the-art NLP model.',
37+
achievement: 'Developed a state-of-the-art NLP model.',
2538
description: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.'
2639
},
2740
{
2841
name: 'Jane Smith',
2942
role: 'Director of Coursework',
30-
fact: 'Specialized in machine learning algorithms.',
43+
achievement: 'Specialized in machine learning algorithms.',
3144
description: 'Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.'
3245
},
3346
{
3447
name: 'Emily Chen',
3548
role: 'Director of Logistics',
36-
fact: 'Organized a statewide coding competition that attracted over 500 participants.',
49+
achievement: 'Organized a statewide coding competition that attracted over 500 participants.',
3750
description: 'Emily is known for her exceptional organizational skills and ability to handle complex logistics with ease. She ensures everything runs smoothly.'
3851
},
3952
{
4053
name: 'Michael Thompson',
4154
role: 'Director of Management',
42-
fact: 'Managed a team of 20 volunteers for a community tech education program.',
55+
achievement: 'Managed a team of 20 volunteers for a community tech education program.',
4356
description: 'Michael\'s leadership and management skills have been instrumental in the success of several community projects, making a significant impact.'
4457
},
4558
{
4659
name: 'Sophia Martinez',
4760
role: 'Director of Mentorship',
48-
fact: 'Created a peer mentoring program that improved academic performance and morale among students.',
61+
achievement: 'Created a peer mentoring program that improved academic performance and morale among students.',
4962
description: 'Sophia is passionate about helping others succeed. Her mentorship program has been a game-changer for many students, providing guidance and support.'
5063
}
5164
];
5265

66+
5367
return (
5468
<div
5569
data-scroll-section
@@ -72,13 +86,35 @@ function Staff() {
7286
className="bg-white bg-opacity-80 p-6 rounded-lg text-center relative group"
7387
data-aos="fade-up"
7488
>
89+
7590
<div className="w-24 h-24 mx-auto mb-4">
7691
<MovingGradient />
7792
</div>
93+
94+
<div className="w-24 h-24 mx-auto mb-4 relative">
95+
{member.photo ? (
96+
<div
97+
className="w-24 h-24 rounded-full border-4"
98+
style={{
99+
borderImage: generateRandomGradient(),
100+
borderImageSlice: 1,
101+
}}
102+
>
103+
<img
104+
src={member.photo}
105+
alt={member.name}
106+
className="w-full h-full rounded-full object-cover"
107+
/>
108+
</div>
109+
) : (
110+
<MovingGradient />
111+
)}
112+
</div>
113+
78114
<h2 className="text-2xl font-bold ">{member.name}</h2>
79115
<div className="transform absolute inset-0 duration-300 transition hover:scale-105 rounded-md bg-white bg-opacity-90 p-6 flex flex-col justify-center items-center opacity-0 group-hover:opacity-100 ">
80116
<p className="text-lg">{member.role}</p>
81-
<p className="text-sm italic">{member.fact}</p>
117+
<p className="text-sm italic">{member.achievement}</p>
82118
<p className="text-gray-600">{member.description}</p>
83119
</div>
84120
</div>

frontend/src/services/directus.js

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import axios from 'axios';
2+
3+
const API_URL = import.meta.env.VITE_API_URL;
4+
5+
const api = axios.create({
6+
baseURL: API_URL,
7+
});
8+
9+
export const getItems = async (collection) => {
10+
try {
11+
const response = await api.get(`/items/${collection}`);
12+
return response.data;
13+
} catch (error) {
14+
console.error('Error fetching items:', error);
15+
throw error;
16+
}
17+
};

0 commit comments

Comments
 (0)