simple event ticket system. web-based sales and management with role-based access, real-time availability, and concurrency-safe purchase handling.
ticketr provides:
- two roles: normal user and administrator
- real-time ticket availability
- concurrency control to prevent overselling
| technology | version | purpose |
|---|---|---|
| java | 21 | runtime |
| spring boot | 3.x | backend |
| thymeleaf | 3.1 | server-side templates |
| bootstrap | 5.3 | ui |
| mysql | 8.0+ | database |
| spring security | 6.x | auth and authorization |
browser --> spring boot (mvc) --> mysql
src/main/java/com/example/sistemaboletos/
config/ security and app configuration
controller/ http handlers and navigation
model/ entities (Usuario, Evento, Compra, Rol, EntidadBase)
model/servicio/ service interfaces and implementations
repository/ jpa data access
SistemaBoletosApplication.java
auth
- login and registration
- default admin account:
admin@admin.com/admin123
events (admin only)
- crud at
/admin/eventos - list:
GET /admin/eventos - save:
POST /admin/eventos/guardar - delete:
GET /admin/eventos/eliminar/{id}
purchases
- concurrency-safe ticket purchase via
@TransactionalandsynchronizedinEventoServiceImpl.comprarBoletos()
prerequisites: jdk 21+, mysql 8.0+, maven
-
create database:
CREATE DATABASE sistema_boletos;
-
copy the env file and set your credentials:
cp .env.example .env
-
start the app:
mvn spring-boot:run
| area | requirement | how it is met |
|---|---|---|
| architecture | client-server | spring boot backend, thymeleaf/bootstrap frontend |
| concurrency | thread safety | @Transactional + synchronized in EventoServiceImpl.comprarBoletos() (code) |
| security | authentication | spring security; /admin/** restricted by role |
| persistence | full crud | jpa repositories for users, events, purchases, tickets |
| validation | error handling | purchase validation and spring security error views (e.g. login?error) |
| data structures | generic collections | List<T>, Optional<T>, security context maps |
| oop | abstract class | EntidadBase for shared id |
| oop | enum | Rol (USER, ADMIN) |
| oop | interface | IEventoService implemented by EventoServiceImpl |
MIT License, see LICENSE.