100% found this document useful (3 votes)
14 views

(Ebook) Web Development with Clojure: Build Bulletproof Web Apps with Less Code by Dmitri Sotnikov ISBN 9781680500820, 1680500821instant download

Ebook

Uploaded by

zorvenoan
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (3 votes)
14 views

(Ebook) Web Development with Clojure: Build Bulletproof Web Apps with Less Code by Dmitri Sotnikov ISBN 9781680500820, 1680500821instant download

Ebook

Uploaded by

zorvenoan
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 49

(Ebook) Web Development with Clojure: Build

Bulletproof Web Apps with Less Code by Dmitri


Sotnikov ISBN 9781680500820, 1680500821 download

https://ebooknice.com/product/web-development-with-clojure-build-
bulletproof-web-apps-with-less-code-5767486

Explore and download more ebooks at ebooknice.com


We have selected some products that you may be interested in
Click the link to download now or visit ebooknice.com
for more options!.

(Ebook) Web Development with Clojure: Build Bulletproof Web Apps


with Less Code by Dmitri Sotnikov ISBN 9781937785642, 1937785645

https://ebooknice.com/product/web-development-with-clojure-build-
bulletproof-web-apps-with-less-code-4727458

(Ebook) Web Development with Clojure: Build Bulletproof Web Apps


with Less Code, 3rd Edition by Dmitri Sotnikov; Scot Brown ISBN
9781680506822, 9781680508833, 168050682X, 1680508830

https://ebooknice.com/product/web-development-with-clojure-build-
bulletproof-web-apps-with-less-code-3rd-edition-34790336

(Ebook) Web Development with Clojure: Build Large, Maintainable


Web Applications Interactively by Dmitri Sotnikov, Scot Brown
ISBN 9781680506822, 168050682X

https://ebooknice.com/product/web-development-with-clojure-build-large-
maintainable-web-applications-interactively-23668992

(Ebook) Web Development with Clojure: Build Large, Maintainable


Web Applications Interactively, 3rd Edition by Sotnikov, Dmitri,
Brown, Scot ISBN 9781680506822, 168050682X

https://ebooknice.com/product/web-development-with-clojure-build-large-
maintainable-web-applications-interactively-3rd-edition-37295682
(Ebook) Web Development with Clojure, 3rd Edition by Dmitri
Sotnikov; Scot Brown ISBN 9781680506822, 168050682X

https://ebooknice.com/product/web-development-with-clojure-3rd-
edition-23919040

(Ebook) Async JavaScript: Build More Responsive Apps with Less


Code by Trevor Burnham ISBN 9781937785277, 1937785270

https://ebooknice.com/product/async-javascript-build-more-responsive-apps-
with-less-code-2624244

(Ebook) Async JavaScript: Build More Responsive Apps with Less


Code by Trevor Burnham ISBN 9781937785277, 1937785270

https://ebooknice.com/product/async-javascript-build-more-responsive-apps-
with-less-code-43297896

(Ebook) Build Websites with Hugo: Fast Web Development with


Markdown by Brian P. Hogan ISBN 9781680507263, 1680507265

https://ebooknice.com/product/build-websites-with-hugo-fast-web-
development-with-markdown-22615372

(Ebook) Web App Development and Real-Time Web Analytics with


Python: Develop and Integrate Machine Learning Algorithms into
Web Apps by Nokeri, Tshepo Chris ISBN 9781484277829, 1484277821

https://ebooknice.com/product/web-app-development-and-real-time-web-
analytics-with-python-develop-and-integrate-machine-learning-algorithms-
into-web-apps-36127710
P
repa
redexc
lus
ive
lyfo
rBobE
rb www
.a
ll
itebook
s.com
*
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
*

ß
UnderCon s
truction: Theboo kyou’rereadingiss t
il
lunde r
deve
lopm ent
.Asp a
rtofourBet
aboo kprogram,w e’rerel
e a
sing
th
iscop ywellbe foreano rma
lboo kwou ldbere leased.That
wayyou’reabletoge tth
iscontentacoupleo f monthsbefore
it

sa va
i
lableinfinishedform,andwe ’
llgetfeedb a
c kto make
thebooke venbe tter
.Theideaisthateveryonew ins
!

Bewa rned: Theboo kh asnoth ada fu


lltechnicaledit
,so i
tw il
lcon t
ainerror
s.
Ithasnotbeencop yedited,soitwil
lbe ful
lo ftypos,spel
lingm istakes,andthe
occa
sionalcreat
ivep ieceofg ramm ar.Andthe re’sbeennoe f
fortspen tdoing
layout
,soyou ’
llfindb adp ageb reaks
,o ver
-longcode lines,incorre c
th yphen-
at
ion,andalltheo the ruglythingsthatyouwou ldn ’
texpe c
ttosee ina fini
shed
book
. I
talsodoe sn'th avean inde x
. Wec an’
tbehe ldl
iableifyouu sethisbook
totrytocreateasp iffyapp l
i c
ationandyousomehowendupw ithas trangel
y
shapedfarm imp lemen tinstead.Despi
tea l
lthis,wethin kyou ’
llen joyit
!

DownloadUpdates
: Throughoutthisprocessyou’
l
lbeab letogetupda
ted
ebooksf
romyouraccoun
tatpragprog
.com t. Wh
/my_accoun enthebooki
scom-
p
lete
,you’l
lgetthef
ina
lvers
ion(andsub sequentupda
tes
)fromthesamead-
dre
ss
.

Sendusyour
feedback
:In theme an
time,we’
dapp re c
i a
teyousend
ingusyou
r
feedbac
konthi
sbookatpragprog
.com
/t
it
les
/dswdc
loj2 ta,o
/erra rbyus
ingthe
lin
ks
atthebot
tomofeachpage .

Th
ankyoufo
rbe
ingp
arto
ftheP
ragm
ati
ccommun
ity
!

Da
ve&And
y

*
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***

P
repa
redexc
lus
ive
lyfo
rBobE
rb www
.a
ll
itebook
s.com
*
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
*

Web Deve
lopmen
twi
th C
lojure
,
2nd Edi
tion
Bu
ild Bu
lle
tproo
f WebApps w
ithLess Code

Dm
it
riSo
tni
kov

TheP
ragma
tic Bookshe
lf
*
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
**
D*
*
a
l*
l*
*
a
s*
,*
*
T*
e*
x
as•R
ale
igh
,No
rthC
aro
l
ina

P
repa
redexc
lus
ive
lyfo
rBobE
rb www
.a
ll
itebook
s.com
*
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
*

Manyo fthedes ignat


ionsusedby manu fac
tu rersandse l
lerstod is
tinguishthei
rp roduc ts
arecla
imedast radema rks
. Wherethosedes
igna tionsappearinthisbook ,andTheP ragma tic
Programme rs
,LLC wasawa reofat rademarkc laim,thedesignationshavebeenp rintedin
init
ialcapi
tallettersorinallcapi
tals.ThePragma t
icSta
rterKit
,TheP ragmat
icP rogramme r
,
Pragma t
icProg ramm ing,PragmaticBookshelf,P ragP
rogandthel inkingg devicea retrade-
markso fTheP ragma t
icP rogramme rs,LLC
.
Everyprecautionwastakenintheprepa ra
tiono
fthisbook. However
,thepub
lishe
rassumes
norespons ib
ili
tyforer
rorso romissions,orfo
rdamagestha t mayresu
ltf
romthe useof
information(includ
ingprograml
istings)conta
inedherein
.
OurP ragma t
iccourses
, wo rkshops ,andotherproduc
tscanhelpyouandyourteamc rea
te
bette
rso ftwareand have mo refun .Fo r mo
reinfo
rmation
,as we
llasthela
tes
tP ragmatic
ti
tles,pleasevis
itusa thttps://pragprog
.com.

Fo
rin
terna
tiona
lrigh
ts,p
leasecon
tac
trigh
ts@pragprog .
.com

Cop
yrigh
t©2016TheP
ragm
ati
cProg
ramme
rs
,LLC
.
A
l
lrigh
tsre
ser
ved
.

Nopar
tofth
ispubl
icat
ion ma
yberep roduced
,sto
redinaret
rieva
ls y
stem,ort
ran
smi
tted,
inanyfo
rm,o
rb yan
yme ans
,ele
ctron
i c
,me ch
anic
al
,photo
cop y
ing,reco
rding
,oro
the
rwise
,
w
ithou
tthepr
iorconsen
tofthepubli
sher.

Pr
intedintheUn i
tedState
sofAmer
ica
.
ISBN-13
:978-1-68050-082
-0
Encodedu s
ingthefinesta
cid
-f
reeh
igh-en
trop
ybin
aryd
igi
ts
.
Bookvers
ion:B2.0—Feb ru
ary14
,2016

*
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***

P
repa
redexc
lus
ive
lyfo
rBobE
rb www
.a
ll
itebook
s.com
*
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
*

Contents

ChangesintheBe
taRe
leases . . . . . . . . v
ii

In
troduc
tion. . . . . . . . . . . . . ix

1
. Ge
ttingYourFeet Wet. . . . . . . . . . . 1
Se
t UpYou r Env
ironmen
t 1
Bui
ldYourF i
rst WebApp 3
Re
fineYourApp 8
WhatYou’veLearned 23

