/
default.htm
500 lines (484 loc) · 23.9 KB
/
default.htm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
<!DOCTYPE html>
<html>
<head>
<title>AWS Examples</title>
<link href="/img/logo.png" rel="icon">
<link href="css/bootstrap.min.css" rel="stylesheet" />
</head>
<body>
<style>
body {
text-align: center;
line-height: 150%;
background: #ffe9cf;
}
a {
color: #428bca;
}
a:hover, a:focus {
color: #2a6496;
text-decoration: none;
}
#body {
width: 980px;
margin: auto;
}
#content {
text-align: left;
padding: 70px 0 0 0;
}
.github-src, .aws-services {
display: inline-block;
vertical-align: middle;
background: url(/img/github-icon.png) no-repeat;
width: 32px;
height: 32px;
margin: 0 5px 0 0;
}
.aws-services {
background: url(/img/aws-logo.png) no-repeat;
}
.app {
color: #666;
margin: 10px 0 20px 0;
background: #FFF;
border-radius: 2px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}
.app h2 {
margin: 5px 0 15px 0;
}
.app h2 b {
font-weight: normal;
color: #F8981D;
}
.app .screenshot img {
width: 470px;
float: left;
margin: 0 20px 0 0;
}
.info {
padding: 10px 0 0 0;
}
.clear {
clear: both;
display: block;
}
#header {
text-align: left;
border-bottom: 1px solid #ccc;
box-shadow: #e6e6e6 0 1px 3px;
background-color: #f7f7f7;
position: fixed;
width: 100%;
left: 0;
top: 0;
text-align: center;
color: #444;
}
.links h4 {
margin: 20px 0 10px 0;
}
.aws-links {
float: right;
}
.aws-icon {
display: block;
height: 32px;
width: 30px;
background-image: url(https://raw.githubusercontent.com/ServiceStack/Assets/master/img/aws/aws-sprite.png);
background-position: 0 -59px;
margin: 5px 10px 0 0;
}
.s3 {
background-position: -96px -59px;
}
.dynamodb {
background-position: -128px -59px;
}
.sqs {
background-position: -352px -59px;
}
.ses {
background-position: -288px -59px;
}
.links ul {
margin: 0 0 0 465px;
}
.links ul ul {
margin: 0;
padding: 0 0 0 20px;
}
.links li {
list-style: square;
color: #999;
font-size: 13px;
}
</style>
<div id="body">
<div id="header">
<h1 style="font-size:18px; margin-left: -15px;">
<a href="https://github.com/ServiceStack/ServiceStack.Aws/" title="ServiceStack + AWS">
<img src="/img/logo.png" style="vertical-align: middle" />
</a>
ServiceStack + AWS Live Examples
</h1>
</div>
<div id="content">
<div class="app" id="awsrazor">
<div class="screenshot">
<a href="http://awsrazor.servicestack.net">
<img src="https://raw.githubusercontent.com/ServiceStack/Assets/master/img/aws/apps/screenshots/awsrazor.png" />
</a>
</div>
<div class="info">
<div class="aws-links">
<a href="http://aws.amazon.com" class="aws-services" title="AWS Services"></a>
<a href="https://aws.amazon.com/s3/" class="aws-icon s3" title="S3 - Simple Storage Service"></a>
<a href="https://aws.amazon.com/dynamodb/" class="aws-icon dynamodb" title="DynamoDB - NoSQL Document DB"></a>
</div>
<h2><a href="http://awsrazor.servicestack.net"><b>AWS</b> Razor Rockstars</a></h2>
<p>
Version of Razor Rockstars
<a href="http://razor.servicestack.net" target="_blank" class="glyphicon glyphicon-new-window"></a>
showcasing ServiceStack's support for dynamic websites where all Razor Views and Markdown Content are
decoupled and sourced from a S3 bucket. The Rockstars database rewritten to use a DynamoDB data store with PocoDynamo.
</p>
<p>
AWS Rockstars supports
<a href="https://github.com/ServiceStackApps/RazorRockstars/blob/e159bb9d2e27eba7fc1a9ce1822b479602de8e0f/src/RazorRockstars.S3/RockstarsService.cs#L139">
live-reloading Razor Views and Markdown Content
</a>
as source files in S3 bucket are modified at runtime.
</p>
<div class="links">
<h4>
<a href="https://github.com/ServiceStackApps/RazorRockstars/tree/master/src/RazorRockstars.S3">
<span class="github-src"></span>
Source Code
</a>
</h4>
<ul>
<li>
<a href="https://github.com/ServiceStackApps/RazorRockstars/blob/master/src/RazorRockstars.S3/AppHost.cs">
AppHost.cs
</a>
- App Host configuration
</li>
<li>
<a href="https://github.com/ServiceStackApps/RazorRockstars/blob/master/src/RazorRockstars.S3/RockstarsService.cs">
RockstarsService.cs
</a>
- DynamoDB Services Implementation
</li>
<li>
<a href="https://github.com/ServiceStackApps/RazorRockstars/blob/master/src/RazorRockstars.S3/ImportIntoS3Tasks.cs">
ImportIntoS3Tasks.cs
</a>
- Import existing RazorRockstar files into S3
</li>
</ul>
<span class="clear"></span>
</div>
</div>
</div>
<div class="app" id="imgur">
<div class="screenshot">
<a href="/imgur/">
<img src="https://raw.githubusercontent.com/ServiceStack/Assets/master/img/aws/apps/screenshots/imgur.png" />
</a>
</div>
<div class="info">
<div class="aws-links">
<a href="http://aws.amazon.com" class="aws-services" title="AWS Services"></a>
<a href="https://aws.amazon.com/s3/" class="aws-icon s3" title="S3 - Simple Storage Service"></a>
</div>
<h2><a href="/imgur/"><b>AWS</b> Imgur</a></h2>
<p>
Version of Imgur
<a href="https://github.com/ServiceStackApps/Imgur" target="_blank" class="glyphicon glyphicon-new-window"></a>
used to resize uploaded images into diffferent iOS device resolutions and store them in an S3 bucket.
</p>
<p>
AWS Imgur was rewritten to use the ServiceStack's
<a href="https://github.com/ServiceStack/ServiceStack/wiki/Virtual-file-system">
Virtual File System
</a>
which supports multiple alternative File Storage backends including S3 bucket or Local FileSystem (default)
by commenting out
<a href="https://github.com/ServiceStackApps/AwsApps/blob/72b4f6606c627d75c304e95db5ce4174a33dffcb/src/AwsApps/AppHost.cs#L43-L44">
2 lines of configuration for S3
</a>
</p>
<p>
All images are served directly from S3 bucket for maximum responsiveness
</p>
<div class="links">
<h4>
<a href="https://github.com/ServiceStackApps/AwsApps/tree/master/src/AwsApps/imgur">
<span class="github-src"></span>
Source Code
</a>
</h4>
<ul>
<li>
<a href="https://github.com/ServiceStackApps/AwsApps/blob/master/src/AwsApps/imgur/default.htm">
default.htm
</a>
- Entire UI in 1 HTML page using less than 30 lines of JavaScript
</li>
<li>
<a href="https://github.com/ServiceStackApps/AwsApps/blob/master/src/AwsApps/imgur/ImageService.cs">
ImageService.cs
</a>
- Server back-end in 1 .cs using less than 200 lines of C#
</li>
</ul>
<span class="clear"></span>
</div>
</div>
</div>
<div class="app" id="emailcontacts">
<div class="screenshot">
<a href="/emailcontacts/">
<img src="https://raw.githubusercontent.com/ServiceStack/Assets/master/img/aws/apps/screenshots/emailcontacts.png" />
</a>
</div>
<div class="info">
<div class="aws-links">
<a href="http://aws.amazon.com" class="aws-services" title="AWS Services"></a>
<a href="https://aws.amazon.com/dynamodb/" class="aws-icon dynamodb" title="DynamoDB - NoSQL Document DB"></a>
<a href="https://aws.amazon.com/sqs/" class="aws-icon sqs" title="SQS - Simple Queue Service"></a>
<a href="https://aws.amazon.com/ses/" class="aws-icon ses" title="SES - Simple Email Service"></a>
</div>
<h2><a href="/emailcontacts/"><b>AWS</b> Email Contacts</a></h2>
<p>
Version of Email Contacts
<a href="https://github.com/ServiceStackApps/EmailContacts" target="_blank" class="glyphicon glyphicon-new-window"></a>
where the same long-running Service is executed from both HTTP and MQ Hosts
by just changing which url the
<a href="https://github.com/ServiceStackApps/AwsApps/blob/72b4f6606c627d75c304e95db5ce4174a33dffcb/src/AwsApps/emailcontacts/default.cshtml#L95-L96">
HTML Form is posted to.
</a>
Since there's a
<a href="https://github.com/ServiceStackApps/AwsApps/blob/72b4f6606c627d75c304e95db5ce4174a33dffcb/src/AwsApps/AppHost.cs#L92-L102">
registered SQS MQ Server
</a>
the "One Way" pre-defined route automatically publishes Requests to the registered SQS MQ broker and executed on a background Thread.
</p>
<p>
AWS Email Contacts has been re-written to leverage AWS with Configuration,
Contacts and their Emails stored in DynamoDB, Amazon SQS used to process MQ requests and Emails sent with Amazon SES.
</p>
<div class="links">
<h4>
<a href="https://github.com/ServiceStackApps/AwsApps/tree/master/src/AwsApps/emailcontacts">
<span class="github-src"></span>
Source Code
</a>
</h4>
<ul>
<li>
<a href="https://github.com/ServiceStackApps/AwsApps/blob/master/src/AwsApps/emailcontacts/EmailContactServices.cs">
EmailContactServices.cs
</a>
- Server implementation
</li>
<li>
<a href="https://github.com/ServiceStackApps/AwsApps/blob/master/src/AwsApps/emailcontacts/ServiceModel.cs">
ServiceModel.cs
</a>
- Data Models and DTO Types
</li>
<li>
<a href="https://github.com/ServiceStackApps/AwsApps/blob/master/src/AwsApps/emailcontacts/default.cshtml">
default.cshtml
</a>
- Entire UI in 1 HTML, inc. validation, auto-binding with ss-utils.js
</li>
</ul>
<span class="clear"></span>
</div>
</div>
</div>
<div class="app" id="todos">
<div class="screenshot">
<a href="/todo/">
<img src="https://raw.githubusercontent.com/ServiceStack/Assets/master/img/aws/apps/screenshots/todos.png" />
</a>
</div>
<div class="info">
<div class="aws-links">
<a href="http://aws.amazon.com" class="aws-services" title="AWS Services"></a>
<a href="https://aws.amazon.com/dynamodb/" class="aws-icon dynamodb" title="DynamoDB - NoSQL Document DB"></a>
</div>
<h2><a href="/todo/"><b>AWS</b> Todos</a></h2>
<p>
Version of TODO App
<a href="https://github.com/ServiceStackApps/Todos" target="_blank" class="glyphicon glyphicon-new-window"></a>
that has been rewritten to use a DynamoDB back-end using PocoDynamo.
</p>
<p>
The
<a href="http://todomvc.com/examples/backbone/">Backbone TODO App</a>
is a famous minimal example used as a "Hello, World" example to showcase and compare JavaScript client frameworks.
This example also serves as a good illustration of the clean and minimal code it takes to
build REST Services with ServiceStack which promotes a
<a href="http://stackoverflow.com/a/32940275/85785">
simple, friction-free dev experience
</a>
where the same
<a href="https://github.com/ServiceStackApps/AwsApps/blob/72b4f6606c627d75c304e95db5ce4174a33dffcb/src/AwsApps/todo/TodoService.cs#L9-L16">
Todo POCO
</a>
can be used as-is in ServiceStack's typed Redis, OrmLite (RDBMS) and PocoDynamo clients.
</p>
<div class="links">
<h4>
<a href="https://github.com/ServiceStackApps/AwsApps/tree/master/src/AwsApps/todo">
<span class="github-src"></span>
Source Code
</a>
</h4>
<ul>
<li>
<a href="https://github.com/ServiceStackApps/AwsApps/blob/master/src/AwsApps/todo/TodoService.cs">
TodoService.cs
</a>
- Entire server back-end in 1 .cs using less than 50 lines of C#
</li>
<li>
<a href="https://github.com/ServiceStackApps/AwsApps/blob/master/src/AwsApps/todo/default.htm">
default.htm
</a>
- Backbone TODO App in 1 HTML page
</li>
</ul>
<span class="clear"></span>
</div>
</div>
</div>
<div class="app" id="restfiles">
<div class="screenshot">
<a href="/restfiles/">
<img src="https://raw.githubusercontent.com/ServiceStack/Assets/master/img/aws/apps/screenshots/restfiles.png" />
</a>
</div>
<div class="info">
<div class="aws-links">
<a href="http://aws.amazon.com" class="aws-services" title="AWS Services"></a>
<a href="https://aws.amazon.com/s3/" class="aws-icon s3" title="S3 - Simple Storage Service"></a>
</div>
<h2><a href="/restfiles/"><b>AWS</b> REST Files</a></h2>
<p>
Version of REST Files
<a href="https://github.com/ServiceStackApps/RestFiles" target="_blank" class="glyphicon glyphicon-new-window"></a>
powering a GitHub-like browser with complete remote file management behind a REST API over an S3 Bucket.
</p>
<p>
AWS REST Files was rewritten to use the ServiceStack's
<a href="https://github.com/ServiceStack/ServiceStack/wiki/Virtual-file-system">
Virtual File System
</a>
which supports multiple alternative File Storage backends including S3 bucket or Local FileSystem (default)
by commenting out
<a href="https://github.com/ServiceStackApps/AwsApps/blob/72b4f6606c627d75c304e95db5ce4174a33dffcb/src/AwsApps/AppHost.cs#L43-L44">
2 lines of configuration for S3
</a>
</p>
<div class="links">
<h4>
<a href="https://github.com/ServiceStackApps/AwsApps/tree/master/src/AwsApps/restfiles">
<span class="github-src"></span>
Source Code
</a>
</h4>
<ul>
<li>
<a href="https://github.com/ServiceStackApps/AwsApps/blob/master/src/AwsApps/restfiles/FilesService.cs">
FilesService.cs
</a>
- Files server back-end in 1 .cs
</li>
<li>
<a href="https://github.com/ServiceStackApps/AwsApps/blob/master/src/AwsApps/restfiles/default.htm">
default.htm
</a>
- Entire UI in 1 static HTML
</li>
</ul>
<span class="clear"></span>
</div>
</div>
</div>
<div class="app" id="awsauth">
<div class="screenshot">
<a href="/awsauth/">
<img src="https://raw.githubusercontent.com/ServiceStack/Assets/master/img/aws/apps/screenshots/awsauth.png" />
</a>
</div>
<div class="info">
<div class="aws-links">
<a href="http://aws.amazon.com" class="aws-services" title="AWS Services"></a>
<a href="https://aws.amazon.com/dynamodb/" class="aws-icon dynamodb" title="DynamoDB - NoSQL Document DB"></a>
</div>
<h2><a href="/awsauth/"><b>AWS</b> Auth</a></h2>
<p>
Version of MVC Auth
<a href="http://mvc.servicestack.net/" target="_blank" class="glyphicon glyphicon-new-window"></a>
providing an example of how to easily configure an App to support multiple Auth Providers.
</p>
<p>
MVC Auth has been rewritten to store
<a href="https://github.com/ServiceStackApps/AwsApps/blob/72b4f6606c627d75c304e95db5ce4174a33dffcb/src/AwsApps/AppHost.cs#L54-L56">
User Auth
</a>
and
<a href="https://github.com/ServiceStackApps/AwsApps/blob/72b4f6606c627d75c304e95db5ce4174a33dffcb/src/AwsApps/AppHost.cs#L29-L33">
production config
</a>
in DynamoDb, taking precedence before falling back to Web.config
<a href="https://github.com/ServiceStack/ServiceStack/wiki/AppSettings">
AppSettings
</a>
</p>
<p>
AWS Auth supports Registering User Credentials, HTTP Basic and HTTP Digest Auth,
Twitter, Facebook, Google and LinkedIn OAuth providers
as well as Yahoo and Custom Open Id providers.
</p>
<div class="links">
<h4>
<a href="https://github.com/ServiceStackApps/AwsApps/tree/master/src/AwsApps/awsauth">
<span class="github-src"></span>
Source Code
</a>
</h4>
<ul>
<li>
<a href="https://github.com/ServiceStackApps/AwsApps/blob/master/src/AwsApps/awsauth/AwsAuthService.cs">
AwsAuthService.cs
</a>
- Service to Reset, Create and return Authenticated User Info
</li>
<li>
<a href="https://github.com/ServiceStackApps/AwsApps/blob/master/src/AwsApps/awsauth/default.cshtml">
default.htm
</a>
- Entire UI in 1 Razor .cshtml
</li>
<li>
<a href="https://github.com/ServiceStackApps/AwsApps/blob/72b4f6606c627d75c304e95db5ce4174a33dffcb/src/AwsApps/AdminTasks.cs#L58">
AdminTasks.cs
</a>
- Import production local appsettings.txt config into DynamoDB
</li>
</ul>
<span class="clear"></span>
</div>
</div>
</div>
</div>
</div>
</body>
</html>