Web Development · Case study
Sports Event Management Platform
Social media platform for local sports events with team management and statistics.
The challenge
Local sports communities needed a platform to organize events, manage teams, track statistics, and share achievements.
What I built
Built a comprehensive sports event management platform with Symfony backend and Angular frontend, featuring social media capabilities for local sports enthusiasts.
Results
- Social media platform for local sports communities
- Event organization and team management system
- Statistics tracking and performance analytics
- Social sharing and community engagement features
Tech stack
- Symfony
- Angular
- MySQL
- PHP
- REST API
Code sketch
A simplified illustration of the core logic, not production code.
// Sports Event Management Controller
<?php
namespace App\Controller;
use App\Entity\Event;
use App\Entity\Team;
use App\Service\StatisticsService;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
class EventController extends AbstractController
{
private $statisticsService;
public function __construct(StatisticsService $statisticsService)
{
$this->statisticsService = $statisticsService;
}
/**
* @Route("/api/events", methods={"POST"})
*/
public function createEvent(Request $request): Response
{
$data = json_decode($request->getContent(), true);
$event = new Event();
$event->setName($data['name']);
$event->setDate(new \DateTime($data['date']));
$event->setSport($data['sport']);
$event->setLocation($data['location']);
$event->setOrganizer($this->getUser());
// Add participating teams
foreach ($data['teams'] as $teamData) {
$team = $this->getDoctrine()
->getRepository(Team::class)
->find($teamData['id']);
$event->addTeam($team);
}
$entityManager = $this->getDoctrine()->getManager();
$entityManager->persist($event);
$entityManager->flush();
return $this->json([
'success' => true,
'event_id' => $event->getId(),
'message' => 'Event created successfully'
]);
}
/**
* @Route("/api/events/{id}/results", methods={"POST"})
*/
public function updateEventResults(int $id, Request $request): Response
{
$event = $this->getDoctrine()
->getRepository(Event::class)
->find($id);
$results = json_decode($request->getContent(), true);
// Update event results
$event->setResults($results);
$event->setStatus('completed');
// Update team statistics
$this->statisticsService->updateTeamStats($event, $results);
// Create social media post
$this->createSocialPost($event, $results);
$entityManager = $this->getDoctrine()->getManager();
$entityManager->flush();
return $this->json(['success' => true]);
}
}