2
. C
lojure WebS tack . . . . . . . . . . . 25
Route Requests w
ith R
ing 26
Extend Ring 32
De
finethe Rou tes w
ith Compo
jure 35
WhatYou’ veLea rned 39

3
. LuminusArchitecture . . . . . . . . . . 41
ManagetheProject 41
ThinkinTermso fApplica
tion Componen
ts 43
HTMLTemp lat
ingus ingSelmer 51
WhatYou’veLea rned 58

4
. AddClojureSc ript . . . . . . . . . . . 61
Understand Cloju reScr
ipt 61
Conf
igu re Clo
ju reScrip
tSuppo
rt 63
Add ClojureScriptSuppo rt 63
Bui
ldthe U Iw ith Reagent 66
WhatYou’ veLea rned 79

*
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***

P
repa
redexc
lus
ive
lyfo
rBobE
rb www
.a
ll
itebook
s.com
*
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
* Con
ten
ts•
iv

5
. Rea
l-time Messaging W
ith Websocke ts . . . . . . 81
Set Up WebsocketsontheSe rve
r 81
Make Websocketsfrom Clo
jureScrip
t 85
Websockets Us
ingSente 89

6
. Wr
itingRESTfu
l WebServ
ices . . . . . . . . 97
Use Compo
jure
-API 97
WhatYou’veLearned 113

7
. DatabaseAccess . . . . . . . . . . . 115
Work with Re
lat
ional Da
tabases 115
UseYesq l 121
Generate Repor
ts 124
WhatYou’ veLearned 136

8
. P
ictu re Ga
llery . . . . . . . . . . . . 137
The Developmen tP rocess 137
What’ sina Ga l
lery 138
CreatetheApp lication 140
Conf
igu rethe Da tabase 141
TaskA :Accoun t Reg ist ration 143
Task B:Log inandLogou t 162
Task C: UploadingP ictu res 171
Task D :DisplayingP ictu res 180
Task E: Delet
ingP ic tu res 192
TaskF :Accoun t De le t
ion 195
AddingSome Co lor 199

9
. F
inishingTouches . . . . . . . . . . . 205
Uni
tTests 205
PackagetheApplica
tion 211
WhatYou’ veLea
rned 221

A1
. C
lo ju
reP rimer . . . . . . . . . . . . 223
AFunc tiona
lPe rspective 223
DataTypes 225
UsingFunc t
ions 226
AnonymousFunc t
ions 227
NamedFunc t
ions 227
Higher-OrderFunc tions 229
Closures 230
Threading Expressions 231
*
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***

P
repa
redexc
lus
ive
lyfo
rBobE
rb www
.a
ll
itebook
s.com
*
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
* Con
ten
ts•
v

BeingLa zy 232
Structuringthe Code 232
Destructuring Data 233
Namespaces 235
Dynam icVa riables 237
Polymo rphism 237
Whatabou tG lobalState? 240
Wr
iting CodeTha tW ri
tes Codefo
rYou 241
The Read -Eva lua
te-Pr
in tLoop 243
Call
ing Ou ttoJava 243
Call
ing Me thods 244
Summa ry 244

A2
. Authent
icat
ion wi
th OAu
th . . . . . . . . . 247
Why Use OAuth 247

A3
. Documen t-O
rien
ted Da
tabaseAccess . . . . . . 253
Pick
ingthe Righ
t Da
tabase 253
Using CouchDB 254
Using MongoDB 257

A4
. Wr
itingREST ful WebServ
ices W
ithL
ibe
rato
r . . . . 261
Us
ingL iberato
r 261
Def
in ing Resources 262
PuttingItA l
lToge the
r 267

A5
. Le
iningenTemp
lates . . . . . . . . . . 273
What’sinaTempla
te 273

*
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***

P
repa
redexc
lus
ive
lyfo
rBobE
rb www
.a
ll
itebook
s.com
*
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
*

ChangesintheBetaRe
leases
Be
ta2
,Feb
rua
ry14
•Exampleshavebeenupdatedtothelates
tvers
iono
ftheLuminustemp
late
.
Thesourcepathshavebeenchanged ,andtheSwagge
rexamplesnowuse
thela
testvers
ionofcompo jure
-api.

•Fixedtypos andimp
roved ph
ras
ing based on e
rra
ta and be
tareade
r
feedback
.

•Add
itiona
lexp
lana
tions have been addedfo
rsec
tionstha
t we
refound
con
fusing.

•Newappend
ixonus
ing OAu
th w
ithTw
itte
r.

Be
ta1
,Feb
rua
ry3

*
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***

P
repa
redexc
lus
ive
lyfo
rBobE
rb www
.a
ll
itebook
s.com repo
rte
rra
tum• d
iscu
ss
*
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
*

Introduct
ion
Thisbook’
scove rhasabonsa itreeonit
.Ichosei ttorepresenteleganceand
simpl
ici
ty,asthesequa l
ities make Clo
juresuchana t
tractivelanguage.A
goodsoftware p
rojec
tislikea bonsai. You haveto meticulouslycraf
titto
taketheshapeyou wan t,andthetoo lyou useshou ld makei ta pleasan
t
exper
ience
.Ihopetoconv inceyouhe rethatC lojureisthattool.

Wha
tYouNeed
Thisbookisaimeda treadersofallleve
ls. Whi
lehavingsomebas icpro
fic
iency
wi
thfunc t
ionalp rogramm ing wi
ll be help
ful
,it’s by no meansrequiredto
fol
lowthe materialinthisbook.Ifyou’renotaC lo
jureuseralready
,thisbook
isagoods tart
ingpo int,asitfocusesonapp lyingthelanguagetosolvecon -
cretep
roblems.Th is meanswe’l
lfocusonasma llnumbe ro
flanguagefeatures
neededtobuildcommon webapp licat
ions.

WhyC
loju
re?
Clo
ju reisasma lllanguagethathass implic
ityandcorrectnessasi
tsprimary
goals
.Be ingafunct
ionallanguage,itemphas i
zesimmu tabi
li
tyanddeclara
tive
programm ing
. Asyou’ l
lseeinth is book,thesefea
tu res makeiteasy and
idioma ticto wr
itecleanandco rrectcode.

Therea re manylanguagestochoosefromandas manyop inionson wha t


makes anyoneo fthem agoodlanguage . Somelanguages ares imple but
verbose.You’
veprobab
lyhea rdpeop
lesaythatverbosi
tyreal
lydoesn ’
t matte
r,
thea rgumentbeingthat whentwolanguagesareTu ringcomplete,anything
thatcanbe w ri
tteninonelanguagecana lsobe w r
ittenintheo therwitha
bi
to fextracode
.

Ithinkthat
’sm
iss
ingthepo in
t, however
.Therealquest
ionis not whe
ther
someth
ingcanbeexpressedinpr
inciple
.It’
show we
llthelanguage mapsto
theproblembe
ingso
lved. Onelanguage wi
llle
tyouthinkintermso fyour

*
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***

P
repa
redexc
lus
ive
lyfo
rBobE
rb www
.a
ll
itebook
s.com repo
rte
rra
tum• d
iscu
ss
*
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
* In
trodu
ction•
x

prob
lemdomain wh
ileano
the
rwi
llfo
rceyoutot
rans
latethep
rob
lemtoi
ts
const
ruc
ts.

Thelatterisof
tented
iousandra re
lyenjoyab
le.Youend up w
rit
ingaloto
f
boi
lerpla
tecodeandcons tan
tlyrepeat
ingyoursel
f.The
re’
sace r
tainamoun
t
ofironyinvo
lvedinhavingto wr
iterepet
it
ivecode.

Otherlanguages a
ren’tverbose andthey p rov
ide many di
ffe
renttoo
lsfo r
solv
ingproblems
.Un for
tunate
ly,having manytoolsdoesno
tdirect
lyt
ransla
te
intohigherproduct
ivi
ty.

The morefeatu
resthereare
,the morethingsyouhavetokeepinyou rhead
to work wi
ththelanguagee f
fect
ively
. With manylanguagesIf ind mysel
f
cons
tantlyexpend
ing menta
loverheadthink
ingabouta
llthedif
ferentfea
tures
andhowtheyin terac
twithoneano ther
.

What mat
tersto meinalanguageis whetherIcan useitw i
thoutthinking
abouti
t. Whenalanguageislack
inginexpress
ivenessI’
macu te
lyawarethat
I’
mwrit
ingcodethatIshouldn’tbe. Ontheotherhand, whenalanguagehas
too manyfeatu
resIoftenfeeloverwhelmedorIge tdis
tractedplay
ing with
them.

To makeanana logy w
ith mathemat
ics
, hav
ingageneralfo
rmulatha
tyou
canderiveothe
rsfromisbe t
terthanhavingto memo
rizea who
lebuncho
f
formulasfo
rspecif
icprob
lems .

Thisis where C
lojurecomesin.Itallows ustoeasi
lyde r
iveasolut
iontoa
part
icu
larp rob
lemf romasmallsetofgeneralpa
tte
rns.Allyouneedtobecome
produc
tiveistolearnafews
imp leconceptsandabitofsyntax
.Theseconcep
ts
canthenbecomb inedina myriad waystosolveal
lk indsofprob
lems.

Why Make WebApp


