Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
b0806b4
frontend basic setup
bob-th May 30, 2025
25ad24b
Basic backend setup
bob-th May 30, 2025
88a5d03
Merge pull request #2 from UTSC-CSCC01-Software-Engineering-I/frontend
bob-th May 31, 2025
2c44167
Merge pull request #3 from UTSC-CSCC01-Software-Engineering-I/backend
bob-th May 31, 2025
84fcc60
add backend 'npm run start'
bob-th Jun 1, 2025
388aba1
Merge pull request #4 from UTSC-CSCC01-Software-Engineering-I/backend
wben1998 Jun 1, 2025
7539726
controller, model, routes files for backend
bob-th Jun 7, 2025
0979af2
Add Basic supabase authentication
Eyang0612 Jun 10, 2025
ef59f49
feed skeleton
bob-th Jun 10, 2025
22af4dc
feed skeleton
bob-th Jun 10, 2025
8cf972a
Merge pull request #5 from UTSC-CSCC01-Software-Engineering-I/feature…
Eyang0612 Jun 13, 2025
9e98aa9
Merge branch 'develop' of https://github.com/UTSC-CSCC01-Software-Eng…
bob-th Jun 13, 2025
a7573c0
add override to fix legacy dep error. See https://github.com/react-na…
bob-th Jun 13, 2025
ec1bbdd
moved components from base component directory to components/feed
bob-th Jun 13, 2025
26992cc
basic feed layout. updated index to have SafeAreaView
bob-th Jun 14, 2025
587d1ae
add database connection in backend, update gitignore
wben1998 Jun 14, 2025
84ba28a
add private key
wben1998 Jun 14, 2025
5d8017b
Merge database_connection into my feature branch
Jun 14, 2025
4857e7c
Merge pull request #6 from UTSC-CSCC01-Software-Engineering-I/databas…
wben1998 Jun 14, 2025
3b6d953
Merge branch 'develop' into feature/feed
bob-th Jun 14, 2025
1aae7ab
Merge branch 'develop' into feature/feed
bob-th Jun 14, 2025
dbcb232
Merge branch 'develop' into feature/club-page-student-view
Jun 14, 2025
074b7f3
Add Sign Up/Login Logic
Eyang0612 Jun 14, 2025
d204fb0
add create event form
wben1998 Jun 14, 2025
5c7c74e
Add Login/SignUp logic for club/user
Eyang0612 Jun 14, 2025
bb11fcf
Merge pull request #7 from UTSC-CSCC01-Software-Engineering-I/feature…
Eyang0612 Jun 14, 2025
c0f4b63
Set up cors
stevenguyen00 Jun 14, 2025
f56e034
add event page
wben1998 Jun 14, 2025
a5f8c6f
merge develop
wben1998 Jun 14, 2025
f838656
add redirect to home after login, add event page
wben1998 Jun 15, 2025
6bc94ed
Club Page Done
Jun 15, 2025
0c9d3c6
Club Page Done
Jun 15, 2025
0e0c223
Merge pull request #8 from UTSC-CSCC01-Software-Engineering-I/feat/ev…
wben1998 Jun 15, 2025
7b4646d
Club list implemented
Jun 15, 2025
82fa8b5
Added the ability to edit club page infomation
stevenguyen00 Jun 15, 2025
7d67879
Merge branch 'develop' into feature/club_page
wben1998 Jun 15, 2025
d3be30e
Merge pull request #10 from UTSC-CSCC01-Software-Engineering-I/featur…
stevenguyen00 Jun 15, 2025
d575a24
fix header issue
wben1998 Jun 15, 2025
9eebc57
re-add edit club details
wben1998 Jun 15, 2025
cf52434
Backend Updated
Jun 15, 2025
25801db
merge with develop. Adds auth, backend, etc
bob-th Jun 15, 2025
c9b7c41
Merge branch 'develop' into feature/club-page-student-view
stevenguyen00 Jun 15, 2025
f312890
Merge pull request #11 from UTSC-CSCC01-Software-Engineering-I/featur…
stevenguyen00 Jun 15, 2025
a604bce
Merge branch 'develop' into feature/feed
bob-th Jun 15, 2025
a0f2c83
updated api endpoint due to conflicts with other endpoints
stevenguyen00 Jun 15, 2025
2055183
Merge pull request #13 from UTSC-CSCC01-Software-Engineering-I/bugfix…
wben1998 Jun 15, 2025
551351e
Update eslint.config.js
wben1998 Jun 15, 2025
95804a3
Update tsconfig.json
wben1998 Jun 15, 2025
6bd9d51
Feed now gets from backend and links to club page.
bob-th Jun 15, 2025
1f7e369
fix scrolling onfeed
bob-th Jun 15, 2025
291c390
Merge pull request #14 from UTSC-CSCC01-Software-Engineering-I/featur…
bob-th Jun 15, 2025
a9aee7c
club's events page
bob-th Jun 15, 2025
036bbaf
Merge pull request #15 from UTSC-CSCC01-Software-Engineering-I/featur…
bob-th Jun 15, 2025
e86b474
Fix branch merge conflict
Eyang0612 Jun 15, 2025
0bc84aa
Merge pull request #17 from UTSC-CSCC01-Software-Engineering-I/bugfix…
Eyang0612 Jun 15, 2025
4914375
add dashboard to header (#16)
bob-th Jun 15, 2025
98599a4
Fix branch merge conflict #2
Eyang0612 Jun 15, 2025
fb12e44
Merge pull request #18 from UTSC-CSCC01-Software-Engineering-I/bugfix…
Eyang0612 Jun 15, 2025
90448e4
fix path
wben1998 Jun 15, 2025
112009a
add redirect to home after log out
wben1998 Jun 15, 2025
7b51083
Feature/confirm edit club button (#19)
bob-th Jun 15, 2025
3d37aa9
Update eslint.config.js
wben1998 Jun 15, 2025
1a9209f
Update eslint.config.js
wben1998 Jun 15, 2025
0472b8e
Update eslint.config.js
wben1998 Jun 15, 2025
7c48719
add lint and formater to npm
wben1998 Jun 15, 2025
a77c703
retry modifying eslint.config.js
wben1998 Jun 15, 2025
91c8f37
remove eslintignore
wben1998 Jun 15, 2025
23b3457
add prettier to backend
wben1998 Jun 15, 2025
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ with-nextjs/out

# Websockets
*/backend/.env
backend/.env

# local env files
*/.env*.local
Expand Down
5 changes: 5 additions & 0 deletions backend/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"singleQuote": true,
"semi": true,
"trailingComma": "es5"
}
88 changes: 88 additions & 0 deletions backend/controllers/clubsController.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
import supabaseConnection from '../database.js';
import clubs from '../models/clubs.js';

const clubsController = {
getAllClubs: async (req, res) => {
try {
const data = await clubs.getAllClubs();
res.json(data);
} catch (err) {
res.status(500).json({ error: err.message });
}
},
getClubById: async (req, res) => {
try {
if (!req.params?.id) {
return res.status(400).json({ message: 'Club ID is required' });
}
const data = await clubs.getClubById(req.params.id);
if (!data) {
return res.status(404).json({ message: 'Club not found' });
}
res.json(data);
} catch (error) {
console.error('Error fetching clubs info:', error);
res.status(500).json({ message: 'Internal Server Error' });
}
},
getClubByAccountId: async (req, res) => {
try {
if (!req.params?.id) {
return res.status(400).json({ message: 'Club ID is required' });
}
const data = await clubs.getClubByAccountId(req.params.id);
if (!data) {
return res.status(404).json({ message: 'Club not found' });
}
res.json(data);
} catch (error) {
console.error('Error fetching clubs info:', error);
res.status(500).json({ message: 'Internal Server Error' });
}
},
updateClub: async (req, res) => {
try {
if (!req.params?.id) {
return res.status(400).json({ message: 'Club ID is required' });
}
const data = {};
const allowedFields = [
'name',
'location',
'campus',
'category',
'description',
];
for (const field of allowedFields) {
if (req.body[field] !== undefined) {
data[field] = req.body[field];
}
}
await clubs.updateClubInfo(req.params.id, data);
res
.status(200)
.json({ message: 'Club information updated successfully', data });
} catch (error) {
console.error('Error updating club info:', error);
res.status(500).json({ message: 'Internal Server Error' });
}
},

getEventsClub: async (req, res) => {
try {
const clubId = req.params?.id;
if (!clubId) {
return res.status(400).json({ message: 'Club ID is required' });
}
const events = await supabaseConnection
.from('events')
.select('*')
.eq('hostClubId', clubId);
res.status(200).json(events);
} catch (error) {
console.error('Error updating club info:', error);
res.status(500).json({ message: 'Internal Server Error' });
}
},
};
export default clubsController;
51 changes: 51 additions & 0 deletions backend/controllers/eventsController.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import supabaseConnection from '../database.js';

export const createEvent = async (req, res) => {
if (req.method !== 'POST') {
return res.status(405).json({ error: 'Method Not Allowed' });
}

const {
title,
description,
hostClubId,
startTimestamp,
endTimestamp,
event_status,
} = req.body;

const { data, error } = await supabaseConnection.from('events').insert([
{
title,
description,
hostClubId: '4', // Hardcoded for now
startTimestamp,
endTimestamp,
event_status,
},
]);

if (error) {
return res.status(500).json({ error: error.message });
}

return res.status(201).json({ data });
};

export const getEvents = async (req, res) => {
const { data, error } = await supabaseConnection.from('events').select(`
*,
hostClub: clubs (
id,
name,
description,
verified
)
`);

if (error) {
return res.status(500).json({ error: error.message });
}

return res.json(data);
};
Empty file.
9 changes: 9 additions & 0 deletions backend/database.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import 'dotenv/config';
import { createClient } from '@supabase/supabase-js';

const supabaseConnection = createClient(
process.env.EXPO_PUBLIC_SUPABASE_URL,
process.env.PRIVATE_API_KEY
);

export default supabaseConnection;
25 changes: 25 additions & 0 deletions backend/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// ESLint config for Node.js backend (CommonJS/ESM)
export default [
{
files: ['**/*.js'],
languageOptions: {
ecmaVersion: 2022,
sourceType: 'module',
globals: {
require: 'readonly',
module: 'readonly',
__dirname: 'readonly',
process: 'readonly',
console: 'readonly',
},
},
rules: {
'no-unused-vars': 'warn',
'no-undef': 'error',
semi: ['error', 'always'],
quotes: ['error', 'single'],
eqeqeq: 'warn',
},
ignores: ['node_modules/*', 'dist/*'],
},
];
44 changes: 44 additions & 0 deletions backend/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import express from 'express';
import cors from 'cors';
import supabaseConnection from './database.js';
import clubsRouter from './routes/clubsRouter.js';
import { eventsRouter } from './routes/eventsRouter.js';

const app = express();
const PORT = 3000;

app.use(express.json());

app.get('/', (req, res) => {
res.send('API running');
});

// Middleware
const corsConfig = {
origin: 'http://localhost:8081',
credentials: true,
};

app.use(cors(corsConfig));

app.use('/api/events', eventsRouter);
app.use('/api/clubs', clubsRouter);

const testSupabase = async () => {
console.log('Testing Supabase connection...');

const { data, error } = await supabaseConnection.from('Test').select('*');

if (error) {
console.error('Supabase error:', error.message);
} else if (!data || data.length === 0) {
console.warn('No data found in Test table.');
} else {
console.log('Data from Supabase:', data);
}
};

testSupabase();
app.listen(PORT, () => {
console.log(`Server is running on port ${PORT}`);
});
40 changes: 40 additions & 0 deletions backend/models/clubs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import supabaseConnection from '../database.js';

const clubModel = {
getAllClubs: async () => {
const { data, error } = await supabaseConnection.from('clubs').select('*');
if (error) throw new Error(error.message);
return data || [];
},
getClubById: async (id) => {
const { data, error } = await supabaseConnection
.from('clubs')
.select('*')
.eq('id', id)
.maybeSingle();
if (error) throw new Error(error.message);
return data;
},
getClubByAccountId: async (accountId) => {
const { data, error } = await supabaseConnection
.from('clubs')
.select('*')
.eq('accountId', accountId)
.maybeSingle();
if (error) throw new Error(error.message);
return data;
},
updateClubInfo: async (id, updateData) => {
const { data, error } = await supabaseConnection
.from('clubs')
.update(updateData)
.eq('accountId', id);

if (error) {
throw new Error(error.message);
}
return data;
},
};

export default clubModel;
Empty file added backend/models/user.js
Empty file.
28 changes: 28 additions & 0 deletions backend/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"name": "backend",
"version": "1.0.0",
"main": "index.js",
"scripts": {
"start": "node index.js",
"test": "echo \"Error: no test specified\" && exit 1",
"lint": "eslint . --config eslint.config.mjs --fix",
"format": "prettier --write ."
},
"type": "module",
"keywords": [],
"author": "",
"license": "ISC",
"description": "",
"dependencies": {
"@supabase/supabase-js": "^2.50.0",
"cors": "^2.8.5",
"dotenv": "^16.5.0",
"express": "^5.1.0"
},
"devDependencies": {
"@types/next": "^8.0.7",
"eslint": "^9.29.0",
"next": "^15.3.3",
"prettier": "^3.5.3"
}
}
12 changes: 12 additions & 0 deletions backend/routes/clubsRouter.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { Router } from 'express';
import clubsController from '../controllers/clubsController.js';

