Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
4c9490a
Update package-lock.json
jktieh Nov 5, 2025
2e43270
Create Navbar.tsx
jktieh Nov 5, 2025
bd888ab
Create Hero.tsx
jktieh Nov 5, 2025
5db1770
Create Footer.tsx
jktieh Nov 5, 2025
78de9da
Rename to QRCode.tsx
jktieh Nov 5, 2025
f877a3f
Create Home.tsx
jktieh Nov 5, 2025
fe3c303
Create Card.tsx
jktieh Nov 5, 2025
a35e3e8
Update App.tsx
jktieh Nov 5, 2025
aa42265
Update index.html
jktieh Nov 5, 2025
4004201
Update Footer.tsx
jktieh Nov 5, 2025
48f1658
Update Hero.tsx
jktieh Nov 5, 2025
c228e72
Update Navbar.tsx
jktieh Nov 5, 2025
5a4e276
Update main.tsx
jktieh Nov 5, 2025
0408e96
Update Home.tsx
jktieh Nov 6, 2025
1509c7c
Update code structure for easy to maintain
lnqminh3003 Nov 7, 2025
cdf732c
Merge branch 'frontend/home-page' into frontend/qrcode
lnqminh3003 Nov 7, 2025
80f0d27
Added some basic changes nend to implement route fixes
rodolfo-gp Nov 7, 2025
17d11da
Updated the user data model to include passwords.
rodolfo-gp Nov 16, 2025
f09713a
Added some basic changes nend to implement route fixes
rodolfo-gp Nov 7, 2025
9559808
Updated the user data model to include passwords.
rodolfo-gp Nov 16, 2025
f98488c
Merge branch 'feature/STR-56-DataModels' of https://github.com/techst…
rodolfo-gp Nov 16, 2025
620232b
Updated homepage, added QR code component, about us section, redesign…
jktieh Nov 16, 2025
cf60e0f
Update Navbar.tsx
jktieh Nov 16, 2025
9fbcba0
Update Navbar.tsx
jktieh Nov 16, 2025
53b233f
Added some basic changes nend to implement route fixes
rodolfo-gp Nov 7, 2025
faa2fe2
Merge branch 'recover-latest' into feature/STR-56-DataModels
rodolfo-gp Nov 27, 2025
90554cf
setup jwt utility functions
rxmox Nov 27, 2025
9d33f6d
updating json files
rxmox Nov 27, 2025
69ca14d
started auth middleware
rxmox Nov 28, 2025
0d5f7c8
fixing conflicts
rxmox Nov 28, 2025
646e08b
Merge pull request #30 from techstartucalgary/feature/STR-56-DataModels
rxmox Nov 28, 2025
0afad34
Deleted unused components, updated Navbar
jktieh Dec 4, 2025
8511c2b
created Auth middleware
rxmox Dec 5, 2025
cd7581d
refactor models
lnqminh3003 Jan 13, 2026
3959463
join event api for guess and registered user
lnqminh3003 Jan 13, 2026
355108e
websocket hosting event
lnqminh3003 Jan 13, 2026
65a5aa0
small change
lnqminh3003 Jan 13, 2026
23470c6
remove unused log
lnqminh3003 Jan 13, 2026
8d4b7c1
Complete JWT token implementation (TICKET-17 & TICKET-18)
rxmox Jan 15, 2026
14211f2
Merge pull request #38 from techstartucalgary/feature/STR-96-jwt-token
lnqminh3003 Jan 16, 2026
2decf94
Merge branch 'feature/STR-96-jwt-token' into big-update-join-event-ap…
lnqminh3003 Jan 16, 2026
6a01abf
add check for user existence
lnqminh3003 Jan 17, 2026
434ae7f
Add JSDoc for all event functions
lnqminh3003 Jan 18, 2026
53d3331
Protect event functions, add more rules to protect event
lnqminh3003 Jan 18, 2026
b0f6671
JWT improvements
rxmox Jan 19, 2026
314891e
Merge branch 'backend' into big-update-join-event-api-and-refactor-mo…
rxmox Jan 19, 2026
c350eb1
Add JWT token to signup response
rxmox Jan 19, 2026
a2a7bbf
Remove react-router-dom from backend dependencies
rxmox Jan 19, 2026
8ce3b8d
Merge pull request #36 from techstartucalgary/big-update-join-event-a…
lnqminh3003 Jan 19, 2026
1dd3dc3
Merge branch 'frontend/qrcode' into frontend/home-page
lnqminh3003 Jan 19, 2026
91ac597
add vercel
lnqminh3003 Jan 19, 2026
9cb24a2
Merge branch 'backend' into frontend/home-page
lnqminh3003 Jan 20, 2026
6745299
Update the real time websocket for Frontend
lnqminh3003 Jan 20, 2026
bfce025
"STR-100 LogIn and SignUp logic for a host"
jktieh Jan 23, 2026
580b4d6
Added .env file to run our Frontend
youssefibrahim3 Jan 23, 2026
56e07a4
Fixed env
Jan 23, 2026
184d2f0
Merge branch 'main' into frontend/home-page
lnqminh3003 Jan 26, 2026
e8c8bf5
Merge branch 'main' into frontend/home-page
lnqminh3003 Jan 26, 2026
8bcbf2a
Merge branch 'frontend/home-page' of github.com:techstartucalgary/Net…
lnqminh3003 Jan 26, 2026
9b68ec2
update gitignore file
lnqminh3003 Jan 26, 2026
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
427 changes: 424 additions & 3 deletions shatter-backend/package-lock.json

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions shatter-backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,21 @@
"description": "",
"dependencies": {
"bcryptjs": "^3.0.3",
"cors": "^2.8.5",
"dotenv": "^17.2.3",
"express": "^5.1.0",
"jsonwebtoken": "^9.0.2",
"mongoose": "^8.19.2",
"socket.io": "^4.8.1",
"zod": "^4.1.12"
},
"devDependencies": {
"@eslint/js": "^9.38.0",
"@types/bcryptjs": "^2.4.6",
"@types/express": "^5.0.5",
"@types/jsonwebtoken": "^9.0.10",
"@types/node": "^24.9.2",
"@types/socket.io": "^3.0.1",
"eslint": "^9.38.0",
"globals": "^16.4.0",
"jiti": "^2.6.1",
Expand Down
14 changes: 14 additions & 0 deletions shatter-backend/src/app.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,30 @@
import express from 'express';
import cors from "cors";

import userRoutes from './routes/user_route'; // these routes define how to handle requests to /api/users
import authRoutes from './routes/auth_routes';
import eventRoutes from './routes/event_routes';

const app = express();

app.use(express.json());

app.use(cors({
origin: "http://localhost:3000",
credentials: true,
}));

app.use((req, _res, next) => {
req.io = app.get('socketio');
next();
});

app.get('/', (_req, res) => {
res.send('Hello');
});

app.use('/api/users', userRoutes);
app.use('/api/auth', authRoutes);
app.use('/api/events', eventRoutes);

export default app;
22 changes: 15 additions & 7 deletions shatter-backend/src/controllers/auth_controller.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
import { Request, Response } from 'express';
import { User } from '../models/user_model';
import { hashPassword, comparePassword } from '../utils/password_hash';
import { generateToken } from '../utils/jwt_utils';

// Email validation regex
const EMAIL_REGEX = /^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/;

/**
* POST /api/auth/signup
* Create new user account
*
*
* @param req.body.name - User's display name
* @param req.body.email - User's email
* @param req.body.password - User's plain text password
* @returns 201 with userId on success
* @returns 201 with userId and JWT token on success
*/
export const signup = async (req: Request, res: Response) => {
try {
Expand Down Expand Up @@ -66,10 +67,14 @@ export const signup = async (req: Request, res: Response) => {
passwordHash
});

// return success
// generate JWT token for the new user
const token = generateToken(newUser._id.toString());

// return success with token
res.status(201).json({
message: 'User created successfully',
userId: newUser._id
userId: newUser._id,
token
});

} catch (err: any) {
Expand Down Expand Up @@ -148,11 +153,14 @@ export const login = async (req: Request, res: Response) => {
user.lastLogin = new Date();
await user.save(); // save the updated user

// 9 - return success
// 9 - generate JWT token for the user
const token = generateToken(user._id.toString());

// 10 - return success with token
res.status(200).json({
message: 'Login successful',
userId: user._id
// TODO: figure out a way to add JWT token here
userId: user._id,
token
});

} catch (err: any) {
Expand Down
Loading
Loading