You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Evently is a project that scrapes event data, indexes it into Elasticsearch, and serves it through a FastAPI backend with a front-end UI.
3
+
Evently is a platform that scrapes event data from multiple Moroccan sources, enriches each event with nearby bus and tramway transport info, indexes everything into Elasticsearch, and serves it through a FastAPI backend with a frontend UI.
4
4
All scraping and indexing are automated using GitHub Actions on a scheduled cron job.
5
5
6
-
7
6
---
8
7
9
-
## 📌 Features :
8
+
## 📌 Features
10
9
11
10
### 🔍 Scraping
12
-
- Collects events from multiple sources
11
+
- Collects events in parallel from multiple sources (Casaevents, Eventbrite, Events.ma, Guichet)
12
+
- Parallel scraping for faster data collection
13
+
14
+
### 🚌 Transport Integration
15
+
- Each event is automatically enriched with nearby **Casabus** and **Tramway** lines at indexing time
16
+
- Uses a **KDTree spatial index** for near-instant transport lookups
17
+
- Transport data is precomputed and stored directly in the event document — no per-request calculation
13
18
14
19
### 🧠 Elasticsearch
15
-
- Events are indexed
16
-
- Prevents duplicates using hashed unique IDs
20
+
- Events are indexed with duplicate prevention using hashed unique IDs (MD5)
21
+
- Full-text search with filters by city, category, and date
22
+
- Aggregations for stats, filters, trending, and recommendations
17
23
18
24
### ⚡ FastAPI Backend
19
25
20
-
Endpoints:
21
-
-`/` – serves the frontend
22
-
-`/events` – paginated events
23
-
-`/indexing` – manually trigger indexing
24
-
-`/stream` – test server-sent event streaming
26
+
| Method | Endpoint | Description |
27
+
|--------|----------|-------------|
28
+
| GET |`/`| Frontend homepage |
29
+
| GET |`/events?page=X&size=Y`| Paginated events |
30
+
| GET |`/event/{event_id}`| Single event detail |
31
+
| GET |`/search`| Search with filters (city, category, date) |
32
+
| GET |`/transport/{event_id}`| Bus and tramway lines near an event |
33
+
| GET |`/filters`| Available cities and categories |
34
+
| GET |`/stats`| Total events, upcoming, cities, categories |
35
+
| GET |`/trending`| Trending upcoming events |
36
+
| GET |`/recommendations`| Similar events by category and city |
37
+
| GET |`/calendar`| Events grouped by date for a given month |
38
+
| POST |`/favorites/{event_id}`| Add event to favorites |
39
+
| DELETE |`/favorites/{event_id}`| Remove event from favorites |
40
+
| GET |`/favorites`| Get favorite events |
41
+
| POST |`/export`| Export events as JSON or CSV |
42
+
| GET |`/reindex`| Manually trigger full reindex |
43
+
| GET |`/health`| Elasticsearch health check |
25
44
26
45
### 🎨 Frontend
27
-
- Dynamic event loading from API
28
-
- Pagination support
46
+
- Dynamic event loading from API
47
+
- Pagination, search, and filter support
29
48
30
49
### 🔄 GitHub Actions Automation
31
-
A scheduled workflow runs:
32
-
- All scrapers
33
-
- Elasticsearch indexing script
34
-
- Based on a cron schedule
50
+
A scheduled workflow runs all scrapers and Elasticsearch indexing automatically on a cron schedule.
| GET |`/events?page=X&size=Y`| Paginated events |
120
-
| GET |`/indexing`| Manually trigger event indexing |
121
-
| GET |`/stream`| Server-sent events (debug) |
151
+
# Check health
152
+
http://localhost:8000/health
122
153
154
+
# Manually trigger reindex
155
+
http://localhost:8000/reindex
156
+
```
123
157
158
+
---
124
159
160
+
## 🔧 How Transport Works
125
161
126
-
### 🧪 Testing locally
127
-
```
128
-
Run FastAPI
129
-
Call: http://localhost:8000/events
130
-
If you see JSON, everything works.
131
-
Use the frontend to browse events visually.
132
-
```
162
+
At indexing time, each event's coordinates are used to query a **KDTree** built from all bus and tramway stop coordinates. The nearest lines (within 0.5km) are stored directly on the event document in Elasticsearch.
133
163
164
+
This means `/transport/{event_id}` is just a simple document read — no spatial computation happens at request time.
134
165
166
+
---
135
167
168
+
## 📝 Future Improvements
136
169
137
-
### 📝 Future Improvements
138
-
```
139
-
1️⃣ Add categories & filters
140
-
2️⃣ Add search by city / date
141
-
3️⃣ Add infinite scrolling
142
-
4️⃣ Add AI-based event deduplication
143
-
```
170
+
1. Add infinite scrolling to the frontend
171
+
2. Store favorites in Elasticsearch instead of in-memory
0 commit comments