projects/eventease
Eneuss / EventEase
EventEase - Event Booking
Find events near you, see them on a map and book tickets.
overview
EventEase is a full-stack web app for finding events in a city, seeing them on an interactive map and booking tickets. It started as coursework for a university Web Development module, and was later refactored and hardened.
What it does
- Search for events by city and see the results as a list and as pins on an OpenStreetMap map.
- Log in and book tickets: pick a ticket type, with its price and how many are left, and a quantity.
- Book straight from the list or from a pin's popup on the map.
- Refuse bookings that can't be honoured: sold-out ticket types, too many tickets, or events that have already taken place.
- Stay logged in across page reloads, with sessions that last 24 hours.
How it's built
- Frontend: React 19 with Vite and React Leaflet.
- Backend: Node.js and Express 4, with express-session and bcrypt.
- Database: SQLite.
- Layered API: routes, services and DAOs keep HTTP handling, business rules and SQL apart.
- Security: sessions live in httpOnly cookies and passwords are hashed with bcrypt. The server takes the booking's user from the session, never from the request, restricts admin-only endpoints by role, and rate-limits repeated failed logins.
- One origin: the Vite dev server, or nginx under Docker, forwards API requests to Express, so the session cookie works without any CORS configuration.
- Setup:
docker compose upbuilds the React app, serves it with nginx and seeds a demo database on first start. - Tests: 44 API tests (node:test and supertest), each file running against a freshly seeded database, plus 11 frontend tests (Vitest and Testing Library).
Challenges and what I learned
- Overselling under concurrent load. Checking availability in JavaScript and then writing the booking was a race: 20 parallel requests against 5 remaining tickets produced 9 bookings. The check and the decrement are now one conditional
UPDATE, and theINSERTruns only if that update changed a row, all in a single SQLite transaction. A test fires 20 simultaneous requests at 5 remaining tickets and checks that exactly 5 succeed. - Sessions instead of JWTs. With an httpOnly session cookie, logout really ends the session and the frontend never handles tokens. The trade-off is that the default in-memory session store loses sessions on restart and doesn't scale beyond one process.
- SQLite's trade-offs. A single file with no database server makes setup and resets easy, but it allows one writer at a time and a single app instance. PostgreSQL would be the step up.