const router = Router();

router.get('/', clubsController.getAllClubs);
router.get('/me/:id', clubsController.getClubByAccountId);
router.get('/:id', clubsController.getClubById);
router.patch('/:id', clubsController.updateClub);
router.get('/:id/events', clubsController.getEventsClub);

export default router;
7 changes: 7 additions & 0 deletions backend/routes/eventsRouter.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import express from 'express';
import { createEvent, getEvents } from '../controllers/eventsController.js';

export const eventsRouter = express.Router();

eventsRouter.post('/createEvent', createEvent);
eventsRouter.get('/', getEvents);
Empty file added backend/routes/usersRouter.js
Empty file.
13 changes: 13 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import js from "@eslint/js";
import globals from "globals";
import tseslint from "typescript-eslint";
import pluginReact from "eslint-plugin-react";
import { defineConfig } from "eslint/config";


export default defineConfig([
{ files: ["**/*.{js,mjs,cjs,ts,mts,cts,jsx,tsx}"], plugins: { js }, extends: ["js/recommended"] },
{ files: ["**/*.{js,mjs,cjs,ts,mts,cts,jsx,tsx}"], languageOptions: { globals: globals.browser } },
tseslint.configs.recommended,
pluginReact.configs.flat.recommended,
]);
41 changes: 41 additions & 0 deletions frontend/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Learn more https://docs.github.com/en/get-started/getting-started-with-git/ignoring-files

# dependencies
node_modules/

# Expo
.expo/
dist/
web-build/
expo-env.d.ts

# Native
.kotlin/
*.orig.*
*.jks
*.p8
*.p12
*.key
*.mobileprovision

# Metro
.metro-health-check*

# debug
npm-debug.*
yarn-debug.*
yarn-error.*

# macOS
.DS_Store
*.pem

# local env files
.env*.local
.env
# typescript
*.tsbuildinfo

.vscode

app-example
5 changes: 5 additions & 0 deletions frontend/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"singleQuote": true,
"semi": true,
"trailingComma": "es5"
}
Loading