Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
48 changes: 35 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,46 @@
# 🌐 Codeunia

*Codeunia* is a dynamic platform designed to empower developers by keeping them informed and inspired. Stay updated with the latest hackathons, AI breakthroughs, tech blogs, and developer tools — all in one place.
*Codeunia* is a professional developer platform designed to power the modern tech ecosystem. We bring organizations, developers, and innovators together through a unified marketplace for hackathons, events, insights, and tools — all in one place.

## 🚀 Features
## 🚀 Platform Highlights

- 🔍 Discover Upcoming Hackathons
- 🧠 Latest News in Artificial Intelligence & Machine Learning
- ✍ Developer-Focused Blog Posts
- 📅 Event Calendar and Reminders
- 🧰 Curated Tools and Resources for Developers *(Coming Soon)*
- 📬 Newsletter Subscription *(Coming Soon)*
- 📊 Community Polls and Discussions *(Coming Soon)*
* 🏢 **Multi-Company Event Marketplace**
Verified organizations can host, manage, and scale their own hackathons and tech events.

* 🔍 **Discover Global Hackathons**
Stay updated with curated events from top companies and institutions.

* 🧠 **Tech & AI Insights**
Access the latest breakthroughs in AI, ML, startups, and software engineering.

* ✍ **Developer Articles & Blogs**
In-depth writeups from experts, engineers, and industry contributors.

* 📅 **Smart Event Calendar & Reminders**
Never miss an opportunity — get personalized updates and alerts.

* 🎯 **Organization Dashboards**
Complete event lifecycle management: creation, moderation, registrations, analytics, and monetization.

* 📊 **Advanced Analytics for Hosts**
Real-time insights into views, clicks, conversions, and performance trends.

* 🧰 **Developer Tools & Resources** *(Coming Soon)*
Curated utilities and productivity enhancers for engineering teams.

* 📬 **Tech Newsletter** *(Coming Soon)*
Weekly insights for developers and organizations.

---

### ⚠️ Disclaimer
## ⚠️ Intellectual Property Notice

Codeunia operates multiple GitHub organizations for structured development and deployment:

> We do have an official GitHub organization: [github.com/codeunia](https://github.com/codeunia).
> However, due to being a student-led initiative and operating with limited resources (like funds for paid GitHub features), we are currently using [github.com/codeunia-dev](https://github.com/codeunia-dev) to manage our repositories and development.
* **github.com/codeunia** — Official organization
* **github.com/codeunia-dev** — Development & engineering projects

> **All code, assets, and content under both profiles are the intellectual property of Codeunia. Unauthorized use, reproduction, or redistribution is strictly prohibited without written permission.**
**All source code, assets, and content under these organizations are the intellectual property of Codeunia.
Unauthorized use, reproduction, or redistribution is strictly prohibited without prior written approval.**

---
21 changes: 0 additions & 21 deletions SECURITY.md

This file was deleted.

110 changes: 58 additions & 52 deletions app/dashboard/company/[slug]/events/[eventSlug]/edit/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,61 +109,67 @@ export default function EditEventPage() {
}

return (
<div className="space-y-6">
{/* Header */}
<div className="flex items-center justify-between">
<div className="flex items-center gap-4">
<Link href={`/dashboard/company/${companySlug}/events`}>
<Button variant="outline" size="sm">
<ArrowLeft className="h-4 w-4 mr-2" />
Back to Events
</Button>
</Link>
<div>
<h1 className="text-3xl font-bold tracking-tight">Edit Event</h1>
<p className="text-muted-foreground mt-1">
Update your event details
</p>
</div>
<div className="min-h-screen dark:bg-black dark:text-white">
<div className="space-y-6">
{/* Back Button */}
<Link href={`/dashboard/company/${companySlug}/events`}>
<Button variant="ghost" size="sm" className="gap-2">
<ArrowLeft className="h-4 w-4" />
Back to Events
</Button>
</Link>

{/* Header */}
<div>
<h1 className="text-3xl font-bold tracking-tight">Edit Event</h1>
<p className="text-muted-foreground mt-1">
Update your event details
</p>
</div>

{/* Delete Button */}
<AlertDialog>
<AlertDialogTrigger asChild>
<Button variant="outline" className="text-red-600 border-red-600 hover:bg-red-50">
<Trash2 className="h-4 w-4 mr-2" />
Delete Event
</Button>
</AlertDialogTrigger>
<AlertDialogContent>
<AlertDialogHeader>
<AlertDialogTitle>Are you sure?</AlertDialogTitle>
<AlertDialogDescription>
This action cannot be undone. This will permanently delete the event
&quot;{event.title}&quot; and all associated data.
</AlertDialogDescription>
</AlertDialogHeader>
<AlertDialogFooter>
<AlertDialogCancel>Cancel</AlertDialogCancel>
<AlertDialogAction
onClick={handleDelete}
disabled={deleting}
className="bg-red-600 hover:bg-red-700"
>
{deleting ? 'Deleting...' : 'Delete Event'}
</AlertDialogAction>
</AlertDialogFooter>
</AlertDialogContent>
</AlertDialog>
</div>
{/* Event Form */}
<EventForm
company={currentCompany}
event={event}
mode="edit"
onSuccess={handleSuccess}
/>

{/* Event Form */}
<EventForm
company={currentCompany}
event={event}
mode="edit"
onSuccess={handleSuccess}
/>
{/* Delete Button at Bottom */}
<div className="flex items-center justify-between pt-6 border-t dark:border-gray-800">
<div className="text-sm text-muted-foreground">
<p className="font-medium">Danger Zone</p>
<p>Once you delete an event, there is no going back.</p>
</div>
<AlertDialog>
<AlertDialogTrigger asChild>
<Button variant="destructive">
<Trash2 className="h-4 w-4 mr-2" />
Delete Event
</Button>
</AlertDialogTrigger>
<AlertDialogContent>
<AlertDialogHeader>
<AlertDialogTitle>Are you sure?</AlertDialogTitle>
<AlertDialogDescription>
This action cannot be undone. This will permanently delete the event
&quot;{event.title}&quot; and all associated data.
</AlertDialogDescription>
</AlertDialogHeader>
<AlertDialogFooter>
<AlertDialogCancel>Cancel</AlertDialogCancel>
<AlertDialogAction
onClick={handleDelete}
disabled={deleting}
className="bg-red-600 hover:bg-red-700"
>
{deleting ? 'Deleting...' : 'Delete Event'}
</AlertDialogAction>
</AlertDialogFooter>
</AlertDialogContent>
</AlertDialog>
</div>
</div>
</div>
)
}
75 changes: 74 additions & 1 deletion app/dashboard/company/[slug]/events/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,28 @@ import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/com
import { Badge } from '@/components/ui/badge'
import { Input } from '@/components/ui/input'
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '@/components/ui/table'
import { Calendar, Search, Plus, Edit, Eye, Clock, CheckCircle, XCircle, AlertCircle } from 'lucide-react'
import { Calendar, Search, Plus, Edit, Eye, Clock, CheckCircle, XCircle, AlertCircle, Trash2 } from 'lucide-react'
import { toast } from 'sonner'
import Link from 'next/link'
import { Event } from '@/types/events'
import {
AlertDialog,
AlertDialogAction,
AlertDialogCancel,
AlertDialogContent,
AlertDialogDescription,
AlertDialogFooter,
AlertDialogHeader,
AlertDialogTitle,
AlertDialogTrigger,
} from '@/components/ui/alert-dialog'

export default function CompanyEventsPage() {
const { currentCompany, loading: companyLoading } = useCompanyContext()
const [events, setEvents] = useState<Event[]>([])
const [loading, setLoading] = useState(true)
const [searchTerm, setSearchTerm] = useState('')
const [deletingEventSlug, setDeletingEventSlug] = useState<string | null>(null)

const fetchEvents = useCallback(async () => {
if (!currentCompany) return
Expand Down Expand Up @@ -51,6 +63,30 @@ export default function CompanyEventsPage() {
event.category.toLowerCase().includes(searchTerm.toLowerCase())
)

const handleDeleteEvent = async (eventSlug: string) => {
try {
setDeletingEventSlug(eventSlug)

const response = await fetch(`/api/events/${eventSlug}`, {
method: 'DELETE',
})

if (!response.ok) {
throw new Error('Failed to delete event')
}

toast.success('Event deleted successfully')

// Refresh the events list
await fetchEvents()
} catch (error) {
console.error('Error deleting event:', error)
toast.error('Failed to delete event')
} finally {
setDeletingEventSlug(null)
}
}

const stats = {
total: events.length,
approved: events.filter(e => e.approval_status === 'approved').length,
Expand Down Expand Up @@ -276,6 +312,43 @@ export default function CompanyEventsPage() {
</Button>
</Link>
)}
<AlertDialog>
<AlertDialogTrigger asChild>
<Button
variant="outline"
size="sm"
disabled={deletingEventSlug === event.slug}
>
{deletingEventSlug === event.slug ? (
<div className="h-4 w-4 animate-spin rounded-full border-2 border-gray-300 border-t-gray-600" />
) : (
<Trash2 className="h-4 w-4 text-red-600" />
)}
</Button>
</AlertDialogTrigger>
<AlertDialogContent>
<AlertDialogHeader>
<AlertDialogTitle>Delete Event</AlertDialogTitle>
<AlertDialogDescription>
Are you sure you want to delete &quot;{event.title}&quot;? This action cannot be undone.
{event.registered && event.registered > 0 && (
<span className="block mt-2 text-red-600 font-medium">
Warning: This event has {event.registered} registered participant{event.registered > 1 ? 's' : ''}.
</span>
)}
</AlertDialogDescription>
</AlertDialogHeader>
<AlertDialogFooter>
<AlertDialogCancel>Cancel</AlertDialogCancel>
<AlertDialogAction
onClick={() => handleDeleteEvent(event.slug)}
className="bg-red-600 hover:bg-red-700"
>
Delete
</AlertDialogAction>
</AlertDialogFooter>
</AlertDialogContent>
</AlertDialog>
</div>
</TableCell>
</TableRow>
Expand Down
Loading
Loading