Skip to content

Commit fab22fa

Browse files
committed
Prepare for Vercel deployment
1 parent 62167d0 commit fab22fa

6 files changed

Lines changed: 116 additions & 24 deletions

File tree

USER_CREDENTIALS.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# User Login Credentials
2+
3+
## Admin Account
4+
- **Email:** brocode@gmail.com
5+
- **Username:** brocode
6+
- **Password:** admin@brocode
7+
- **Role:** Admin
8+
9+
## Regular Users
10+
11+
### Dhanush
12+
- **Phone/Username:** dhanush / 9994323520
13+
- **Password:** dhanush123
14+
15+
### Godwin
16+
- **Phone/Username:** godwin / 8903955341
17+
- **Password:** godwin123
18+
19+
### Tharun
20+
- **Phone/Username:** tharun / 9345624112
21+
- **Password:** tharun123
22+
23+
### Sanjay
24+
- **Phone/Username:** sanjay / 9865703667
25+
- **Password:** sanjay123
26+
27+
### Soundar
28+
- **Phone/Username:** soundar / 9566686921
29+
- **Password:** soundar123
30+
31+
### Jagadeesh
32+
- **Phone/Username:** jagadeesh / 6381038172
33+
- **Password:** jagadeesh123
34+
35+
### Ram
36+
- **Phone/Username:** ram / 7826821130
37+
- **Password:** ram123
38+
39+
### Lingesh
40+
- **Phone/Username:** lingesh
41+
- **Password:** lingesh123
42+
43+
## Login Methods
44+
45+
You can login using:
46+
- Email address
47+
- Phone number
48+
- Username
49+
50+
All users can use any of these identifiers along with their password to login.

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
background-color: #6a6a6a;
3535
}
3636
</style>
37-
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyAdSl7TDOGaI5burDEglm8UdTsHZmhmfF4&libraries=marker,places" defer></script>
37+
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyC3CGsazjI6MuH2wCBO5m5AADSbahrg8yI&libraries=marker,places" defer></script>
3838
<script type="importmap">
3939
{
4040
"imports": {

pages/HomePage.tsx

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,9 @@ const HomePage: React.FC = () => {
236236
latitude: 37.7749,
237237
longitude: -122.4194,
238238
});
239-
fetchData();
239+
240+
// Refresh data to show the new spot
241+
await fetchData();
240242
} catch (error: any) {
241243
console.error("Failed to create spot:", error);
242244
if (error.message?.includes('does not exist') || error.message?.includes('relation')) {
@@ -257,10 +259,11 @@ const HomePage: React.FC = () => {
257259
) => {
258260
try {
259261
await invitationService.updateInvitationStatus(invitationId, status);
260-
// Real-time subscription will update the UI automatically
261-
} catch (error) {
262+
// Refresh data to show updated status immediately
263+
await fetchData();
264+
} catch (error: any) {
262265
console.error("Failed to update RSVP:", error);
263-
alert("Failed to update RSVP. Please try again.");
266+
alert(`Failed to update RSVP: ${error.message || 'Please try again.'}`);
264267
}
265268
};
266269

@@ -331,6 +334,33 @@ const HomePage: React.FC = () => {
331334
<Card className="p-20 text-center">No Active Spot</Card>
332335
) : (
333336
<>
337+
{/* SPOT DETAILS */}
338+
<Card>
339+
<div className="space-y-4">
340+
<div>
341+
<h2 className="text-2xl font-bold text-indigo-400 mb-2">{spot.location}</h2>
342+
<p className="text-zinc-400">
343+
{new Date(spot.date).toLocaleDateString('en-US', {
344+
weekday: 'long',
345+
year: 'numeric',
346+
month: 'long',
347+
day: 'numeric'
348+
})} at {spot.timing}
349+
</p>
350+
</div>
351+
{spot.description && (
352+
<div>
353+
<h3 className="text-sm font-bold text-zinc-500 uppercase mb-2">Description</h3>
354+
<p className="text-zinc-300">{spot.description}</p>
355+
</div>
356+
)}
357+
<div className="flex items-center gap-4 text-sm">
358+
<span className="text-zinc-400">Budget:</span>
359+
<span className="font-bold text-white">${spot.budget} / person</span>
360+
</div>
361+
</div>
362+
</Card>
363+
334364
<Card className="h-[350px] p-0 overflow-hidden">
335365
<div ref={mapRef} className="w-full h-full" />
336366
</Card>

services/database.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,16 @@ import { Spot, Invitation, Payment, InvitationStatus, PaymentStatus, UserProfile
88
export const spotService = {
99
// Get upcoming spot (date >= today)
1010
async getUpcomingSpot(): Promise<Spot | null> {
11-
const today = new Date().toISOString().split('T')[0];
11+
const now = new Date();
12+
const today = now.toISOString().split('T')[0];
1213

1314
const { data, error } = await supabase
1415
.from('spots')
1516
.select('*')
1617
.gte('date', today)
1718
.order('date', { ascending: true })
1819
.limit(1)
19-
.single();
20+
.maybeSingle();
2021

2122
if (error) {
2223
if (error.code === 'PGRST116') {
@@ -245,12 +246,15 @@ export const invitationService = {
245246
): Promise<void> {
246247
const { error } = await supabase
247248
.from('invitations')
248-
.update({ status })
249+
.update({
250+
status,
251+
updated_at: new Date().toISOString()
252+
})
249253
.eq('id', invitationId);
250254

251255
if (error) {
252256
console.error('Error updating invitation status:', error);
253-
throw error;
257+
throw new Error(`Failed to update RSVP: ${error.message}`);
254258
}
255259
},
256260

services/mockApi.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ let USERS_DB: Record<string, UserProfile> = {
3838
admin: {
3939
id: "admin",
4040
name: "Ram",
41-
username: "ramvj2005",
42-
email: "ramvj2005@gmail.com",
41+
username: "brocode",
42+
email: "brocode@gmail.com",
4343
phone: "7826821130",
44-
password: "ramkumar",
44+
password: "admin@brocode",
4545
role: UserRole.ADMIN,
4646
location: "Attibele",
4747
profile_pic_url: DEFAULT_AVATARS[0],
@@ -52,6 +52,7 @@ let USERS_DB: Record<string, UserProfile> = {
5252
name: "Dhanush",
5353
username: "dhanush",
5454
phone: "9994323520",
55+
password: "dhanush123",
5556
role: UserRole.USER,
5657
location: "Attibele",
5758
profile_pic_url: DEFAULT_AVATARS[1],
@@ -62,6 +63,7 @@ let USERS_DB: Record<string, UserProfile> = {
6263
name: "Godwin",
6364
username: "godwin",
6465
phone: "8903955341",
66+
password: "godwin123",
6567
role: UserRole.USER,
6668
location: "Attibele",
6769
profile_pic_url: DEFAULT_AVATARS[2],
@@ -72,6 +74,7 @@ let USERS_DB: Record<string, UserProfile> = {
7274
name: "Tharun",
7375
username: "tharun",
7476
phone: "9345624112",
77+
password: "tharun123",
7578
role: UserRole.USER,
7679
location: "Attibele",
7780
profile_pic_url: DEFAULT_AVATARS[3],
@@ -82,6 +85,7 @@ let USERS_DB: Record<string, UserProfile> = {
8285
name: "Sanjay",
8386
username: "sanjay",
8487
phone: "9865703667",
88+
password: "sanjay123",
8589
role: UserRole.USER,
8690
location: "Attibele",
8791
profile_pic_url: DEFAULT_AVATARS[0],
@@ -92,6 +96,7 @@ let USERS_DB: Record<string, UserProfile> = {
9296
name: "Soundar",
9397
username: "soundar",
9498
phone: "9566686921",
99+
password: "soundar123",
95100
role: UserRole.USER,
96101
location: "Attibele",
97102
profile_pic_url: DEFAULT_AVATARS[1],
@@ -102,6 +107,7 @@ let USERS_DB: Record<string, UserProfile> = {
102107
name: "Jagadeesh",
103108
username: "jagadeesh",
104109
phone: "6381038172",
110+
password: "jagadeesh123",
105111
role: UserRole.USER,
106112
location: "Attibele",
107113
profile_pic_url: DEFAULT_AVATARS[2],
@@ -112,6 +118,7 @@ let USERS_DB: Record<string, UserProfile> = {
112118
name: "Ram",
113119
username: "ram",
114120
phone: "7826821130",
121+
password: "ram123",
115122
role: UserRole.USER,
116123
location: "Attibele",
117124
profile_pic_url: DEFAULT_AVATARS[3],
@@ -122,6 +129,7 @@ let USERS_DB: Record<string, UserProfile> = {
122129
name: "Lingesh",
123130
username: "lingesh",
124131
phone: "",
132+
password: "lingesh123",
125133
role: UserRole.USER,
126134
location: "Attibele",
127135
profile_pic_url: DEFAULT_AVATARS[0],

supabase_migration_clean.sql

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -206,10 +206,10 @@ INSERT INTO profiles (id, name, username, email, phone, password, role, location
206206
VALUES (
207207
'00000000-0000-0000-0000-000000000001',
208208
'Ram',
209-
'ramvj2005',
210-
'ramvj2005@gmail.com',
209+
'brocode',
210+
'brocode@gmail.com',
211211
'7826821130',
212-
'ramkumar',
212+
'admin@brocode',
213213
'admin',
214214
'Attibele',
215215
true
@@ -225,16 +225,16 @@ ON CONFLICT (id) DO UPDATE SET
225225
is_verified = EXCLUDED.is_verified;
226226

227227
-- Insert other users
228-
INSERT INTO profiles (id, name, username, phone, role, location, is_verified)
228+
INSERT INTO profiles (id, name, username, phone, password, role, location, is_verified)
229229
VALUES
230-
('00000000-0000-0000-0000-000000000002', 'Dhanush', 'dhanush', '9994323520', 'user', 'Attibele', true),
231-
('00000000-0000-0000-0000-000000000003', 'Godwin', 'godwin', '8903955341', 'user', 'Attibele', true),
232-
('00000000-0000-0000-0000-000000000004', 'Tharun', 'tharun', '9345624112', 'user', 'Attibele', true),
233-
('00000000-0000-0000-0000-000000000005', 'Sanjay', 'sanjay', '9865703667', 'user', 'Attibele', true),
234-
('00000000-0000-0000-0000-000000000006', 'Soundar', 'soundar', '9566686921', 'user', 'Attibele', true),
235-
('00000000-0000-0000-0000-000000000007', 'Jagadeesh', 'jagadeesh', '6381038172', 'user', 'Attibele', true),
236-
('00000000-0000-0000-0000-000000000008', 'Ram', 'ram', '7826821130', 'user', 'Attibele', true),
237-
('00000000-0000-0000-0000-000000000009', 'Lingesh', 'lingesh', '', 'user', 'Attibele', true)
230+
('00000000-0000-0000-0000-000000000002', 'Dhanush', 'dhanush', '9994323520', 'dhanush123', 'user', 'Attibele', true),
231+
('00000000-0000-0000-0000-000000000003', 'Godwin', 'godwin', '8903955341', 'godwin123', 'user', 'Attibele', true),
232+
('00000000-0000-0000-0000-000000000004', 'Tharun', 'tharun', '9345624112', 'tharun123', 'user', 'Attibele', true),
233+
('00000000-0000-0000-0000-000000000005', 'Sanjay', 'sanjay', '9865703667', 'sanjay123', 'user', 'Attibele', true),
234+
('00000000-0000-0000-0000-000000000006', 'Soundar', 'soundar', '9566686921', 'soundar123', 'user', 'Attibele', true),
235+
('00000000-0000-0000-0000-000000000007', 'Jagadeesh', 'jagadeesh', '6381038172', 'jagadeesh123', 'user', 'Attibele', true),
236+
('00000000-0000-0000-0000-000000000008', 'Ram', 'ram', '7826821130', 'ram123', 'user', 'Attibele', true),
237+
('00000000-0000-0000-0000-000000000009', 'Lingesh', 'lingesh', '', 'lingesh123', 'user', 'Attibele', true)
238238
ON CONFLICT (id) DO UPDATE SET
239239
name = EXCLUDED.name,
240240
username = EXCLUDED.username,

0 commit comments

Comments
 (0)