File size: 13,662 Bytes
9d36be7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
// API simulation layer for CommunityConnect Hub
class CommunityAPI {
    constructor() {
        this.baseURL = 'https://api.communityconnect.org';
    }

    // Simulate API delay
    delay(ms = 500) {
        return new Promise(resolve => setTimeout(resolve, ms));
    }

    // Events API
    async getUpcomingEvents(limit = 20) {
        await this.delay();
        return [
            {
                id: 1,
                title: "Community Health Fair",
                date: "2024-01-15",
                time: "10:00 AM - 4:00 PM",
                location: "Community Center",
                description: "Free health screenings, wellness workshops, and nutrition advice for all ages.",
                category: "social",
                attendees: "Open to all"
            },
            {
                id: 2,
                title: "Youth Mentorship Program Kickoff",
                date: "2024-01-20",
                time: "6:00 PM - 8:00 PM",
                location: "Main Hall",
                description: "Join us for the launch of our new youth mentorship initiative.",
                category: "volunteer",
                attendees: "Registration required"
            },
            {
                id: 3,
                title: "Career Development Workshop",
                date: "2024-01-25",
                time: "9:00 AM - 12:00 PM",
                location: "Conference Room A",
                description: "Learn resume writing, interview skills, and job search strategies.",
                category: "workshop",
                attendees: "Limited seats"
            },
            {
                id: 4,
                title: "Annual Fundraising Gala",
                date: "2024-02-10",
                time: "7:00 PM - 11:00 PM",
                location: "Grand Ballroom",
                description: "An evening of celebration and fundraising for our community programs.",
                category: "fundraiser",
                attendees: "Ticketed event"
            }
        ].slice(0, limit);
    }

    // Member spotlights API
    async getMemberSpotlights(limit = 12) {
        await this.delay();
        const members = [
            {
                id: 1,
                name: "Sarah Johnson",
                role: "Community Leader",
                avatar: "https://static.photos/people/200x200/1",
                testimonial: "Being part of this community has transformed my life. The support and opportunities here are incredible.",
                category: "leader",
                rating: 5,
                socialLinks: [
                    { icon: "linkedin", url: "#" },
                    { icon: "twitter", url: "#" }
                ]
            },
            {
                id: 2,
                name: "Michael Chen",
                role: "Volunteer Coordinator",
                avatar: "https://static.photos/people/200x200/2",
                testimonial: "I've found my purpose here helping others. Every day brings new opportunities to make a difference.",
                category: "volunteer",
                rating: 5,
                socialLinks: [
                    { icon: "facebook", url: "#" },
                    { icon: "instagram", url: "#" }
                ]
            },
            {
                id: 3,
                name: "Emily Rodriguez",
                role: "Program Director",
                avatar: "https://static.photos/people/200x200/3",
                testimonial: "Our programs are changing lives daily. I'm proud to be part of such an impactful organization.",
                category: "staff",
                rating: 5,
                socialLinks: [
                    { icon: "linkedin", url: "#" },
                    { icon: "mail", url: "#" }
                ]
            },
            {
                id: 4,
                name: "David Kim",
                role: "Youth Mentor",
                avatar: "https://static.photos/people/200x200/4",
                testimonial: "Mentoring young people is the most rewarding work I've ever done. Seeing them succeed is priceless.",
                category: "volunteer",
                rating: 5
            },
            {
                id: 5,
                name: "Lisa Thompson",
                role: "Board Member",
                avatar: "https://static.photos/people/200x200/5",
                testimonial: "This organization represents the best of our community - collaboration, compassion, and commitment.",
                category: "leader",
                rating: 5
            },
            {
                id: 6,
                name: "James Wilson",
                role: "Operations Manager",
                avatar: "https://static.photos/people/200x200/6",
                testimonial: "Keeping our programs running smoothly is my passion. Behind the scenes work that makes magic happen!",
                category: "staff",
                rating: 4
            }
        ];
        return members.slice(0, limit);
    }

    // Programs API
    async getPrograms() {
        await this.delay();
        return [
            {
                id: 1,
                title: "Youth Mentorship",
                description: "Pair young community members with experienced mentors for guidance and support.",
                icon: "users",
                color: "primary",
                features: [
                    "One-on-one mentoring",
                    "Academic support",
                    "Career guidance",
                    "Personal development workshops"
                ]
            },
            {
                id: 2,
                title: "Career Development",
                description: "Comprehensive job training and career advancement resources.",
                icon: "briefcase",
                color: "secondary",
                features: [
                    "Resume workshops",
                    "Interview preparation",
                    "Job placement assistance",
                    "Skills training programs"
                ]
            },
            {
                id: 3,
                title: "Health & Wellness",
                description: "Programs promoting physical and mental well-being for all ages.",
                icon: "heart",
                color: "primary",
                features: [
                    "Health screenings",
                    "Fitness classes",
                    "Mental health support",
                    "Nutrition workshops"
                ]
            },
            {
                id: 4,
                title: "Senior Services",
                description: "Support and activities tailored for our senior community members.",
                icon: "home",
                color: "secondary",
                features: [
                    "Social gatherings",
                    "Transportation assistance",
                    "Health monitoring",
                    "Educational programs"
                ]
            },
            {
                id: 5,
                title: "Education & Tutoring",
                description: "Academic support and educational enrichment programs.",
                icon: "book-open",
                color: "primary",
                features: [
                    "After-school tutoring",
                    "Adult education classes",
                    "STEM workshops",
                    "Literacy programs"
                ]
            },
            {
                id: 6,
                title: "Community Events",
                description: "Regular events fostering community connection and engagement.",
                icon: "calendar",
                color: "secondary",
                features: [
                    "Seasonal festivals",
                    "Cultural celebrations",
                    "Community clean-ups",
                    "Sports tournaments"
                ]
            }
        ];
    }