sinC
loju
re?
Clo
jureboas tstensofthousandsofusers;i
t’susedinawiderangeo
fsett
ings,
includingbanksandhosp ita
ls.Clo
jureislike
lythe mos
tpopularL
ispdialec
t
todayfo rstart
ingnewdeve lopment. Despi
tebeingayounglanguage
,ithas
provenitse
lfinse r
iousp roduct
ionsystemsandthefeedbackfromusershas
beenove rwhelminglyposit
ive.

As webdevelopmentisoneofthe majordoma insfo r us


ing Clo
jure
,several
popularl
ibrar
iesandframeworkshavesproutedinthisa rea
.TheC lo
jure web
stackisbasedontheR ingand Compoju
relibrar
ies.1,2 R
ingisthebase HTTP

1
. https:/
/gi
thub
.com
/ring-clojure/r
ing
2
. https:/
/gi
thub *
*
.com*
/w *
e*
*
a *
v*
e*
j*
e*
s*
t**
er*
/*
c**
*
om*
p*
o
j*
**
ur*
e**
***
***
***
***
***
***
***
***
***
***
***
***
***
*

P
repa
redexc
lus
ive
lyfo
rBobE
rb www
.a
ll
itebook
s.com repo
rte
rra
tum• d
iscu
ss
*
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
*
W*
h*
*
y**
M
a*
*
k*
e*
**
W*
ebApp
sinC
loju
re?•
xi

lib
rary,wh
ileCompojureprov
idesrou
tingontopo
fit
.Inthefo
llowingchapte
rs
you’l
lbecomefamil
iarwiththewebstackandhowtouseitef
fect
ivelytobui
ld
your webapp
lica
tions
.

Thereare many p
lat
formsfo
r do
ing web deve
lopmen
t,so whyshou
ldyou
choose C
loju
reoverothe
ropt
ions?

Wel
l,conside
rthoseopt
ions. Manypopu
larplatfo
rmsforceyouto maket rade
-
of
fs.Somep lat
formslackperfo
rmance,othersrequi
realotofboile
rplate,and
otherslacktheinf
rastruc
turenecessa
ryforreal-wor
ldapplica
tions.

Clo
jureadd ressesthequestionso fperformanceandinfras
truc
turebybe ing
ahos tedlanguage .TheJavaV ir
tua l Mach
ineisa matureandhighlyper
fo r
-
mantenv ironmen twithgreattoolinganddep loymentop
tions.C
lojurebr
ings
expressivepowe rak
intotha to f RubyandPy thontoth
isexcel
lentpla
tform.
When wo rking with C
lojureyou won’ thaveto wor
ryabou tbe
inglimi
tedby
yourrun time whenyou rapplicationgrows.

The mostcommon wayto handlethe boi


lerp
latein webapplicat
ionsis by
using aframework
. There a
re manyframeworks,such as Ruby on Rails
,
Django,andSpr
ing.Theframeworksprov
idecannedfunct
ionalityneededfor
build
inga modernsite
.

Thebenefi
tsthef rameworksoffe
ralsocome withinherentcos ts
.S ince many
operat
ionsaredoneimp lic
it
ly,youhaveto memo rize whateffec
tsanyac t
ion
mighthave
.Th isopaqueness makesyourcode moredif
ficulttoreasonabou t.
Whenyouneedtodosome thingthatisatodds withthef ramewo rk’sdesign
itcanqu ick
ly becomeawkwa rdand dif
ficu
lt
. You m ight haveto dive deep
intotheinternalsofthepa r
ticu
larframeworkandc reatehacksa roundthe
expectedbehaviors
.

Soinsteadofus ingframewo rks


,Clojure makesanumbe rofpower
full
ibrar
ies
avai
lable,and wecanpu ttheselibra
riestogetherina waythat makessense
forou rpa r
ticularproject
. Asyou’
llsee, we managetoavo idhavingto wr
ite
boi
lerpla
te wh i
leretainingthecodeclarity wedesire
.AsyoureadonIth ink
you’l
lag reetha tth
is mode lhasclearadvan tagesovertheframework-based
approach.

Mygoa listog iveyoubothaso lid unders


tandingo fthe Clojure webstack
andtheexpe r
tisetoquicklyandeas i
lybuild webapp licat
ions us
ingi t
.The
fol
lowingchap terswi
llguideyouallthewayfromse ttingupyou rdevelopment
environmen ttohavingacomp letereal-wor
ldapplica t
ion.I wi
llshow wha t’
s
avai
lable,thengu ideyouins truc
tu r
ingyou rapplication us
ingthecu rrent
bestpractices
.
*
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***

P
repa
redexc
lus
ive
lyfo
rBobE
rb repo
rte
rra
tum• d
iscu
ss
*
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
*

CHAP
TER1

Gett
ingYourFeet Wet
IntheIn t
roduct
ion, on pageix
, welooked a
tsome o fthe benef
its o
fthe
funct
ionalsty
le whenitcomesto writ
ingapplica
tions.Ofcourse
,youcan’t
lea
rnalanguages implybyreadingabouti
t.Toreallyge
tafee
lforityouhave
to wr
itesomecodeyou rsel
f.

Inthischap teryou’l
ld iverightinand bu i
ldagues tbookapp l
icationtha t
al
lowsuse rstoleave messagesforeacho ther
.You’ l
lseethebas ics truc ture
ofa webapp l
ica
tionas we l
lasthetoolsnecessaryforeffec
tive C
lojuredeve l
-
opmen t
. Andyou’ l
lgetafee lfo
r how webdevelopmen tin Clo
ju re wo rks.If
you’
re newto C lo
jure,Irecommendyoureadth roughAppend ix 1,C lojure
Pr
imer,onpage223 ,forac rashcourseonthebas icconceptsandsyn tax.

The mater
ialI’l
lcove rinth isbookisbasedontheexpe r
ienceandpe rsonal
pre
ferencesoftheau thor.It’s wo
rthno t
ingtha tthereareo the requal
lyva l
id
approaches.Thelibrariesand me thodologiesthat we’l
lexp lorea rejustone
waytostructure C
lojure webapp lications,buttheyshou ldp rovideyou with
asolidstar
tingpointus ingthecu rrentbes tpract
ices.

Se
tUpYou
rEnv
ironmen
t
C
lojuredistr
ibu t
ionisp rovidedasaJARtha tneedstobeava i
lableonyou r
pro
ject’
sclasspa th.C lo
ju rerequirestheJavaV i
rtual Mach
ine(JVM )torun,
andyou w il
l need a wo rking Java Developmen tKit(JDK )
,ve rs
ion 1 .7 o
r
h
igher.1 You’l
la lso needto haveLe iningen2
ins
tal
ledino rdertoc reateand
bui
ldthep rojects.

1
. http:/
/www .orac
le.com/
technetwork
/java
/javase
/down
loads
/index
.htm
l
2
. http:/
/le
iningen *
.or*
g
/**
****
****
******
* *
*****
*****
***
***
*****
******
***
****
***
***
***
***
*

P
repa
redexc
lus
ive
lyfo
rBobE
rb repo
rte
rra
tum• d
iscu
ss
*
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
*
C*
h*
a*
*
p
t*
e*
*
r*
1
.*
**
G*
e
tt
ingYou
rFee t•
t We 2

Manag
ingP
roje
ctsw
ithLe
iningen
Lein
ingenletsyouc
reate
,bu i
ld,tes
t,package
,anddeployyou
rpro
jects
.In
other wo
rds
,it’
syourone-s
topshopforal
lyourpro
jec
t-managemen
t-re
lated
needs.

Lein
ingenisthe Clo
ju recounterpar
to f Maven,3 apopularJavabu ildtoo l.It
usesa Mavencompa t
ible dependency managemen tsystemandassuchi t
has accesstolarge and well
-ma in
tainedrepos ito
ries o
f Javalibra r
ies.In
addi
tion,Clo
jurelib
rariesarecommon lyfoundintheC lo
jarsreposi
to ry.4 This
reposi
toryisenabledbyde faultinLeiningen.

W
ithLeiningen
,youdon’ tneedto worryabou t manua
llydownloadingal
lthe
l
ibra
riesforyourpro
jec
t.Speci
fyingthetop-leve
ldependencies w
il
lcauseany
l
ibra
riesthattheydependontobepu lledinau tomat
ica
lly
.

Insta
ll
ingLeiningenisaccomp l
ishedbydownload
ingtheinsta
llat
ionscrip
t
5
fromtheoff
icialp rojec
t pageandrunningit
. Let
’stes
tthis
.C reatea new
pro
jectbydown loadingthescriptandrunn
ingthefol
lowingcommands:
wget https://raw.github.com/technomancy/leiningen/stable/bin/lein
chmod +x lein
sudo mv lein ~/bin
lein new myapp

Notetha ttheprecedingcodeexpectstha
t ~/b
in isavailab
leontheshellpa
th.
Since we’rerunn ingle
inforthefi
rsttime,itw i
ll needtoins
tal
litse
lf
. Once
theins tal
lisf
in ishedyoushou ldseethefo l
lowingou tputi
fthecommand
completessuccess fu
lly
:
Generating a project called myapp based on the 'default' template.
To see other templates (app, lein plug-in, etc), try `lein help new`.

Takea momen
ttolooka
t wha
t wehavenow
.

Anewfoldercalledmyapp hasbeenc rea


ted
,conta
iningaskele
tonapplication.
Thecodefortheapp lica
tioncanbefoundinthesrcfolder
.There we’ll have
ano
therfolderca l
ledmyapp conta
iningasing
lesourcef
ilenamedcore
.cj.Th
l is
f
ilehasthefollow ingcodeinside
:
(ns myapp.core)

(defn foo
"I don't do a whole lot."

3
. http:/
/maven .apache .org/
4
. https:/
/clo
jars.org/
5
. http:/
/le
iningen *
.or*
g*
/#*
i**
n*
s
t**
a
l*
l*
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
**

P
repa
redexc
lus
ive
lyfo
rBobE
rb repo
rte
rra
tum• d
iscu
ss
*
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
B*
*
u
i*
l*You
d rFi
rst WebApp•
3

[x]
(println x "Hello, World!"))

No
tetha
tthenamespacedec
lara
tion ma
tchesthefo
lde
rst
ruc
ture
.Sincethe
core namespaceisins
idethemyapp fo
lde
r,i
tsnameismyapp
.core.

Wha
t’s
intheLe
iningenP
roje
ctF
ile
Insidethemyapp projectfolder we haveapro
jec
t.c
ljfi
le.Thisf
ilecontainsthe
descr
iption o
f ou r app l
icat
ion. The projec
t con f
igura
tionis represented
decla
rative
lyusingregu larClo
jureda tast
ructures.Itcon
tainstheappl
ication
name ,vers
ion, URL,license,anddependenc ies
.
(defproject myapp "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url "http://example.com/FIXME"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.7.0"]])

Thepro
jec
t.c
ljf
ile w
il
lallowusto manage manyd i
ffe
ren
taspec tso fou rapp
li
-
cat
ion.Fo rexample, wecouldse
tthefoofunct
ionfromthemyapp.core names-
paceastheen trypointfortheappl
ica
tionusingthe:main key
:
(defproject myapp "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url "http://example.com/FIXME"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.7.0"]]
;;this will set foo as the main function
:main myapp.core/foo)

Thepoin
to fa
llthis
,though ,istha
tyoucan nowruntheapp l
ica
tionf
rom
thecommandlineus ingle .S
inrun incethefoofunc
tionexpec
tsanargumen
t,
you’
llhavetopassonein:
lein run Obligatory
Obligatory Hello, World!

Bu
ildYou
rFi
rst WebApp
Inthep recedingexample wecrea
tedave rysimpleappl
icat
ionthathason ly
asingledependency:the Clo
jurerunt
ime .I
fyouusedth isasthebasefo ra
webapplicat
ion,thenyou’ dhaveto w
ritealotofboi
lerp
latetogetitupand
running. Le
t’ssee how wecan use a Lein
ingentemplatetocreate a web-
appl
icat
ionp rojec
tw i
thalltheboi
lerp
la tea
lreadyse
tup .

*
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***

P
repa
redexc
lus
ive
lyfo
rBobE
rb repo
rte
rra
tum• d
iscu
ss
*
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
*
C*
h*
a*
*
p
t*
e*
*
r*
1
.*
**
G*
e
tt
ingYou
rFee t•
t We 4

Ourp rimarygoal he
reistoge ta highleve l unders
tanding ofthe p
roject
structureandgetsome thingdone
.I’l
lg lossoversomeo fthefinerdetailsin
orderto main
tainour momen tum. Don’t wor
ryifyoudon ’tfu
llyunderstand
a
llthes tepsatth
ispo int
. We’
llge
tin tothede ta
ilsinsubsequentchap ters
.

C
rea
tinganApp
li
cat
ionF
romaTemp
late
Atemplateconsistofaske letonp ro
jectthatisinstantia
ted wi
ththedes i
red
parameterssuchasthep rojectname .Anumbe rofd i
fferen
ttemp la
tesexis
t
toquicklyin
it
iali
zed i
ffe
ren tkindso fprojec
ts.Lateron we’l
levenseehow we
cancreatesuchtemp la
tesou rselves. ButtheLum inustemp lateprov
idesa
6
goodbaseand we’ l
lbeus ingi t.

Bydefaul
t,Leiningen wi
llusethelatestve rs
ionofthetemp latetha thasbeen
publ
ishedtotheC loja
rsreposi
tory7.The refo
re,theskeletonp rojectsgenerated
bythetemp late may notbeexac t
lythesameastheonesd iscussedinthe
book
.Ino rdertoensu rethatyou’reab letofollowthebookexac tly,Irecom -
mendaddingthefo l
lowingpluginreferenceinthe ~/.
lein
/pro
fi
les.c
ljfile
.This wil
l
ensurethatthep ro
jectsaregeneratedus ingthesameve rsiono fthetemp late
that wasusedinthebook .
{:user {:plugins [[luminus/lein-template "2.9.9.2"]]}}

Ino rdertote
llLein
ingenthatwewan ttouseaspecif
ictemplateforthep
roject
we mustspecifyi
tastheargumen tfo
llowingthenew parameterwhenrunn ing
le
in,fol
lowedbythenameo fthep ro
jec
t.Anyo the
rpa rameters w
il
lbepassed
inasthea rgumentstotheselec
tedtemp late
.

We’llc rea
te a new app
lica
tion byspec
ify
ingluminus asthetemp late name ,
tbook a
gues sthe nameofthep ro
ject
,andaddthe+h2 pa rametertoind icate
that we’dl
iketohaveanins tanceofthe H28 embeddedda tabaseini
tialized
forus :
lein new luminus guestbook +h2

Wha
t’s
ina WebApp
Thistypeofapplica
tionneedstosta r
t upa webse rve
rino rde
rtorun.The
template p
rojec
tcomes withanembeddedImmu tantservercon
figu
redfor
us
,and wecans tar
titbyrunn inrun a
ing le s wed
id wi
ththemyapp p ro
jec
t
9
that weusedtotesttheLein
ingense tup.

6
. h
ttp
://www
.
lum
inusweb
.ne
t/
7
. h
ttps
://c
lojars
.org
/lum
inus
/le
in-
temp
late
8
. h
ttp
://www
.h2da
tabase
.com
/htm
l/ma
in.h
tml
9
. h
ttp
://
immu
tan
t *
r*
.o *
/*
g *
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
**

P
repa
redexc
lus
ive
lyfo
rBobE
rb repo
rte
rra
tum• d
iscu
ss
*
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
B*
*
u
i*
l*You
d rFi
rst WebApp•
5

Whenyouruntheapp lica
tion
,i t maytakeal itt
le wh ile,becauseLeiningen
wi
llfi
rst havetoretr
ieveallofits dependencies. Bu tonce down loadedthe
dependencies w
il
l becachedloca llyinthe ~/.m2/repos
itoryfo
lde
r and wil
l be
avai
lableonsubsequen truns.A f
te rthedependenc iesa redownloaded,you
shouldseethefollow
ingou tputintheconso le.
lein run
21:53:07.252 [main] DEBUG org.jboss.logging - Logging Provider: Slf4jLoggerProvider
15-Jul-19 21:53:08 Nyx INFO [guestbook.handler] - nREPL server started on port 7000
15-Jul-19 21:53:08 Nyx INFO [guestbook.handler] -
-=[guestbook started successfully using the development profile]=-
21:53:08.463 INFO [org.wunderboss.web.Web] (main) Registered web context /
15-Jul-19 21:53:08 Nyx INFO [guestbook.core] - server started on port: 3000

Oncetheapp licationstarts wecanopenanewbrowserwindowandnav


iga
te
tohttp:/
/loca
lhos
t:3000 toseethehomepageofourapplica
tion
.

*
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***

P
repa
redexc
lus
ive
lyfo
rBobE
rb repo
rte
rra
tum• d
iscu
ss
*
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
*
C*
h*
a*
*
p
t*
e*
*
r*
1
.*
**
G*
e
tt
ingYou
rFee t•
t We 6

F
igu
re1—De
fau
ltPage

Nowtha t we’vecreatedourapplica
tionsandtestedthati
t’s wo
rking
,let’
stake
abrieftou rof what’sbeengene ra
tedforus.Followingarethefoldersinthe
generatedp rojec
tw iththef
ilesom it
tedfo
rb revi
ty.
├── env
│ ├── dev
│ │ ├── clj
│ │ │ └── guestbook
│ │ └── resources
│ └── prod
│ ├── clj
│ │ └── guestbook
│ └── res**
*
o*
u*
r*
*
c*
e*
*
s**
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
*

P
repa
redexc
lus
ive
lyfo
rBobE
rb repo
rte
rra
tum• d
iscu
ss
*
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
B*
*
u
i*
l*You
d rFi
rst WebApp•
7

├── resources
│ ├── docs
│ ├── migrations
│ ├── public
│ │ ├── css
│ │ ├── img
│ │ └── js
│ ├── sql
│ └── templates
├── src
│ └── clj
│ └── guestbook
│ ├── db
│ └── routes
└── test
└── clj
└── guestbook
└── test
└── db

Thistimea roundthe pro


jectstruc tu
reiss igni
ficant
ly morecomp lexthan
what wehadinthe myapp p roject. We’
lllearn whatal
lthepiecesa refo
ras
webu i
lddif
ferentapp
licat
ionsth roughou tthebook.Fo rnow, we’
lljusttake
aqu ickoverv
iewofhowthep rojectisstructuredand whattypeso ffi
lesgo
where.

The majori
tyo fou rcodelives underthesrcfo lder.Thisfo
lde rcon ta
insac l
j
folderthat’
sreservedforC loju
resou rcefi
les.Sinceou rapplicationisca l
led
guestbook,thisistherootnamespacefo rthep rojec
t.Theapplicationisfurther
brokendownin todif
feren
tnamespacesbasedonfunc t
ion. We’llexploreeach
ofthesein de tai
linthefo l
lowingchap ter
. The namespacetha tw i
ll be o
f
immed iateinteresttousistheroutes namespace .

Theroutes namespaceisreservedfo
rde f
iningappl
icat
ionroutes. Eachroute
is boundto afunc tionthatisresponsiblefo rp
rocess
ingthereques t and
genera
tingtheresponse .Thisis where majo
rityo
fou rapp
lica
tionlogic wi
ll
live
.

Thedb namespacehousestheda tabasere latedlog


icandservesasthe mode l
laye rfortheapp l
icat
ion.Theguestbook
.db.core namespaceconta
insthelog
icfo r
defining que ries and managingthe da tabase connect
ion, whi
lethe guest-
book.db
.migra
tions namespaceisrespons iblefor managingthe m
igrat
ionslogic.

Theotherfolde
rthatwil
lberelevantforourappl
icat
ionistheresourcesfo
lder
that con
tains al
lthe s
tat
ic asse
ts assoc
iated w
iththe appl
icat
ion . These
inc
lude HTMLtemp la
tes,CSSs ty
les,andsoon.Since wecrea
tedada tabase
*
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***

P
repa
redexc
lus
ive
lyfo
rBobE
rb repo
rte
rra
tum• d
iscu
ss
*
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
*
C*
h*
a*
*
p
t*
e*
*
r*
1
.*
**
G*
e
tt
ingYou
rFee t•
t We 8

fortheappl
ica
tion
,ita
lsocon
tainsam
igra
tions fo
lde
rwi
ththeSQL m
igra
tion
fi
lesini
t.

Re
fineYou
rApp
OK
,enough w
iththeove
rview
.Le
t’sw
ritesomecode
.

Manag
ingDa
taba
se M
igra
tion
s
You’ll no
ticetha tthe homepageo fou rappl
icat
ioninstructs ustorunle in
run migrateino rdertoin itial
izetheda tabase
.This wi
llusetheresources/migra-
t
ions
/20150719215253-add
-users
-tab
le.up
.sqlfi
letoini
tia
lizethedatabaseforus .No te
thattheda teonyou rfile wi
llbed ifferents
inceit
’ssettothedatetheapp l
ica -
tion wasins tantiated.

Befo
re werunthe m
igra
tions
,let’
sopen upthefi
leand upda
teittocrea
te
thetab
lesweneedfo
rou rpar
ticu
larapp
lica
tion
.Thecur
rentconten
tsshou
ld
lookasfol
lows
:
CREATE TABLE users
(id VARCHAR(20) PRIMARY KEY,
first_name VARCHAR(30),
last_name VARCHAR(30),
email VARCHAR(30),
admin BOOLEAN,
last_login TIME,
is_active BOOLEAN,
pass VARCHAR(100));

S
ince we’
re w
rit
ingaguestbookapplica
tion we’
llrep
lacethetab
lede
fin
it
ion
w
ithonethat’s mo
reappropr
iatefo
rou rapplica
tion:
gue
stbook
/re
source
s/mig
rat
ion
s/20150719215253
-add
-use
rs-
tab
le.up
.sq
l
CREATE TABLE guestbook
(id INTEGER PRIMARY KEY AUTO_INCREMENT,
name VARCHAR(30),
message VARCHAR(200),
timestamp TIMESTAMP);

We’l
lstorethe messagesalong w
iththenameoftheau thorandatimestamp
ind
icatingwhenthe messagewasw rit
ten
. We
’l
lalsocreateanauto
-genera
ted
id co
lumnto keept rack o
fthe messages
. Let
’s run our m
igrat
ions as
ins
tructed
:
lein run migrate
23:05:38 [main] DEBUG org.jboss.logging - Logging Provider: Slf4jLoggerProvider
23:05:39 INFO [migratus.core] (main) Starting migrations
23:05:39 INFO [migratus.database] (main) creating table 'schema_migrations'
*
23:05:39 INFO [m*
i*
*
g*
r*
*
a*
t*
*
u*
s*
*
.*
c*
*
o*
r*
*
e*
]*
**
(*
*
m*
a*
*
i*
n*
*
)**
*
R*
u*
*
n*
n*
*
i*
n*
*
g**
*
u*
p*
**
f*
*
o*
r*
**
[*
*
2*
0*
*
1*
5*
*
0*
7*
*
19215253]

P
repa
redexc
lus
ive
lyfo
rBobE
rb repo
rte
rra
tum• d
iscu
ss
*
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
* Re
f rApp•
ineYou 9

23:05:39 INFO [migratus.core] (main) Up 20150719215253-add-users-table


23:05:39 INFO [migratus.core] (main) Ending migrations

Nowtha
tthe m
igrat
ions havecomp
leted
,ou
rda
tabaseisreadyto useand
wecans
tar
t wo
rking w
ithit.

Que
ryingtotheDa
taba
se
Our nextstepisto w r
itetheque riestoc reateandlist messages . We’
llpu t
theseque r
iesintheresources/sq
l/quer
ies lf
.sq ile. No
tethat usingas inglef
ilefor
quer
ies wil
lno tscaleforlarge rapp l
icat
ionsandyou’ l
ll ikely wanttocreate
mul
tiplef
ilestotrackd i
ffe
ren ttypeso fque riesinthatcase.

Thefileis used bythe Yesqll ib


raryto au
tomat
ical
lycrea
teour da
tabase
accessfunct
ions.Thefunc t
ionnameisspec if
iedus
ingthe–name
: commen t
,
andthepa rame tersarepref
ixed w i
ththe:asshowninthesamp lequer
ies
al
readypopu latedinthisf
ile.10

Theexis
tingqueriesaren’tvery usefulto us,solet’
sreplacethem withnew
quer
iesthatwil
la l
lowsusto wo rk withthetab les wejustcreated
. We’
dlike
tobeab letosave messagesinou rda tabase,so we’l
lcreateaque rycalled
save
-message!. Notethatthe nameends w ith!toindicatethatit muta
tes
data
. Thesecondque ry wi
ll be usedtore trievecurrent
lys to
red messages
and we’
llcal
litget
-messages.
gue
stbook
/re
source
s/sq
l/que
rie
s.sq
l
--name:save-message!
-- creates a new message
INSERT INTO guestbook
(name, message, timestamp)
VALUES (:name, :message, :timestamp)

--name:get-messages
-- selects all available messages
SELECT * from guestbook

Theguestbook
.db.core namespacecon
tainsaca
lltotheyesq
l.core
/de ies ma
fquer c
ro.
This macro w i
llreadthe SQLque r
ies wede
finedaboveandc reate C
loju
re
funct
ionstha tca llthemusingthenamespec
ifiedus
ingthe– name : commen t
.
gue
stbook
/sr
c/c
lj
/gues
tbook
/db/co
re.
cl
j
(ns guestbook.db.core
(:require
[yesql.core :refer [defqueries]]
[config.core :refer [env]]))

10
. https:/
/gi
thub *
*
.com
/*
k*
r
i*
s*
*
j*
ae*
*
n*
k
i*
n*
*
/*
sy*
*
e*
s*
q
l**
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
*

P
repa
redexc
lus
ive
lyfo
rBobE
rb repo
rte
rra
tum• d
iscu
ss
Random documents with unrelated
content Scribd suggests to you:
“I am only the breath of the prairie, I am only the West-going
Heart, and by that authority I speak to you, and by that authority I
sow the thistle.”
“Lady Avanel, Miss Fantastic, while the star chimes are ringing
another new tune, what are you sowing from your close woven
willow basket, so full of seed?”
“I am sowing the appleseeds of Johnny Appleseed and Hunter
Kelly and the Acorns of Rabbi Terence Ezekiel and the seeds of the
Golden Rain Tree of New Harmony. But they are now breathed on by
the winds of chaos and their glory comes suddenly.”
At once in her path appear saplings, then they become full grown
trees. And there are many earthquakes, as the boughs begin, this
very midnight, to bear flowers and fruit. Then come up from the
roots explosive scraps of earth and volcano coals. Treasure sacks of
strange jewels, neither scorched nor smoked, are tossed to the
surface of the ground. These sacks are full of coins of celestial gold,
stamped with a picture of Hunter Kelly, as though he were a
President or an Emperor of some strange dominion.
From each heap of celestial gold come two or three bright spirits
with wreaths of tiny leaves or flowers round their baby foreheads,
weeping angels, an hour old, little boys, most sturdy and kicking.
And now angels will come to bear them to the houses of the
laughing people. Citizens who are not at home will find them later on
the table, and in the wood box and in the waste-basket, strange little
visitors and sons.
“Lady Avanel, Miss Fantastic, what of these children from the
sod?”
The lady answers: “These are the laughter of earth and heaven.
“These children will grow in stature and beauty for twenty years.
And then these little sons of God will see the daughters of men, that
they are fair, as it was in the book of Genesis, at the very beginning of
time. The next generation of men in Springfield, born of the loves of
these angels and daughters of the city, will be giants like Nimrod.
These giants will drive out the former institutions with their own
swords, forged for this special war. That generation will build many
mansions of divine beauty, sheltering men and near-angels alike.
And the houses of magical or heavenly aspect will mix with the plain,
grimy or earthen houses:—for the generations of Springfield will be
forever a mixed breed.”
CHAPTER XIX
HOW AT THE END OF ALL THESE WORKS
AND DAYS, AVANEL AND I RISE IN A BOAT
THROUGH THE AIR, FOLLOWING THE
GREAT NEW AMARANTH VINE FROM CAMP
LINCOLN TO THE PARAPETS OF HEAVEN.
HOW WE TRACE ITS BANYAN-LIKE
BRANCHES THROUGH THE JUNGLES OF
HEAVEN, AND HOW WE DEFY THE
HANDSOME MEDICINE MAN, DEVIL’S
GOLD, AND HOW, LATER, WE FIND THE
EMPTY SACK OF JOHNNY APPLESEED.
HOW I RETURN TO FIFTH AND MONROE
AND AVANEL IS ONE HUNDRED YEARS
AWAY.

It is many years after the triumphant return of the Amazons and


the Horseshoe Brotherhood from the battles in Asia. Avanel and I are
walking again along the Great Northwest Road, and we reach the Old
Camp Lincoln grounds where the Horseshoe Brotherhood and the
Amazons so often drill. But this evening it is deserted, with neither
tent nor horse nor rider to be seen. It is autumn and leaves whirl
between me and the Lady Avanel and too often hide her from me.
Many leaders of various sects of the city are moving about or
assembled. It has always been the holy region of the city, near the
Gardens of the Flower Religions and the Grave of Lincoln and of
Hunter Kelly.
Avanel and I are in the spirit on this evening. We walk, as though
upon carpets of glory, and we hear from the black lips of the humble
earth the cry: “Springfield Awake, Springfield Aflame.”
The old giant toy globe, that used to be in the center of this field, is
long gone. And where it stood, there has come up, since The Golden
Book appeared, a great Apple-Amaranth Vine, coming as it were, like
Jack’s beanstalk, suddenly.
It is autumn and the whole air is fragrant with the honey of the
fruit of this Apple-Amaranth, and bees are busy with the rich fruit.
Every highest, furtherest bud that opens day after tomorrow, or in
a thousand years, will flash with a spark and a flame, that has
climbed up hundreds and thousands of miles from the roots that
touch all the gardens of our city, up the old streets of Heaven, where
this vine blooms today.
In the twinkling of an eye, while the star chimes of Springfield are
ringing new tunes, from the dimmest stars of the blue, from east,
west, north and south, magic boats sweep down to the Amazonian
field.
It is happiness to be even the oldest of the prophets, who wait
exhausted, after ages of service, praying and dreaming, stretched out
on the decks of their swift boats, consumed with beautiful sorrow
and hope. The honey of each different Amaranth, growing through
the stars, has burnt all the strength of their bodies away, yet it gives
to them stronger courage, hour by hour. When it touches their lips,
all else is vanity. It is the live coal from the altar and is their new
Heaven.
The boats are now above the field, and some of them have rested
near the earth, and some of the prophets are standing round the tree.
Among them is that wild ancient man Isaiah. He gathers the whole
company of Springfield people who are there on the edges of the
field. Then there join, from the invisible world, many of the long
dead Saints of Springfield and many saints from other capitals of this
land.
Isaiah speaks to us in words, such as he spoke to the Jews, when
the earthly Jerusalem had fallen, but they are words that shall ever
be new till the last millennium is achieved. He stretches forth his
hand and blesses our kneeling company and, with the honey of this
new Amaranth Flower still burning on his lips, like visible fire, he
cries in a loud voice his old prophecies of the coming of the restored
and redeemed Zion.
Avanel and I are now in our ship above the town, and looking
down on the sea of dim fleets. Avanel whispers: “There are prophets
in those boats from all the hermit caves and all the shrines in the
moon and all the planets and all the suns. There are prophets that
once walked the innermost streets of the far jungles of Heaven.
“Yet the song that comes up from that sea and shakes our sails is:
‘Springfield Awake, Springfield Aflame,’ because the song and heart
and blood of any prophet are for the city that will receive them.”
The boats are ranged in three great circles beneath us round the
new Amaranth Vine. These ride on invisible sea-levels. They are not
air ships with modern wings and propellers, but boats of the ancient
type, such as were used by Hiram, King of Tyre, when he brought the
wood to build the temple of Solomon, such as St. Peter used on Lake
Galilee, such as bore St. Paul to the ends of the world.
While the star chimes of the city ring new tunes, the weird sailors
below us pour down a crimson wine from the sides of the boats, that
mixes with the autumn leaves of the Amaranth Vine that swirl now
between us and the whole towered city below. The wine and the
leaves turn to crimson mist and crimson storm, filling the city
canyons with rolling rivers of storm to the top of the Sunset Towers.
The boats rise, sailing as though travelling of their own knowledge.
Even those that are empty and have no prophet sailors in them are
up and away. Some of them seem like exhalations from the perfume
and gleam of the gigantic vine or from the light and mist of the city
below. And so out to the stars scatter all these purposeful ships, some
empty, some with prophet crews, and every boat has blazing at its
masthead the red and white star of Springfield and Illinois.
And the song goes up with them to the stars: “Springfield Awake,
Springfield Aflame.” Avanel says, “That song comes because the song
and heart and blood of the proudest prophets from the proudest
suns, are for the city that will receive them.”
We let our ship blow and drift as it will. But it sweeps up and up,
with the swiftness of light. In less time than it takes a flower to open,
we are carried to the parapets of ancient Heaven. We find our great-
leaved, heavy-fruited Amaranth Vine, climbing up over the closed
gates and high wall-towers of Heaven and winding a long way into
the old forest that has overgrown the streets. We find the new all
conquering Springfield vine, spreading branches through the forest
like a banyan tree.
As this Amaranth from our little earthly village grows thicker, we
see by its light a bit of what the ancient Heaven has been. And it is
still a solid place of soil and rock and metal. Where the Springfield
Amaranth blooms thickest, shedding luminous glory from the petals
in the starlight, this Heaven is shown to be an autumn forest, yet
with the cedars of Lebanon, and sandalwood thickets, and the
million tropic trees whose seeds have blown here from strange zones
of the planets, and whose patterns are not the patterns of those of
our world. Among these, vine-clad pillars and walls are still standing,
roofed palaces, so gigantic that, when our boat glides down the great
streets between them, they overhang our masts.
And from branches above us these strange manners of fruits
tumble upon our decks for our feasting and delight. And there are
beneath our ship, as it sails on as it will, little fields long cleared in
the forest, where grows weedy ungathered grain.
Through hours and hours of the night our boat goes on, whether
we will or no, through starlight and through storm-clouds and
through flower-light. And the red star at the masthead and the sight
of the proud face of Avanel keeps laughter in my bosom, and the
heavenly breeze that blows on the flowers still sings to our hearts:
“Springfield Awake, Springfield Aflame.”
Out of the storm now, three great rocks appear, giving forth white
light there on the far horizon, and this light burns on and on. At last
our ship approaches. We see the great rocks are three empty thrones.
These are the thrones of the Trinity, empty for these many years,
just as the Ark of the Covenant and the Holy of Holies were bereft of
the Presence, when Israel sinned.
And now we are near, and see that the light that hangs round these
mountain thrones is because of the vines of gigantic Amaranths, of
strange design and of many colors, that bloom upon them. These
vines have journeyed up through the ether and great spaces from
many cities and many stars.
Our boat sweeps to the side of the thrones, and we look down on
what was once the crystal sea, a wild green water now, with great
fleets of idle boats, moored by its marshy banks, the boats of dead
prophets and angels who lie turned to stone on their strange and
beautiful decks. “These are the souls who sinned by refusing to enlist
in the crusade against world wars,” or, at least, so Avanel tells me
from her heart.
And this is all her dream, none of it mine, and without her all this
is nothing.
There are boats of the older days, galleons of rotted magnificence,
wrecked and high and dry upon the sand bars, and the skeletons and
driftwood of boats are scattered in the marshes by long forgotten
storms and cyclones.
We disembark and tread our perilous way among these strange
appearances. Sometimes they are as seemingly material as earth.
Sometimes we are but walking on the dust of nebulae.
Then we walk into the vine-clad forest that covers the pass
between the nearest throne mountains, where broken steps are still
to be found in the moss, and whisper to us to follow. There are many
butterflies and bees that have taken too much of the blood of the fruit
of the Amaranth Flower and are fallen down and some of them dead.
The stair leads us up and through a dark pass and down into a
deeper twilight. And the stair, slowly descending, whispers to us:
“Follow.” And thus we go, into the most abysmal and curious of
valleys, whence, perhaps, ages ago, many spirits fled affrighted
because of the loneliness.
We walk amid rich ruins, miles and miles of vaulted halls, deep
sheltered recesses, heaped with the purple dust of dead tapestries,
mouldering porticos shaken by the wind. Avanel, fearing not, follows
the steps that still call: “Follow, follow.” She is eating of the
Amaranth that still blooms and bears fruit, eating the fruit from
many stars, breathing strange perfume, humming her old songs and
new songs, with heart aflame, a dauntless prophetess, prodigal and
guide.
But now even her spirit is weary and her soul has earth thoughts
again, as we wander through the echoing throne rooms. She tries in
vain to laugh in the desolate halls. In a fever and a fret and in
unutterable, earthly weariness, we shuffle amid heaps of old shields
of blackened silver, amid helmets of brass and iron, amid ivory
chariots and rotted harps and broken crowns and swords of rusted
gold. And then we see a campfire we know and smell the familiar
fragrance of pine wood and, in the crossing of two tremendous grass
grown streets, we find him we found, first in a dream in springtime,
and then at midsummer midnight of a far off June at Fifth and
Monroe. The Handsome Medicine Man, Devil’s Gold, is saying to us,
as though resuming a conversation in which he had quite the best of
us a moment ago:
“After all, people are ranked in Springfield according to their
money. People with six thousand dollars apiece a year are considered
decent and no questions are asked. People with a million in buried
gold or alcohol are on a level of righteousness with the world saints,
who are, of course, admitted to their class by generous dispensation.
Heaven may be a jungle but nothing will ever alter this great law,”
and the handsome jester, Devil’s Gold, is shaking his bead-covered
rattle, making medicine and calling us by name. We are so tired from
our long walk that we cannot but admire his gilded face and his
yellow magic blanket. And, holding each other’s hands like lovers, we
stoop and admire ourselves in the golden pool that flickers in the
great campfire he has impudently built at the crossing of two streets
in Heaven.
But we do not step into the pool as before-time. Our boat is beside
us, it has overtaken us like some faithful tame giant swan, and
Avanel whispers: “Take us where The Golden Book was written.” And
thus we are up and away. The boat carries us deeper, down the
valley. We find the cell of Hunter Kelly,—St. Scribe of the Shrines.
Only his handiwork remains to testify of him. Upon the walls of his
cell he has painted many an illumination he afterward painted on
The Golden Book margins and, in a loose pile of old torn and
unbound pages, the first draft of many a familiar text is to be found.
His dried paint jars are there and his ink and on the wall hangs the
empty leather sack of Johnny Appleseed, from which came the first
sowing of all the Amaranths of our little city, and the Amaranth that
led us here.
And Avanel whispers:—“I ask my heart:—Where is Hunter Kelly,
and my heart speaks to me as though commanded: ‘The Hunter is
again pioneering for our little city in the little earth. He is reborn as
the humblest acolyte of the Cathedral, a child that sings tonight with
the star chimes, a red-cheeked boy, who shoes horses at the old forge
of the Iron Gentleman. Let us also return’.”
It is eight o’clock in the evening, at Fifth and Monroe. It is
Saturday night, and the crowd is pouring toward The Majestic, and
Chatterton’s, and The Vaudette, and The Princess and The Gaiety.
It is a lovely, starry evening, in the spring. The newsboys are
bawling away, and I buy an Illinois State Register. It is dated March
1, 1920.
Avanel of Springfield is one hundred years away.
The Register has much news of a passing nature. I am the most
interested in the weather report, that tomorrow will be fair.

Written in Washington Park Pavilion, Springfield, Illinois.


TRANSCRIBER’S NOTES
1. Silently corrected typographical errors and
variations in spelling.
2. Retained anachronistic, non-standard, and
uncertain spellings as printed.
*** END OF THE PROJECT GUTENBERG EBOOK THE GOLDEN BOOK
OF SPRINGFIELD ***

Updated editions will replace the previous one—the old editions


will be renamed.

Creating the works from print editions not protected by U.S.


copyright law means that no one owns a United States
copyright in these works, so the Foundation (and you!) can copy
and distribute it in the United States without permission and
without paying copyright royalties. Special rules, set forth in the
General Terms of Use part of this license, apply to copying and
distributing Project Gutenberg™ electronic works to protect the
PROJECT GUTENBERG™ concept and trademark. Project
Gutenberg is a registered trademark, and may not be used if
you charge for an eBook, except by following the terms of the
trademark license, including paying royalties for use of the
Project Gutenberg trademark. If you do not charge anything for
copies of this eBook, complying with the trademark license is
very easy. You may use this eBook for nearly any purpose such
as creation of derivative works, reports, performances and
research. Project Gutenberg eBooks may be modified and
printed and given away—you may do practically ANYTHING in
the United States with eBooks not protected by U.S. copyright
law. Redistribution is subject to the trademark license, especially
commercial redistribution.

START: FULL LICENSE


THE FULL PROJECT GUTENBERG LICENSE
PLEASE READ THIS BEFORE YOU DISTRIBUTE OR USE THIS WORK

To protect the Project Gutenberg™ mission of promoting the


free distribution of electronic works, by using or distributing this
work (or any other work associated in any way with the phrase
“Project Gutenberg”), you agree to comply with all the terms of
the Full Project Gutenberg™ License available with this file or
online at www.gutenberg.org/license.

Section 1. General Terms of Use and


Redistributing Project Gutenberg™
electronic works
1.A. By reading or using any part of this Project Gutenberg™
electronic work, you indicate that you have read, understand,
agree to and accept all the terms of this license and intellectual
property (trademark/copyright) agreement. If you do not agree
to abide by all the terms of this agreement, you must cease
using and return or destroy all copies of Project Gutenberg™
electronic works in your possession. If you paid a fee for
obtaining a copy of or access to a Project Gutenberg™
electronic work and you do not agree to be bound by the terms
of this agreement, you may obtain a refund from the person or
entity to whom you paid the fee as set forth in paragraph 1.E.8.

1.B. “Project Gutenberg” is a registered trademark. It may only


be used on or associated in any way with an electronic work by
people who agree to be bound by the terms of this agreement.
There are a few things that you can do with most Project
Gutenberg™ electronic works even without complying with the
full terms of this agreement. See paragraph 1.C below. There
are a lot of things you can do with Project Gutenberg™
electronic works if you follow the terms of this agreement and
help preserve free future access to Project Gutenberg™
electronic works. See paragraph 1.E below.
1.C. The Project Gutenberg Literary Archive Foundation (“the
Foundation” or PGLAF), owns a compilation copyright in the
collection of Project Gutenberg™ electronic works. Nearly all the
individual works in the collection are in the public domain in the
United States. If an individual work is unprotected by copyright
law in the United States and you are located in the United
States, we do not claim a right to prevent you from copying,
distributing, performing, displaying or creating derivative works
based on the work as long as all references to Project
Gutenberg are removed. Of course, we hope that you will
support the Project Gutenberg™ mission of promoting free
access to electronic works by freely sharing Project Gutenberg™
works in compliance with the terms of this agreement for
keeping the Project Gutenberg™ name associated with the
work. You can easily comply with the terms of this agreement
by keeping this work in the same format with its attached full
Project Gutenberg™ License when you share it without charge
with others.

1.D. The copyright laws of the place where you are located also
govern what you can do with this work. Copyright laws in most
countries are in a constant state of change. If you are outside
the United States, check the laws of your country in addition to
the terms of this agreement before downloading, copying,
displaying, performing, distributing or creating derivative works
based on this work or any other Project Gutenberg™ work. The
Foundation makes no representations concerning the copyright
status of any work in any country other than the United States.

1.E. Unless you have removed all references to Project


Gutenberg:

1.E.1. The following sentence, with active links to, or other


immediate access to, the full Project Gutenberg™ License must
appear prominently whenever any copy of a Project
Gutenberg™ work (any work on which the phrase “Project
Gutenberg” appears, or with which the phrase “Project
Gutenberg” is associated) is accessed, displayed, performed,
viewed, copied or distributed:

This eBook is for the use of anyone anywhere in the United


States and most other parts of the world at no cost and
with almost no restrictions whatsoever. You may copy it,
give it away or re-use it under the terms of the Project
Gutenberg License included with this eBook or online at
www.gutenberg.org. If you are not located in the United
States, you will have to check the laws of the country
where you are located before using this eBook.

1.E.2. If an individual Project Gutenberg™ electronic work is


derived from texts not protected by U.S. copyright law (does not
contain a notice indicating that it is posted with permission of
the copyright holder), the work can be copied and distributed to
anyone in the United States without paying any fees or charges.
If you are redistributing or providing access to a work with the
phrase “Project Gutenberg” associated with or appearing on the
work, you must comply either with the requirements of
paragraphs 1.E.1 through 1.E.7 or obtain permission for the use
of the work and the Project Gutenberg™ trademark as set forth
in paragraphs 1.E.8 or 1.E.9.

1.E.3. If an individual Project Gutenberg™ electronic work is


posted with the permission of the copyright holder, your use and
distribution must comply with both paragraphs 1.E.1 through
1.E.7 and any additional terms imposed by the copyright holder.
Additional terms will be linked to the Project Gutenberg™
License for all works posted with the permission of the copyright
holder found at the beginning of this work.

1.E.4. Do not unlink or detach or remove the full Project


Gutenberg™ License terms from this work, or any files
containing a part of this work or any other work associated with
Project Gutenberg™.

1.E.5. Do not copy, display, perform, distribute or redistribute


this electronic work, or any part of this electronic work, without
prominently displaying the sentence set forth in paragraph 1.E.1
with active links or immediate access to the full terms of the
Project Gutenberg™ License.

1.E.6. You may convert to and distribute this work in any binary,
compressed, marked up, nonproprietary or proprietary form,
including any word processing or hypertext form. However, if
you provide access to or distribute copies of a Project
Gutenberg™ work in a format other than “Plain Vanilla ASCII” or
other format used in the official version posted on the official
Project Gutenberg™ website (www.gutenberg.org), you must,
at no additional cost, fee or expense to the user, provide a copy,
a means of exporting a copy, or a means of obtaining a copy
upon request, of the work in its original “Plain Vanilla ASCII” or
other form. Any alternate format must include the full Project
Gutenberg™ License as specified in paragraph 1.E.1.

1.E.7. Do not charge a fee for access to, viewing, displaying,


performing, copying or distributing any Project Gutenberg™
works unless you comply with paragraph 1.E.8 or 1.E.9.

1.E.8. You may charge a reasonable fee for copies of or


providing access to or distributing Project Gutenberg™
electronic works provided that:

• You pay a royalty fee of 20% of the gross profits you derive
from the use of Project Gutenberg™ works calculated using the
method you already use to calculate your applicable taxes. The
fee is owed to the owner of the Project Gutenberg™ trademark,
but he has agreed to donate royalties under this paragraph to
the Project Gutenberg Literary Archive Foundation. Royalty
payments must be paid within 60 days following each date on
which you prepare (or are legally required to prepare) your
periodic tax returns. Royalty payments should be clearly marked
as such and sent to the Project Gutenberg Literary Archive
Foundation at the address specified in Section 4, “Information
about donations to the Project Gutenberg Literary Archive
Foundation.”

• You provide a full refund of any money paid by a user who


notifies you in writing (or by e-mail) within 30 days of receipt
that s/he does not agree to the terms of the full Project
Gutenberg™ License. You must require such a user to return or
destroy all copies of the works possessed in a physical medium
and discontinue all use of and all access to other copies of
Project Gutenberg™ works.

• You provide, in accordance with paragraph 1.F.3, a full refund of


any money paid for a work or a replacement copy, if a defect in
the electronic work is discovered and reported to you within 90
days of receipt of the work.

• You comply with all other terms of this agreement for free
distribution of Project Gutenberg™ works.

1.E.9. If you wish to charge a fee or distribute a Project


Gutenberg™ electronic work or group of works on different
terms than are set forth in this agreement, you must obtain
permission in writing from the Project Gutenberg Literary
Archive Foundation, the manager of the Project Gutenberg™
trademark. Contact the Foundation as set forth in Section 3
below.

1.F.

1.F.1. Project Gutenberg volunteers and employees expend


considerable effort to identify, do copyright research on,
transcribe and proofread works not protected by U.S. copyright
law in creating the Project Gutenberg™ collection. Despite these
efforts, Project Gutenberg™ electronic works, and the medium
on which they may be stored, may contain “Defects,” such as,
but not limited to, incomplete, inaccurate or corrupt data,
transcription errors, a copyright or other intellectual property
infringement, a defective or damaged disk or other medium, a
computer virus, or computer codes that damage or cannot be
read by your equipment.

1.F.2. LIMITED WARRANTY, DISCLAIMER OF DAMAGES - Except


for the “Right of Replacement or Refund” described in
paragraph 1.F.3, the Project Gutenberg Literary Archive
Foundation, the owner of the Project Gutenberg™ trademark,
and any other party distributing a Project Gutenberg™ electronic
work under this agreement, disclaim all liability to you for
damages, costs and expenses, including legal fees. YOU AGREE
THAT YOU HAVE NO REMEDIES FOR NEGLIGENCE, STRICT
LIABILITY, BREACH OF WARRANTY OR BREACH OF CONTRACT
EXCEPT THOSE PROVIDED IN PARAGRAPH 1.F.3. YOU AGREE
THAT THE FOUNDATION, THE TRADEMARK OWNER, AND ANY
DISTRIBUTOR UNDER THIS AGREEMENT WILL NOT BE LIABLE
TO YOU FOR ACTUAL, DIRECT, INDIRECT, CONSEQUENTIAL,
PUNITIVE OR INCIDENTAL DAMAGES EVEN IF YOU GIVE
NOTICE OF THE POSSIBILITY OF SUCH DAMAGE.

1.F.3. LIMITED RIGHT OF REPLACEMENT OR REFUND - If you


discover a defect in this electronic work within 90 days of
receiving it, you can receive a refund of the money (if any) you
paid for it by sending a written explanation to the person you
received the work from. If you received the work on a physical
medium, you must return the medium with your written
explanation. The person or entity that provided you with the
defective work may elect to provide a replacement copy in lieu
of a refund. If you received the work electronically, the person
or entity providing it to you may choose to give you a second
opportunity to receive the work electronically in lieu of a refund.
If the second copy is also defective, you may demand a refund
in writing without further opportunities to fix the problem.

1.F.4. Except for the limited right of replacement or refund set


forth in paragraph 1.F.3, this work is provided to you ‘AS-IS’,
WITH NO OTHER WARRANTIES OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO WARRANTIES OF
MERCHANTABILITY OR FITNESS FOR ANY PURPOSE.

1.F.5. Some states do not allow disclaimers of certain implied


warranties or the exclusion or limitation of certain types of
damages. If any disclaimer or limitation set forth in this
agreement violates the law of the state applicable to this
agreement, the agreement shall be interpreted to make the
maximum disclaimer or limitation permitted by the applicable
state law. The invalidity or unenforceability of any provision of
this agreement shall not void the remaining provisions.

1.F.6. INDEMNITY - You agree to indemnify and hold the


Foundation, the trademark owner, any agent or employee of the
Foundation, anyone providing copies of Project Gutenberg™
electronic works in accordance with this agreement, and any
volunteers associated with the production, promotion and
distribution of Project Gutenberg™ electronic works, harmless
from all liability, costs and expenses, including legal fees, that
arise directly or indirectly from any of the following which you
do or cause to occur: (a) distribution of this or any Project
Gutenberg™ work, (b) alteration, modification, or additions or
deletions to any Project Gutenberg™ work, and (c) any Defect
you cause.

Section 2. Information about the Mission


of Project Gutenberg™
Project Gutenberg™ is synonymous with the free distribution of
electronic works in formats readable by the widest variety of
computers including obsolete, old, middle-aged and new
computers. It exists because of the efforts of hundreds of
volunteers and donations from people in all walks of life.

Volunteers and financial support to provide volunteers with the


assistance they need are critical to reaching Project
Gutenberg™’s goals and ensuring that the Project Gutenberg™
collection will remain freely available for generations to come. In
2001, the Project Gutenberg Literary Archive Foundation was
created to provide a secure and permanent future for Project
Gutenberg™ and future generations. To learn more about the
Project Gutenberg Literary Archive Foundation and how your
efforts and donations can help, see Sections 3 and 4 and the
Foundation information page at www.gutenberg.org.

Section 3. Information about the Project


Gutenberg Literary Archive Foundation
The Project Gutenberg Literary Archive Foundation is a non-
profit 501(c)(3) educational corporation organized under the
laws of the state of Mississippi and granted tax exempt status
by the Internal Revenue Service. The Foundation’s EIN or
federal tax identification number is 64-6221541. Contributions
to the Project Gutenberg Literary Archive Foundation are tax
deductible to the full extent permitted by U.S. federal laws and
your state’s laws.

The Foundation’s business office is located at 809 North 1500


West, Salt Lake City, UT 84116, (801) 596-1887. Email contact
links and up to date contact information can be found at the
Foundation’s website and official page at
www.gutenberg.org/contact
Section 4. Information about Donations to
the Project Gutenberg Literary Archive
Foundation
Project Gutenberg™ depends upon and cannot survive without
widespread public support and donations to carry out its mission
of increasing the number of public domain and licensed works
that can be freely distributed in machine-readable form
accessible by the widest array of equipment including outdated
equipment. Many small donations ($1 to $5,000) are particularly
important to maintaining tax exempt status with the IRS.

The Foundation is committed to complying with the laws


regulating charities and charitable donations in all 50 states of
the United States. Compliance requirements are not uniform
and it takes a considerable effort, much paperwork and many
fees to meet and keep up with these requirements. We do not
solicit donations in locations where we have not received written
confirmation of compliance. To SEND DONATIONS or determine
the status of compliance for any particular state visit
www.gutenberg.org/donate.

While we cannot and do not solicit contributions from states


where we have not met the solicitation requirements, we know
of no prohibition against accepting unsolicited donations from
donors in such states who approach us with offers to donate.

International donations are gratefully accepted, but we cannot


make any statements concerning tax treatment of donations
received from outside the United States. U.S. laws alone swamp
our small staff.

Please check the Project Gutenberg web pages for current


donation methods and addresses. Donations are accepted in a
number of other ways including checks, online payments and
credit card donations. To donate, please visit:
www.gutenberg.org/donate.

Section 5. General Information About


Project Gutenberg™ electronic works
Professor Michael S. Hart was the originator of the Project
Gutenberg™ concept of a library of electronic works that could
be freely shared with anyone. For forty years, he produced and
distributed Project Gutenberg™ eBooks with only a loose
network of volunteer support.

Project Gutenberg™ eBooks are often created from several


printed editions, all of which are confirmed as not protected by
copyright in the U.S. unless a copyright notice is included. Thus,
we do not necessarily keep eBooks in compliance with any
particular paper edition.

Most people start at our website which has the main PG search
facility: www.gutenberg.org.

This website includes information about Project Gutenberg™,


including how to make donations to the Project Gutenberg
Literary Archive Foundation, how to help produce our new
eBooks, and how to subscribe to our email newsletter to hear
about new eBooks.
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.

Let us accompany you on the journey of exploring knowledge and


personal growth!

ebooknice.com

You might also like