A Spring Boot application for creating events, referrals, and tracking user referrals. This project was developed during the NLW Connect event by Rocketseat.
- Create and make referrals to events
- Event subscription system
- Referral tracking mechanism
- Ranking system for user referrals
This project's interface follows Rocketseat's design system as showcased in the NLW Connect Figma Design.
events/
βββ src/
β βββ main/
β β βββ java/br/com/nlw/events/
β β β βββ controller/
β β β β βββ EventController.java
β β β β βββ SubscriptionController.java
β β β βββ dto/
β β β β βββ EventDTO.java
β β β β βββ SubscriptionDTO.java
β β β β βββ UserDTO.java
β β β βββ entity/
β β β β βββ EventEntity.java
β β β β βββ SubscriptionEntity.java
β β β β βββ UserEntity.java
β β β βββ exception/
β β β β βββ GlobalExceptionHandler.java
β β β β βββ ResourceNotFoundException.java
β β β βββ repository/
β β β β βββ EventRepository.java
β β β β βββ SubscriptionRepository.java
β β β β βββ UserRepository.java
β β β βββ service/
β β β β βββ EventService.java
β β β β βββ SubscriptionService.java
β β β β βββ UserService.java
β β β βββ EventsApplication.java
β β βββ resources/
β β βββ application.properties
β β βββ application-dev.properties
β β βββ application-prod.properties
β βββ test/
β βββ java/br/com/nlw/events/
β βββ controller/
β βββ service/
β βββ repository/
βββ database_script/
β βββ db_events.sql
β βββ queries.sql
β βββ subscribers_mock.json
βββ .mvn/
βββ docker-compose.yml
βββ .gitignore
βββ LICENSE
βββ README.md
βββ pom.xml
- Java 21+
- Maven
- Docker and Docker Compose
- Clone the repository
git clone https://github.com/zlucasftw/rocketseat-nlw-connect-devstage-java.git
cd rocketseat-nlw-connect-devstage-java- Set up environment variables
Create a .env file in the root directory with the following variables:
DB_USERNAME=root
DB_PASSWORD=root
DB_HOST=localhost:3336
DB_SOURCE=db_events- Start MySQL with Docker
docker-compose up -d- Set up the database
mysql -h 127.0.0.1 -P 3336 -u root -p < database_script/db_events.sql- Build and run the application
./mvnw spring-boot:runThe application will be available at http://localhost:8080.
GET /events- List all eventsGET /events/{prettyName}- Get event by its pretty namePOST /events- Create a new event
POST /subscription/{prettyName}- Subscribe user to an eventPOST /subscription/{prettyName}/{userId}- Subscribe user to an event with referralGET /subscription/{prettyName}/ranking- Get referral rankings for an eventGET /subscription/{prettyName}/ranking/{userId}- Get specific user ranking for an event
The database consists of three main tables:
tbl_event- Stores event informationtbl_user- Stores user informationtbl_subscription- Links users to events and tracks referrals
curl -X POST http://localhost:8080/events \
-H "Content-Type: application/json" \
-d '{
"title": "Dev Stage",
"location": "Online",
"price": 0.00,
"startDate": "2023-11-10",
"endDate": "2023-11-10",
"startTime": "09:00",
"endTime": "17:00"
}'curl -X POST http://localhost:8080/subscription/dev-stage \
-H "Content-Type: application/json" \
-d '{
"name": "John Doe",
"email": "john.doe@example.com"
}'- Improve API's global exception reponse/handling
- Add OpenAPI and Swagger for API documentation
- Add email notifications for event reminders
- Create admin dashboard for event management
- Implement event capacity limits
- Set up CI/CD pipeline
- Create comprehensive test coverage
- Add WebSocket support for real-time updates
- Implement role-based access control
- Add rate limiting for API endpoints
- Set up HTTPS with proper certificates
- Add Redis caching for frequently accessed data
- Implement database query optimizations
- Set up connection pooling configurations
- Create responsive frontend with React
- Support for recurring events
- Multi-language support
- Event analytics dashboard
- Social media sharing integration
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0) - see the LICENSE file for details. The AGPL-3.0 requires that modified versions of this software also be made available under the same license, including when the software is running as a service.
- Rocketseat for the NLW Connect event and the amazing UI/UX design created by Rocketseat's designer Millena KupsinskΓΌ.