    // Services API
    async getServices() {
        await this.delay();
        return [
            {
                id: 1,
                title: "Legal Aid Clinic",
                description: "Free legal consultation services for community members in need.",
                icon: "gavel",
                tags: ["Legal", "Free", "Appointment Required"]
            },
            {
                id: 2,
                title: "Food Bank",
                description: "Emergency food assistance for families and individuals.",
                icon: "shopping-cart",
                tags: ["Food Security", "Emergency", "Weekly Distribution"]
            },
            {
                id: 3,
                title: "Childcare Services",
                description: "Affordable childcare for working parents and guardians.",
                icon: "baby",
                tags: ["Childcare", "Affordable", "Licensed"]
            },
            {
                id: 4,
                title: "Transportation Services",
                description: "Transportation assistance for medical appointments and community events.",
                icon: "truck",
                tags: ["Transport", "Medical", "Senior Focus"]
            }
        ];
    }

    // Resources API
    async getResources() {
        await this.delay();
        return [
            {
                id: 1,
                title: "Community Resource Guide",
                description: "Comprehensive guide to all local services and support systems.",
                type: "guides",
                featured: true,
                tags: ["Guide", "Resource", "Local"],
                downloads: 1240,
                date: "2024-01-10"
            },
            {
                id: 2,
                title: "Resume Template Pack",
                description: "Professional resume templates for various industries and experience levels.",
                type: "templates",
                featured: true,
                tags: ["Resume", "Job Search", "Career"],
                downloads: 890,
                date: "2024-01-08"
            },
            {
                id: 3,
                title: "Budget Planning Worksheet",
                description: "Interactive worksheet for personal and family budget planning.",
                type: "templates",
                tags: ["Finance", "Planning", "Budget"],
                downloads: 567,
                date: "2024-01-05"
            },
            {
                id: 4,
                title: "Volunteer Training Videos",
                description: "Video series on effective volunteering and community engagement.",
                type: "videos",
                featured: true,
                tags: ["Training", "Volunteer", "Video"],
                downloads: 432,
                date: "2024-01-03"
            },
            {
                id: 5,
                title: "Health Information Packet",
                description: "Important health resources and wellness information.",
                type: "documents",
                tags: ["Health", "Wellness", "Information"],
                downloads: 780,
                date: "2024-01-02"
            },
            {
                id: 6,
                title: "Youth Activity Guide",
                description: "Fun and educational activities for children and teens.",
                type: "guides",
                tags: ["Youth", "Activities", "Education"],
                downloads: 654,
                date: "2023-12-28"
            }
        ];
    }

    // Success Stories API
    async getSuccessStories() {
        await this.delay();
        return [
            {
                id: 1,
                name: "Maria Garcia",
                role: "Program Graduate",
                avatar: "https://static.photos/people/200x200/7",
                story: "The career development program helped me land my dream job. I'm now financially independent and giving back to the community.",
                achievement: "Secured Management Position"
            },
            {
                id: 2,
                name: "Robert Taylor",
                role: "Youth Program Participant",
                avatar: "https://static.photos/people/200x200/8",
                story: "The mentorship program changed my life. My mentor guided me through college applications and scholarship opportunities.",
                achievement: "Full Scholarship Winner"
            },
            {
                id: 3,
                name: "Amanda Lee",
                role: "Volunteer of the Year",
                avatar: "https://static.photos/people/200x200/9",
                story: "Volunteering here gave me purpose. I've helped organize over 20 events and mentored 15 young people this year alone.",
                achievement: "500+ Volunteer Hours"
            }
        ];
    }

    // Form submission APIs
    async processDonation(donationData) {
        await this.delay();
        console.log('Processing donation:', donationData);
        // In a real implementation, this would send data to a backend server
        return { success: true, message: 'Donation processed successfully' };
    }

    async submitGetInvolvedForm(formData) {
        await this.delay();
        console.log('Submitting involvement form:', formData);
        // In a real implementation, this would save to a database and trigger notifications
        return { success: true, message: 'Form submitted successfully' };
    }
}

// Initialize API
const api = new CommunityAPI();