No Act on ACT · ModernPerlforwebapplications PSGI/Plack Webapplicationframework(Dancer2)...
Transcript of No Act on ACT · ModernPerlforwebapplications PSGI/Plack Webapplicationframework(Dancer2)...
![Page 1: No Act on ACT · ModernPerlforwebapplications PSGI/Plack Webapplicationframework(Dancer2) Webframework(Bootstrap,Jquery) DBIx::Class Mooandfriends Testing](https://reader036.fdocuments.in/reader036/viewer/2022071018/5fd2385f214b8847617104da/html5/thumbnails/1.jpg)
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
No Act on ACT
Stefan Hornburg (Racke)
2016-08-25 17:25
![Page 2: No Act on ACT · ModernPerlforwebapplications PSGI/Plack Webapplicationframework(Dancer2) Webframework(Bootstrap,Jquery) DBIx::Class Mooandfriends Testing](https://reader036.fdocuments.in/reader036/viewer/2022071018/5fd2385f214b8847617104da/html5/thumbnails/2.jpg)
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
YAPC::EU 2008 in Copenhagen
![Page 3: No Act on ACT · ModernPerlforwebapplications PSGI/Plack Webapplicationframework(Dancer2) Webframework(Bootstrap,Jquery) DBIx::Class Mooandfriends Testing](https://reader036.fdocuments.in/reader036/viewer/2022071018/5fd2385f214b8847617104da/html5/thumbnails/3.jpg)
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
PerlDancer for Perlers (FOSDEM 2011)
Sawyer’s presentation
![Page 4: No Act on ACT · ModernPerlforwebapplications PSGI/Plack Webapplicationframework(Dancer2) Webframework(Bootstrap,Jquery) DBIx::Class Mooandfriends Testing](https://reader036.fdocuments.in/reader036/viewer/2022071018/5fd2385f214b8847617104da/html5/thumbnails/4.jpg)
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
Perl Dancer Conference 2014
http://act.perl.dance/eic2014/
![Page 5: No Act on ACT · ModernPerlforwebapplications PSGI/Plack Webapplicationframework(Dancer2) Webframework(Bootstrap,Jquery) DBIx::Class Mooandfriends Testing](https://reader036.fdocuments.in/reader036/viewer/2022071018/5fd2385f214b8847617104da/html5/thumbnails/5.jpg)
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
Using ACT in 2013/2014
▶ Managed software▶ Listed in other conferences (Marketing)▶ User database
![Page 6: No Act on ACT · ModernPerlforwebapplications PSGI/Plack Webapplicationframework(Dancer2) Webframework(Bootstrap,Jquery) DBIx::Class Mooandfriends Testing](https://reader036.fdocuments.in/reader036/viewer/2022071018/5fd2385f214b8847617104da/html5/thumbnails/6.jpg)
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
Modern Perl for web applications
▶ PSGI / Plack▶ Web application framework (Dancer2)▶ Web framework (Bootstrap, Jquery)▶ DBIx::Class▶ Moo and friends▶ Testing
![Page 7: No Act on ACT · ModernPerlforwebapplications PSGI/Plack Webapplicationframework(Dancer2) Webframework(Bootstrap,Jquery) DBIx::Class Mooandfriends Testing](https://reader036.fdocuments.in/reader036/viewer/2022071018/5fd2385f214b8847617104da/html5/thumbnails/7.jpg)
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
mod_perl vs PSGI
▶ Apache / mod_perl▶ slow▶ memory footprint▶ deployment related code
▶ PSGI▶ runs on any webserver supporting PSGI▶ fast (Nginx)▶ simple configuration (Nginx)▶ no deployment related code
![Page 8: No Act on ACT · ModernPerlforwebapplications PSGI/Plack Webapplicationframework(Dancer2) Webframework(Bootstrap,Jquery) DBIx::Class Mooandfriends Testing](https://reader036.fdocuments.in/reader036/viewer/2022071018/5fd2385f214b8847617104da/html5/thumbnails/8.jpg)
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
Apache version
Apache/1.3.42 (Unix) mod_perl/1.31
more than 6 years old
![Page 9: No Act on ACT · ModernPerlforwebapplications PSGI/Plack Webapplicationframework(Dancer2) Webframework(Bootstrap,Jquery) DBIx::Class Mooandfriends Testing](https://reader036.fdocuments.in/reader036/viewer/2022071018/5fd2385f214b8847617104da/html5/thumbnails/9.jpg)
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
Dancer2 Advantages
▶ Clean OO interface▶ Routes▶ Hooks▶ Engines▶ Multiple Applications
▶ Web application▶ REST API▶ Admin interface
![Page 10: No Act on ACT · ModernPerlforwebapplications PSGI/Plack Webapplicationframework(Dancer2) Webframework(Bootstrap,Jquery) DBIx::Class Mooandfriends Testing](https://reader036.fdocuments.in/reader036/viewer/2022071018/5fd2385f214b8847617104da/html5/thumbnails/10.jpg)
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
Manual SQL vs DBIx::Class
▶ Manual SQL▶ error prone▶ compatibility problems▶ less secure
▶ DBIx::Class▶ Business logic▶ works on dozens of RDBMS▶ usually faster▶ more secure
![Page 11: No Act on ACT · ModernPerlforwebapplications PSGI/Plack Webapplicationframework(Dancer2) Webframework(Bootstrap,Jquery) DBIx::Class Mooandfriends Testing](https://reader036.fdocuments.in/reader036/viewer/2022071018/5fd2385f214b8847617104da/html5/thumbnails/11.jpg)
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
More Reasons for ”No act on ACT”
▶ Single Point of Failure▶ Development
![Page 12: No Act on ACT · ModernPerlforwebapplications PSGI/Plack Webapplicationframework(Dancer2) Webframework(Bootstrap,Jquery) DBIx::Class Mooandfriends Testing](https://reader036.fdocuments.in/reader036/viewer/2022071018/5fd2385f214b8847617104da/html5/thumbnails/12.jpg)
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
Single Point of Failure
▶ Baltimore Perl Workshop▶ Eventbrite
![Page 13: No Act on ACT · ModernPerlforwebapplications PSGI/Plack Webapplicationframework(Dancer2) Webframework(Bootstrap,Jquery) DBIx::Class Mooandfriends Testing](https://reader036.fdocuments.in/reader036/viewer/2022071018/5fd2385f214b8847617104da/html5/thumbnails/13.jpg)
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
Development
▶ Last commit on ACT: July 2015https://github.com/book/Act
▶ Last commit on ACT in the box: September 2015
![Page 14: No Act on ACT · ModernPerlforwebapplications PSGI/Plack Webapplicationframework(Dancer2) Webframework(Bootstrap,Jquery) DBIx::Class Mooandfriends Testing](https://reader036.fdocuments.in/reader036/viewer/2022071018/5fd2385f214b8847617104da/html5/thumbnails/14.jpg)
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
Responsiveness
Figure: Picture by Guillaume Brocker, CC BY-SA 3.0
![Page 15: No Act on ACT · ModernPerlforwebapplications PSGI/Plack Webapplicationframework(Dancer2) Webframework(Bootstrap,Jquery) DBIx::Class Mooandfriends Testing](https://reader036.fdocuments.in/reader036/viewer/2022071018/5fd2385f214b8847617104da/html5/thumbnails/15.jpg)
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
Perl Dancer Conference Website
https://github.com/interchange/Perl-Dancer-Conference
![Page 16: No Act on ACT · ModernPerlforwebapplications PSGI/Plack Webapplicationframework(Dancer2) Webframework(Bootstrap,Jquery) DBIx::Class Mooandfriends Testing](https://reader036.fdocuments.in/reader036/viewer/2022071018/5fd2385f214b8847617104da/html5/thumbnails/16.jpg)
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
Web Application Features
▶ Maps with Leaflet▶ Cropping Photos▶ Administration▶ SEO / Modern Design▶ Dancer2::Debugger
![Page 17: No Act on ACT · ModernPerlforwebapplications PSGI/Plack Webapplicationframework(Dancer2) Webframework(Bootstrap,Jquery) DBIx::Class Mooandfriends Testing](https://reader036.fdocuments.in/reader036/viewer/2022071018/5fd2385f214b8847617104da/html5/thumbnails/17.jpg)
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
Maps with Leaflet
▶ Venue on Frontpage▶ Leaflet library▶ Leaflet code▶ User map
![Page 18: No Act on ACT · ModernPerlforwebapplications PSGI/Plack Webapplicationframework(Dancer2) Webframework(Bootstrap,Jquery) DBIx::Class Mooandfriends Testing](https://reader036.fdocuments.in/reader036/viewer/2022071018/5fd2385f214b8847617104da/html5/thumbnails/18.jpg)
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
Venue on Frontpage
![Page 19: No Act on ACT · ModernPerlforwebapplications PSGI/Plack Webapplicationframework(Dancer2) Webframework(Bootstrap,Jquery) DBIx::Class Mooandfriends Testing](https://reader036.fdocuments.in/reader036/viewer/2022071018/5fd2385f214b8847617104da/html5/thumbnails/19.jpg)
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
Leaflet Library
Leaflet Javascript library
![Page 20: No Act on ACT · ModernPerlforwebapplications PSGI/Plack Webapplicationframework(Dancer2) Webframework(Bootstrap,Jquery) DBIx::Class Mooandfriends Testing](https://reader036.fdocuments.in/reader036/viewer/2022071018/5fd2385f214b8847617104da/html5/thumbnails/20.jpg)
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
Leaflet Code
var map = L.map('map').setView([48.20078,16.36826], 13);L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={accessToken}', {attribution: 'Map data © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery © <a href="http://mapbox.com">Mapbox</a>',maxZoom: 18,id: 'petermottram.mp1dpak2',accessToken: 'pk.eyJ1IjoicGV0ZXJtb3R0cmFtIiwiYSI6IjE1NWI5NjRjN2IxNjNkYTM1MzI3YzY5M2E0YjZjMDc0In0.T0bpnZGXCQBSW_SOv_nWHA'
}).addTo(map);var marker2 = L.marker([48.18246, 16.38075]).addTo(map);marker2.bindPopup("<b>Hotel Schani Wien</b><br>Karl-Popper-Straße 22<br>Conference Venue<br>21/22 Oct");$("#marker2").click(function(){
marker2.openPopup();return false;
});
![Page 21: No Act on ACT · ModernPerlforwebapplications PSGI/Plack Webapplicationframework(Dancer2) Webframework(Bootstrap,Jquery) DBIx::Class Mooandfriends Testing](https://reader036.fdocuments.in/reader036/viewer/2022071018/5fd2385f214b8847617104da/html5/thumbnails/21.jpg)
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
User Map
Figure: User Map
![Page 22: No Act on ACT · ModernPerlforwebapplications PSGI/Plack Webapplicationframework(Dancer2) Webframework(Bootstrap,Jquery) DBIx::Class Mooandfriends Testing](https://reader036.fdocuments.in/reader036/viewer/2022071018/5fd2385f214b8847617104da/html5/thumbnails/22.jpg)
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
Cropping photos
You can drag and drop or uplad your photo and crop it in ourwebsite.
![Page 23: No Act on ACT · ModernPerlforwebapplications PSGI/Plack Webapplicationframework(Dancer2) Webframework(Bootstrap,Jquery) DBIx::Class Mooandfriends Testing](https://reader036.fdocuments.in/reader036/viewer/2022071018/5fd2385f214b8847617104da/html5/thumbnails/23.jpg)
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
Current photo
Figure: /profile/photo
![Page 24: No Act on ACT · ModernPerlforwebapplications PSGI/Plack Webapplicationframework(Dancer2) Webframework(Bootstrap,Jquery) DBIx::Class Mooandfriends Testing](https://reader036.fdocuments.in/reader036/viewer/2022071018/5fd2385f214b8847617104da/html5/thumbnails/24.jpg)
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
Ballerina
![Page 25: No Act on ACT · ModernPerlforwebapplications PSGI/Plack Webapplicationframework(Dancer2) Webframework(Bootstrap,Jquery) DBIx::Class Mooandfriends Testing](https://reader036.fdocuments.in/reader036/viewer/2022071018/5fd2385f214b8847617104da/html5/thumbnails/25.jpg)
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
Cropping I
![Page 26: No Act on ACT · ModernPerlforwebapplications PSGI/Plack Webapplicationframework(Dancer2) Webframework(Bootstrap,Jquery) DBIx::Class Mooandfriends Testing](https://reader036.fdocuments.in/reader036/viewer/2022071018/5fd2385f214b8847617104da/html5/thumbnails/26.jpg)
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
Cropping II
![Page 27: No Act on ACT · ModernPerlforwebapplications PSGI/Plack Webapplicationframework(Dancer2) Webframework(Bootstrap,Jquery) DBIx::Class Mooandfriends Testing](https://reader036.fdocuments.in/reader036/viewer/2022071018/5fd2385f214b8847617104da/html5/thumbnails/27.jpg)
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
Final Result
![Page 28: No Act on ACT · ModernPerlforwebapplications PSGI/Plack Webapplicationframework(Dancer2) Webframework(Bootstrap,Jquery) DBIx::Class Mooandfriends Testing](https://reader036.fdocuments.in/reader036/viewer/2022071018/5fd2385f214b8847617104da/html5/thumbnails/28.jpg)
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
Jcrop Library
Jcrop - jQuery Image Cropping Plugin
![Page 29: No Act on ACT · ModernPerlforwebapplications PSGI/Plack Webapplicationframework(Dancer2) Webframework(Bootstrap,Jquery) DBIx::Class Mooandfriends Testing](https://reader036.fdocuments.in/reader036/viewer/2022071018/5fd2385f214b8847617104da/html5/thumbnails/29.jpg)
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
SEO / Modern Web Design
▶ Secure site with HTTPS▶ Speaking links
![Page 30: No Act on ACT · ModernPerlforwebapplications PSGI/Plack Webapplicationframework(Dancer2) Webframework(Bootstrap,Jquery) DBIx::Class Mooandfriends Testing](https://reader036.fdocuments.in/reader036/viewer/2022071018/5fd2385f214b8847617104da/html5/thumbnails/30.jpg)
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
Secure site with HTTPS
▶ More secure and gives users more confidence▶ Small ranking boost with Google▶ Free certificates with Let’s Encrypt
![Page 31: No Act on ACT · ModernPerlforwebapplications PSGI/Plack Webapplicationframework(Dancer2) Webframework(Bootstrap,Jquery) DBIx::Class Mooandfriends Testing](https://reader036.fdocuments.in/reader036/viewer/2022071018/5fd2385f214b8847617104da/html5/thumbnails/31.jpg)
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
Speaking Links I
Figure: No act on ACT
![Page 32: No Act on ACT · ModernPerlforwebapplications PSGI/Plack Webapplicationframework(Dancer2) Webframework(Bootstrap,Jquery) DBIx::Class Mooandfriends Testing](https://reader036.fdocuments.in/reader036/viewer/2022071018/5fd2385f214b8847617104da/html5/thumbnails/32.jpg)
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
Speaking Links II
ACT http://act.yapc.eu/ye2016/talk/6780PDC https:
//www.perl.dance/talks/40-no-act-on-act
![Page 33: No Act on ACT · ModernPerlforwebapplications PSGI/Plack Webapplicationframework(Dancer2) Webframework(Bootstrap,Jquery) DBIx::Class Mooandfriends Testing](https://reader036.fdocuments.in/reader036/viewer/2022071018/5fd2385f214b8847617104da/html5/thumbnails/33.jpg)
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
Administration
▶ Users▶ Talks▶ Tickets▶ Events▶ News
![Page 34: No Act on ACT · ModernPerlforwebapplications PSGI/Plack Webapplicationframework(Dancer2) Webframework(Bootstrap,Jquery) DBIx::Class Mooandfriends Testing](https://reader036.fdocuments.in/reader036/viewer/2022071018/5fd2385f214b8847617104da/html5/thumbnails/34.jpg)
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
Navigation
![Page 35: No Act on ACT · ModernPerlforwebapplications PSGI/Plack Webapplicationframework(Dancer2) Webframework(Bootstrap,Jquery) DBIx::Class Mooandfriends Testing](https://reader036.fdocuments.in/reader036/viewer/2022071018/5fd2385f214b8847617104da/html5/thumbnails/35.jpg)
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
Dancer2::Debugger
Dancer2::Debugger▶ Result and response▶ Log entries▶ Session▶ Template variables▶ Timers▶ DBIx::Class query log▶ … more
![Page 36: No Act on ACT · ModernPerlforwebapplications PSGI/Plack Webapplicationframework(Dancer2) Webframework(Bootstrap,Jquery) DBIx::Class Mooandfriends Testing](https://reader036.fdocuments.in/reader036/viewer/2022071018/5fd2385f214b8847617104da/html5/thumbnails/36.jpg)
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
Log Entries
![Page 37: No Act on ACT · ModernPerlforwebapplications PSGI/Plack Webapplicationframework(Dancer2) Webframework(Bootstrap,Jquery) DBIx::Class Mooandfriends Testing](https://reader036.fdocuments.in/reader036/viewer/2022071018/5fd2385f214b8847617104da/html5/thumbnails/37.jpg)
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
DBIx::Class Query Log
![Page 38: No Act on ACT · ModernPerlforwebapplications PSGI/Plack Webapplicationframework(Dancer2) Webframework(Bootstrap,Jquery) DBIx::Class Mooandfriends Testing](https://reader036.fdocuments.in/reader036/viewer/2022071018/5fd2385f214b8847617104da/html5/thumbnails/38.jpg)
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
DBIx::Class Techniques
▶ Set Based DBIx::Classhttp://www.perladvent.org/2012/2012-12-21.html
▶ Truth of ResultSet▶ Chaining▶ Relationship traversal▶ Predefined searches
▶ Hashref Inflation
![Page 39: No Act on ACT · ModernPerlforwebapplications PSGI/Plack Webapplicationframework(Dancer2) Webframework(Bootstrap,Jquery) DBIx::Class Mooandfriends Testing](https://reader036.fdocuments.in/reader036/viewer/2022071018/5fd2385f214b8847617104da/html5/thumbnails/39.jpg)
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
Truth of ResultSet
This doesn’t execute SQL:
my $talks = $schema->resultset('Talk')->search(...);
This does:
my $first_talk = $schema->resultset('Talk')->search(...)->first;
![Page 40: No Act on ACT · ModernPerlforwebapplications PSGI/Plack Webapplicationframework(Dancer2) Webframework(Bootstrap,Jquery) DBIx::Class Mooandfriends Testing](https://reader036.fdocuments.in/reader036/viewer/2022071018/5fd2385f214b8847617104da/html5/thumbnails/40.jpg)
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
Chaining
my $talks = $schema->resultset('Talk')->search({-bool => 'accepted'})->search({conferences_id => 1})->search({room => { '!=' => '' }),->search({start_time => {
'>=' => '2015-10-22 00:00:00''<=' => '2015-10-23 00:00:00'}}),
);
![Page 41: No Act on ACT · ModernPerlforwebapplications PSGI/Plack Webapplicationframework(Dancer2) Webframework(Bootstrap,Jquery) DBIx::Class Mooandfriends Testing](https://reader036.fdocuments.in/reader036/viewer/2022071018/5fd2385f214b8847617104da/html5/thumbnails/41.jpg)
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
Relationship Traversal
# countries dropdown$tokens->{countries} = [
$users->search_related('addresses',{
type => 'primary',},
)->search_related('country', undef,{
columns => [ 'country_iso_code', 'name' ],distinct => 1,order_by => 'country.name',
})->hri->all
];
![Page 42: No Act on ACT · ModernPerlforwebapplications PSGI/Plack Webapplicationframework(Dancer2) Webframework(Bootstrap,Jquery) DBIx::Class Mooandfriends Testing](https://reader036.fdocuments.in/reader036/viewer/2022071018/5fd2385f214b8847617104da/html5/thumbnails/42.jpg)
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
Hashref Inflator
# countries dropdown$tokens->{countries} = [
rset('Country')->search( undef,{ columns => [ 'country_iso_code', 'name' ],
order_by => 'name' } )->hri->all
];unshift @{ $tokens->{countries} },
{ country_iso_code => undef, name => "Select Country" };
![Page 43: No Act on ACT · ModernPerlforwebapplications PSGI/Plack Webapplicationframework(Dancer2) Webframework(Bootstrap,Jquery) DBIx::Class Mooandfriends Testing](https://reader036.fdocuments.in/reader036/viewer/2022071018/5fd2385f214b8847617104da/html5/thumbnails/43.jpg)
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
Predefined Searches
User class:
sub last_conference_attended {my $self = shift;my $conference = $self->conferences->search({}, {
order_by => { -desc => 'start_date' },})->first;
}
Web application:
my $conference = $user->last_conference_attended;
;
![Page 44: No Act on ACT · ModernPerlforwebapplications PSGI/Plack Webapplicationframework(Dancer2) Webframework(Bootstrap,Jquery) DBIx::Class Mooandfriends Testing](https://reader036.fdocuments.in/reader036/viewer/2022071018/5fd2385f214b8847617104da/html5/thumbnails/44.jpg)
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
Dancer2
▶ Code structure▶ Hooks▶ Plugins▶ Plack::Middleware
![Page 45: No Act on ACT · ModernPerlforwebapplications PSGI/Plack Webapplicationframework(Dancer2) Webframework(Bootstrap,Jquery) DBIx::Class Mooandfriends Testing](https://reader036.fdocuments.in/reader036/viewer/2022071018/5fd2385f214b8847617104da/html5/thumbnails/45.jpg)
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
Code Structure
▶ Main module▶ Multiple modules for routes
![Page 46: No Act on ACT · ModernPerlforwebapplications PSGI/Plack Webapplicationframework(Dancer2) Webframework(Bootstrap,Jquery) DBIx::Class Mooandfriends Testing](https://reader036.fdocuments.in/reader036/viewer/2022071018/5fd2385f214b8847617104da/html5/thumbnails/46.jpg)
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
Main Module
use Dancer2;
use PerlDance::Routes::Account;use PerlDance::Routes::Admin;use PerlDance::Routes::Data;use PerlDance::Routes::PayPal;use PerlDance::Routes::Profile;use PerlDance::Routes::Survey;use PerlDance::Routes::Talk;use PerlDance::Routes::User;use PerlDance::Routes::Wiki;
![Page 47: No Act on ACT · ModernPerlforwebapplications PSGI/Plack Webapplicationframework(Dancer2) Webframework(Bootstrap,Jquery) DBIx::Class Mooandfriends Testing](https://reader036.fdocuments.in/reader036/viewer/2022071018/5fd2385f214b8847617104da/html5/thumbnails/47.jpg)
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
Route module I
use Dancer2 appname => 'PerlDance';
use Dancer2::Plugin::Auth::Extensible;use Dancer2::Plugin::DataTransposeValidator;use Dancer2::Plugin::DBIC;use Dancer2::Plugin::Email;use Dancer2::Plugin::Deferred;use Dancer2::Plugin::Interchange6;use Dancer2::Plugin::TemplateFlute;
prefix '/profile';
![Page 48: No Act on ACT · ModernPerlforwebapplications PSGI/Plack Webapplicationframework(Dancer2) Webframework(Bootstrap,Jquery) DBIx::Class Mooandfriends Testing](https://reader036.fdocuments.in/reader036/viewer/2022071018/5fd2385f214b8847617104da/html5/thumbnails/48.jpg)
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
Route module II
get '/talk/create' => sub {my $tokens = {
title => "New Talk",};
$tokens->{form} = form('create-update-talk');$tokens->{form}->reset;$tokens->{form}->fill( duration => 40 );
add_durations_token($tokens);
template 'profile/create_update_talk', $tokens;};
![Page 49: No Act on ACT · ModernPerlforwebapplications PSGI/Plack Webapplicationframework(Dancer2) Webframework(Bootstrap,Jquery) DBIx::Class Mooandfriends Testing](https://reader036.fdocuments.in/reader036/viewer/2022071018/5fd2385f214b8847617104da/html5/thumbnails/49.jpg)
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
Hooks used
hook 'before_template_render' => sub {my $tokens = shift;
if ( my $user = logged_in_user ) {$tokens->{logged_in_user} = schema->current_user;
}
$tokens->{conference_name} = setting('conference_name');};
![Page 50: No Act on ACT · ModernPerlforwebapplications PSGI/Plack Webapplicationframework(Dancer2) Webframework(Bootstrap,Jquery) DBIx::Class Mooandfriends Testing](https://reader036.fdocuments.in/reader036/viewer/2022071018/5fd2385f214b8847617104da/html5/thumbnails/50.jpg)
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
Plugins used
Dancer2::Plugin::Auth::Extensible User AuthenticationDancer2::Plugin::DataTransposeValidator Form validationDancer2::Plugin::DBIC DBIx::Class WrapperDancer2::Plugin::Deferred Flash messages after redirectDancer2::Plugin::Email Sending emailsDancer2::Plugin::Interchange6 Cart and other business functionsDancer2::Plugin::TemplateFlute Form handling
![Page 51: No Act on ACT · ModernPerlforwebapplications PSGI/Plack Webapplicationframework(Dancer2) Webframework(Bootstrap,Jquery) DBIx::Class Mooandfriends Testing](https://reader036.fdocuments.in/reader036/viewer/2022071018/5fd2385f214b8847617104da/html5/thumbnails/51.jpg)
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
Plack Middleware
Joy of PSGI middleware
![Page 52: No Act on ACT · ModernPerlforwebapplications PSGI/Plack Webapplicationframework(Dancer2) Webframework(Bootstrap,Jquery) DBIx::Class Mooandfriends Testing](https://reader036.fdocuments.in/reader036/viewer/2022071018/5fd2385f214b8847617104da/html5/thumbnails/52.jpg)
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
xsrf-tokenPlack::Middleware::XSRFBlock# bin/app.psgi
use Plack::Builder;use PerlDance;my $app = PerlDance->to_app;
builder {enable 'Session';enable 'XSRFBlock',cookie_name => 'PerlDance-XSRF-Token',meta_tag => 'xsrf-meta',cookie_options => { httponly => 1, };
enable 'XForwardedFor',trust => [qw( 127.0.0.1 10.0.0.0/8 172.16.0.0/20 192.168.0.0/16 )];
$app;}
![Page 53: No Act on ACT · ModernPerlforwebapplications PSGI/Plack Webapplicationframework(Dancer2) Webframework(Bootstrap,Jquery) DBIx::Class Mooandfriends Testing](https://reader036.fdocuments.in/reader036/viewer/2022071018/5fd2385f214b8847617104da/html5/thumbnails/53.jpg)
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
Summary
▶ Modern Perl▶ Missing features▶ Perl Dancer Conference 2016▶ Call for developers▶ Ask questions
![Page 54: No Act on ACT · ModernPerlforwebapplications PSGI/Plack Webapplicationframework(Dancer2) Webframework(Bootstrap,Jquery) DBIx::Class Mooandfriends Testing](https://reader036.fdocuments.in/reader036/viewer/2022071018/5fd2385f214b8847617104da/html5/thumbnails/54.jpg)
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
Missing features
▶ Multilingual GH #8▶ Drag and drop schedule tool▶ Multisite▶ Multiple speakers GH #104
![Page 55: No Act on ACT · ModernPerlforwebapplications PSGI/Plack Webapplicationframework(Dancer2) Webframework(Bootstrap,Jquery) DBIx::Class Mooandfriends Testing](https://reader036.fdocuments.in/reader036/viewer/2022071018/5fd2385f214b8847617104da/html5/thumbnails/55.jpg)
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
Perl Dancer Conference 2016
![Page 56: No Act on ACT · ModernPerlforwebapplications PSGI/Plack Webapplicationframework(Dancer2) Webframework(Bootstrap,Jquery) DBIx::Class Mooandfriends Testing](https://reader036.fdocuments.in/reader036/viewer/2022071018/5fd2385f214b8847617104da/html5/thumbnails/56.jpg)
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
Call for developers
https://github.com/interchange/Perl-Dancer-Conference
![Page 57: No Act on ACT · ModernPerlforwebapplications PSGI/Plack Webapplicationframework(Dancer2) Webframework(Bootstrap,Jquery) DBIx::Class Mooandfriends Testing](https://reader036.fdocuments.in/reader036/viewer/2022071018/5fd2385f214b8847617104da/html5/thumbnails/57.jpg)
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
...
.
Questions
Questions?