Mern Projects For Beginners Create Five Social Web Apps Using Mongodb Expressjs React and Node 1st Edition Nabendu Biswas PDF Download
Mern Projects For Beginners Create Five Social Web Apps Using Mongodb Expressjs React and Node 1st Edition Nabendu Biswas PDF Download
https://ebookbell.com/product/mern-projects-for-beginners-create-
five-social-web-apps-using-mongodb-expressjs-react-and-node-1st-
edition-nabendu-biswas-34674416
https://ebookbell.com/product/six-sigmalean-toolset-mindset-for-
successful-implementation-of-improvement-projects-2nd-edition-renata-
meran-4269708
https://ebookbell.com/product/project-management-for-mere-
mortalsr-1st-edition-claudia-m-baca-2204634
https://ebookbell.com/product/project-management-for-mere-mortals-
baca-claudia-m-22124150
https://ebookbell.com/product/project-management-for-mere-mortals-
claudia-baca-57135430
Classic Hairstyles For Men An Illustrated Guide To Mens Hair Style
Hair Care Hair Products Antonio Centeno Geoffrey Cubbage Centeno
https://ebookbell.com/product/classic-hairstyles-for-men-an-
illustrated-guide-to-mens-hair-style-hair-care-hair-products-antonio-
centeno-geoffrey-cubbage-centeno-23830100
https://ebookbell.com/product/classic-hairstyles-for-men-an-
illustrated-guide-to-mens-hair-style-hair-care-hair-products-
centeno-6626900
https://ebookbell.com/product/classic-hairstyles-for-men-an-
illustrated-guide-to-mens-hair-style-hair-care-hair-products-
centeno-11368626
https://ebookbell.com/product/financing-infrastructure-projects-merna-
tony-njiru-cyrus-5309760
Big Book Of Embroidery 250 Stitches And 29 Creative Projects Rene Mery
https://ebookbell.com/product/big-book-of-embroidery-250-stitches-
and-29-creative-projects-rene-mery-48670340
MERN
Projects for
Beginners
Create Five Social Web Apps Using
MongoDB, Express.js, React, and Node
—
Nabendu Biswas
MERN Projects for
Beginners
Create Five Social Web Apps
Using MongoDB, Express.js,
React, and Node
Nabendu Biswas
MERN Projects for Beginners: Create Five Social Web Apps Using MongoDB,
Express.js, React, and Node
Nabendu Biswas
Bhopal, India
iii
Table of Contents
iv
Table of Contents
v
Table of Contents
vi
Table of Contents
Index��������������������������������������������������������������������������������������������������������������������� 283
vii
About the Author
Nabendu Biswas is a full-stack JavaScript developer who has been working in the IT
industry for the past 16 years. He has worked for some of the world’s top development
firms and investment banks. Nabendu is a tech blogger who publishes on DEV
Community (dev.to), Medium (medium.com), and The Web Dev(TWD) (thewebdev.
tech). He is an all-around nerd who is passionate about everything JavaScript, React, and
Gatsby. You can find him on Twitter @nabendu82.
ix
About the Technical Reviewer
Alexander Nnakwue is a self-taught software engineer with experience in back-end and
full-stack engineering. With experience spanning more than four years, he loves to solve
problems at scale. Currently, he is interested in startups, open source web development,
and distributed systems. In his spare time, Alexander loves watching soccer and listening
to all genres of music.
xi
CHAPTER 1
• React is the most popular open source JavaScript library for building
a website’s or web app’s front end or user interface. It is developed
and maintained by Facebook.
• Express is a framework of Node.js, and through it, you can create API
endpoints, which are the basis of any back-end server-side code.
1
© Nabendu Biswas 2021
N. Biswas, MERN Projects for Beginners, https://doi.org/10.1007/978-1-4842-7138-4_1
Chapter 1 MERN Deployment Setup
2
Chapter 1 MERN Deployment Setup
Click the Add project link on the page, as seen in Figure 1-2.
3
Chapter 1 MERN Deployment Setup
On this page, name the project dating-app-mern, and then click the Continue
button, as seen in Figure 1-3. Note that this is just an installation instruction. You start
building the app in the next chapter.
On the next page, click the Create project button, as seen in Figure 1-4.
4
Chapter 1 MERN Deployment Setup
5
Chapter 1 MERN Deployment Setup
M
ongoDB Setup
MongoDB is the database that you work with on the cloud. It is also known as
MongoDB Atlas. This is easier to work with than setting up on a local machine. Go to
www.mongodb.com and log in or create a new account.
6
Chapter 1 MERN Deployment Setup
Name your project dating-app-mern, and then click the Next button, as seen in
Figure 1-7.
On the next screen, click the Create Project button, as seen in Figure 1-8.
On the next screen, click the Build a Cluster button, as seen in Figure 1-9.
On the next screen, select the Free tier, as seen in Figure 1-10.
8
Chapter 1 MERN Deployment Setup
On the next screen, you need to choose the AWS region in which to create the
database. (I chose Mumbai because I live in India, and this gives me low latency.)
Afterward, click the Create Cluster button, as seen in Figure 1-11.
9
Chapter 1 MERN Deployment Setup
The next screen shows that the cluster has been created, which takes time. You can
go back and create your first API endpoint, as seen in Figure 1-12.
10
Chapter 1 MERN Deployment Setup
11
Chapter 1 MERN Deployment Setup
On the next screen, you need to enter a username and a password, as seen in
Figure 1-14. You must remember both. Next, scroll down and click the Add User button.
12
Chapter 1 MERN Deployment Setup
Next, go to the Network Access tab and click the Add IP Address button, as seen in
Figure 1-15.
13
Chapter 1 MERN Deployment Setup
In the popup window, click the ALLOW ACCESS FROM ANYWHERE button and
then click the Confirm button, as seen in Figure 1-16.
Next, return to the Cluster tab and click the CONNECT button, which opens the
popup window shown in Figure 1-17. Click the Connect your application tab.
15
Chapter 1 MERN Deployment Setup
Copy the connection URL by clicking the Copy button, as seen in Figure 1-18.
16
Chapter 1 MERN Deployment Setup
17
Chapter 1 MERN Deployment Setup
Next, name the app and click the Create app button, as seen in Figure 1-20.
The next screen shows all the commands to deploy your app, but you need the
Heroku CLI. Click the link and follow the instructions to install it on your operating
system, as seen in Figure 1-21.
18
Chapter 1 MERN Deployment Setup
Run the heroku login command in the backend folder. You are asked for permission
to open the browser. This command asks you to press any key to open in the browser.
19
Chapter 1 MERN Deployment Setup
Figure 1-22.
Here, you can log in with your credentials, as seen in Figure 1-23.
20
Chapter 1 MERN Deployment Setup
After successfully logging in, you see the page shown in Figure 1-24, which you need
to close.
21
Chapter 1 MERN Deployment Setup
You need to push the code from your local machine to the Heroku repository. Now
that you are logged in to your account, you can run the following command to connect to
Heroku Git.
Next, let’s run the familiar git command to commit the code. Now, Git is software
that tracks changes in a file; it is a must in software development. The following
commands add code to the staging area, then commits it. The push command pushes it
to remote Heroku servers.
git add .
git commit -m "backend code complete"
git push heroku master
22
Chapter 1 MERN Deployment Setup
After the installation is done, click the Open app button, which takes you to the
deploy site, as seen in Figure 1-25.
firebase login
firebase init
Use the down arrow key to go to Hosting, as seen in Figure 1-26. Press the spacebar
to select it, and then press the Enter key.
23
Chapter 1 MERN Deployment Setup
Select Use an existing project, as seen in Figure 1-27, and press the Enter key.
Next, choose the public directory, which is build. The following question asks about
a single-page app; answer Yes. The next question is about GitHub deploys; answer No, as
seen in Figure 1-29.
24
Chapter 1 MERN Deployment Setup
Next, run npm run build in the frontend folder for an optimal production build. The
final command, firebase deploy, deploys the project to Firebase. If successful, the site
is now live, which is shown in upcoming chapters.
25
Chapter 1 MERN Deployment Setup
The downloaded file is installed in your Download folder by default. Click it, and
then click the Run button, as seen in Figure 1-31.
26
Chapter 1 MERN Deployment Setup
In the Node.js installation popup window, click the Next button, as seen in Figure 1-32.
27
Chapter 1 MERN Deployment Setup
Click to accept the end-user license agreement, and then click the Next button, as
seen in Figure 1-33.
Next, I advise that you use the installation location shown in Figure 1-34.
28
Chapter 1 MERN Deployment Setup
Next, click the check box and then the Next button, as seen in Figure 1-36.
30
Chapter 1 MERN Deployment Setup
Once the installation is done, run the following commands to check the versions and
verify that everything is right.
node –v
npm -v
Summary
In this chapter, we have learnt about all the different technologies to create a
MERN(MongoDB, Express, ReactJS, NodeJS) project. We have also learnt how to deploy
them in different environments and we will be using them in the next chapters.
31
CHAPTER 2
Let’s review the React front end and then move to the back end. Open your terminal
and create a dating-app-mern folder. Inside it, use create-react-app to create a new app
called dating-app-frontend. The following are the commands to do this.
mkdir dating-app-mern
cd dating-app-mern
npx create-react-app dating-app-frontend
cd dating-app-frontend
npm start
Next, let’s delete some of the files that you don’t need. Figure 2-2 shows how the app
looks on localhost.
34
Chapter 2 Building a Dating App with MERN
App.js contains only the text Dating App MERN. All the content from the App.css
file has been removed.
import './App.css';
function App() {
return (
<div className="app">
<h1>Dating App MERN </h1>
</div>
);
}
* {
margin: 0;
}
36
Chapter 2 Building a Dating App with MERN
Next, create a components folder inside the src folder. Create two files—Header.js
and Header.css—inside the components folder. Header.js has three things: a person
icon, a logo, and a forum icon. The logo is taken from the project’s public directory,
which contains the React logo by default.
The following is the Header.js file’s content.
Include the Header component in the App.js file and on localhost. The updated
code is marked in bold.
import './App.css';
import Header from './components/Header';
function App() {
return (
37
Chapter 2 Building a Dating App with MERN
<div className="app">
<Header />
</div>
);
}
The Header.css file contains the following content, including simple styles, which
completes the header.
.header{
display: flex;
align-items: center;
justify-content: space-between;
z-index: 100;
border-bottom: 1px solid #f9f9f9;
}
.header__logo{
object-fit: contain;
height: 40px;
}
.header__icon{
padding: 20px;
}
38
Chapter 2 Building a Dating App with MERN
import './App.css';
import Header from './components/Header';
import DatingCards from './components/DatingCards';
function App() {
return (
<div className="app">
<Header />
< DatingCards />
</div>
);
}
npm i react-tinder-card
Next, put the content in DatingCards.js. Here, inside a people state variable, you store
the name and images of four people. Next, import DatingCard and use it as a component.
Here, you use the props mentioned in the react-tinder-card documentation.
The swiped and outOfFrame functions are required. When looping through each
person, use the imgUrl background image and display the name in the h3 tag.
39
Chapter 2 Building a Dating App with MERN
40
Chapter 2 Building a Dating App with MERN
</div>
</DatingCard>
))}
</div>
</div>
)
}
Localhost shows four “people,” as seen in Figure 2-5, but you need to style
everything.
Add the first styles in the DatingCards.css file, and make datingCards__container
a flexbox. Next, style each card to contain the image and other things. Note that you are
setting position: relative for each card, which offsets the element relative to itself and
provides width and height.
.datingCards__container{
display: flex;
justify-content: center;
margin-top: 10vh;
}
.card{
position: relative;
background-color: white;
width: 600px;
padding: 20px;
41
Discovering Diverse Content Through
Random Scribd Documents
legislative and judicial proceedings. 5. It tends to impair the
property of the citizens, and, in some instances, that of the
States, by destroying the State banks in which they have
invested their money. 6. It is injurious to the commerce of the
States (I speak of the Western States), by substituting a trade
in bills of exchange, for a trade in the products of the country. 7.
It fastens a vampire on the bosom of the State, to suck away its
gold and silver, and to co-operate with the course of trade, of
federal legislation, and of exchange, in draining the South and
West of all their hard money. The Southern States, with their
thirty millions of annual exports in cotton, rice, and tobacco, and
the Western States, with their twelve millions of provisions and
tobacco exported from New Orleans, and five millions consumed
in the South, and on the lower Mississippi,—that is to say, with
three fifths of the marketable productions of the Union, are not
able to sustain thirty specie paying banks; while the minority of
the States north of the Potomac, without any of the great
staples for export, have above four hundred of such banks.
These States, without rice, without cotton, without tobacco,
without sugar, and with less flour and provisions, to export, are
saturated with gold and silver; while the Southern and Western
States, with all the real sources of wealth, are in a state of the
utmost destitution. For this calamitous reversal of the natural
order of things, the Bank of the United States stands forth pre-
eminently culpable. Yes, it is pre-eminently culpable! and a
statement in the 'National Intelligencer' of this morning (a paper
which would overstate no fact to the prejudice of the bank),
cites and proclaims the fact which proves this culpability. It
dwells, and exults, on the quantity of gold and silver in the
vaults of the United States Bank. It declares that institution to
be 'overburdened' with gold and silver; and well may it be so
overburdened, since it has lifted the load entirely from the
South and West. It calls these metals 'a drug' in the hands of
the bank; that is to say, an article for which no purchaser can be
found. Let this 'drug,' like the treasures of the dethroned Dey of
Algiers, be released from the dominion of its keeper; let a part
go back to the South and West, and the bank will no longer
complain of repletion, nor they of depletion.
"8. Exemption of the stockholders from individual liability on
the failure of the bank. This privilege derogates from the
common law, is contrary to the principle of partnerships, and
injurious to the rights of the community. It is a peculiar privilege
granted by law to these corporators, and exempting them from
liability, except in their corporate capacity, and to the amount of
the assets of the corporation. Unhappily these assets are never
assez, that is to say, enough, when occasion comes for recurring
to them. When a bank fails, its assets are always less than its
debts; so that responsibility fails the instant that liability
accrues. Let no one say that the bank of the United States is too
great to fail. One greater than it, and its prototype, has failed,
and that in our own day, and for twenty years at a time: the
Bank of England failed in 1797, and the Bank of the United
States was on the point of failing in 1819. The same cause,
namely, stockjobbing and overtrading, carried both to the brink
of destruction; the same means saved both, namely, the name,
the credit, and the helping hand of the governments which
protected them. Yes, the Bank of the United States may fail;
and its stockholders live in splendor upon the princely estates
acquired with its notes, while the industrious classes, who hold
these notes, will be unable to receive a shilling for them. This is
unjust. It is a vice in the charter. The true principle in banking
requires each stockholder to be liable to the amount of his
shares; and subjects him to the summary action of every holder
on the failure of the institution, till he has paid up the amount of
his subscription. This is the true principle. It has prevailed in
Scotland for the last century, and no such thing as a broken
bank has been known there in all that time.
"9. To have the United States for a partner. Sir, there is one
consequence, one result of all partnerships between a
government and individuals, which should of itself, and in a
mere mercantile point of view, condemn this association on the
part of the federal government. It is the principle which puts the
strong partner forward to bear the burden whenever the
concern is in danger. The weaker members flock to the strong
partner at the approach of the storm, and the necessity of
venturing more to save what he has already staked, leaves him
no alternative. He becomes the Atlas of the firm, and bears all
upon his own shoulders. This is the principle: what is the fact?
Why, that the United States has already been compelled to
sustain the federal bank; to prop it with her revenues and its
credit in the trials and crisis of its early administration. I pass
over other instances of the damage suffered by the United
States on account of this partnership; the immense standing
deposits for which we receive no compensation; the loan of five
millions of our own money, for which we have paid a million and
a half in interest; the five per cent. stock note, on which we
have paid our partners four million seven hundred and twenty-
five thousand dollars in interest; the loss of ten millions on the
three per cent. stock, and the ridiculous catastrophe of the
miserable bonus, which has been paid to us with a fraction of
our own money: I pass over all this, and come to the point of a
direct loss, as a partner, in the dividends upon the stock itself.
Upon this naked point of profit and loss, to be decided by a rule
in arithmetic, we have sustained a direct and heavy loss. The
stock held by the United States, as every body knows, was
subscribed, not paid. It was a stock note, deposited for seven
millions of dollars, bearing an interest of five per cent. The
inducement to this subscription was the seductive conception
that, by paying five per cent. on its note, the United States
would clear four or five per cent. in getting a dividend of eight
or ten. This was the inducement; now for the realization of this
fine conception. Let us see it. Here it is; an official return, from
the Register of the Treasury of interest paid, and of dividends
received. The account stands thus:
Interest paid by the United States, $4,725,000
Dividends received by the United States, 4,629,426
Loss to the United States, $95,574
"Disadvantageous as this partnership must be to the United
States in a moneyed point of view, there is a far more grave and
serious aspect under which to view it. It is the political aspect,
resulting from the union between the bank and the government.
This union has been tried in England, and has been found there
to be just as disastrous a conjunction as the union between
church and state. It is the conjunction of the lender and the
borrower, and Holy Writ has told us which of these categories
will be master of the other. But suppose they agree to drop
rivalry, and unite their resources. Suppose they combine, and
make a push for political power: how great is the mischief which
they may not accomplish! But, on this head, I wish to use the
language of one of the brightest patriots of Great Britain; one
who has shown himself, in these modern days, to be the worthy
successor of those old iron barons whose patriotism
commanded the unpurchasable eulogium of the elder Pitt. I
speak of Sir William Pulteney, and his speech against the Bank
of England, in 1797.
"THE SPEECH:—EXTRACT.
"'I have said enough to show that government has been
rendered dependent on the bank, and more particularly so in
the time of war; and though the bank has not yet fallen into the
hands of ambitious men, yet it is evident that it might, in such
hands, assume a power sufficient to control and overawe, not
only the ministers, but king, lords, and commons. * * * * * * As
the bank has thus become dangerous to government, it might,
on the other hand, by uniting with an ambitious minister,
become the means of establishing a fourth estate, sufficient to
involve this nation in irretrievable slavery, and ought, therefore,
to be dreaded as much as a certain East India bill was justly
dreaded, at a period not very remote. I will not say that the
present minister (the younger Pitt), by endeavoring, at this
crisis, to take the Bank of England under his protection, can
have any view to make use, hereafter, of that engine to
perpetuate his own power, and to enable him to domineer over
our constitution: if that could be supposed, it would only show
that men can entertain a very different train of ideas, when
endeavoring to overset a rival, from what occurs to them when
intending to support and fix themselves. My object is to secure
the country against all risk either from the bank as opposed to
government, or as the engine of ambitious men.'
"And this is my object also. I wish to secure the Union from
all chance of harm from this bank. I wish to provide against its
friendship, as well as its enmity—against all danger from its
hug, as well as from its blow. I wish to provide against all risk,
and every hazard; for, if this risk and hazard were too great to
be encountered by King, Lords, and Commons, in Great Britain,
they must certainly be too great to be encountered by the
people of the United States, who are but commons alone.
"10. To have foreigners for partners. This, Mr. President, will
be a strange story to be told in the West. The downright and
upright people of that unsophisticated region believe that words
mean what they signify, and that 'the Bank of the United States'
is the Bank of the United States. How great then must be their
astonishment to learn that this belief is a false conception, and
that this bank (its whole name to the contrary notwithstanding)
is just as much the bank of foreigners as it is of the federal
government. Here I would like to have the proof—a list of the
names and nations, to establish this almost incredible fact. But I
have no access except to public documents, and from one of
these I learn as much as will answer the present pinch. It is the
report of the Committee of Ways and Means, in the House of
Representatives, for the last session of Congress. That report
admits that foreigners own seven millions of the stock of this
bank; and every body knows that the federal government owns
seven millions also.
"Thus it is proved that foreigners are as deeply interested in
this bank as the United States itself. In the event of a renewal of
the charter they will be much more deeply interested than at
present; for a prospect of a rise in the stock to two hundred and
fifty, and the unsettled state of things in Europe, will induce
them to make great investments. It is to no purpose to say that
the foreign stockholders cannot be voters or directors. The
answer to that suggestion is this: the foreigners have the
money; they pay down the cash, and want no accommodations;
they are lenders, not borrowers; and in a great moneyed
institution, such stockholders must have the greatest influence.
The name of this bank is a deception upon the public. It is not
the bank of the federal government, as its name would import,
nor of the States which compose this Union; but chiefly of
private individuals, foreigners as well as natives, denizens, and
naturalized subjects. They own twenty-eight millions of the
stock, the federal government but seven millions, and these
seven are precisely balanced by the stock of the aliens. The
federal government and the aliens are equal, owning one fifth
each; and there would be as much truth in calling it the English
Bank as the Bank of the United States. Now mark a few of the
privileges which this charter gives to these foreigners. To be
landholders, in defiance of the State laws, which forbid aliens to
hold land; to be landlords by incorporation, and to hold
American citizens for tenants; to hold lands in mortmain; to be
pawnbrokers and merchants by incorporation; to pay the
revenue of the United States in their own notes; in short, to do
every thing which I have endeavored to point out in the long
and hideous list of exclusive privileges granted to this bank. If I
have shown it to be dangerous for the United States to be in
partnership with its own citizens, how much stronger is not the
argument against a partnership with foreigners? What a
prospect for loans when at war with a foreign power, and the
subjects of that power large owners of the bank here, from
which alone, or from banks liable to be destroyed by it, we can
obtain money to carry on the war! What a state of things, if, in
the division of political parties, one of these parties and the
foreigners, coalescing, should have the exclusive control of all
the money in the Union, and, in addition to the money, should
have bodies of debtors, tenants, and bank officers stationed in
all the States, with a supreme and irresponsible system of
centralism to direct the whole! Dangers from such contingencies
are too great and obvious to be insisted upon. They strike the
common sense of all mankind, and were powerful
considerations with the old whig republicans for the non-
renewal of the charter of 1791. Mr. Jefferson and the whig
republicans staked their political existence on the non-renewal
of that charter. They succeeded; and, by succeeding, prevented
the country from being laid at the mercy of British and ultra-
federalists for funds to carry on the last war. It is said the United
States lost forty millions by using depreciated currency during
the last war. That, probably, is a mistake of one half. But be it
so! For what are forty millions compared to the loss of the war
itself—compared to the ruin and infamy of having the
government arrested for want of money—stopped and paralyzed
by the reception of such a note as the younger Pitt received
from the Bank of England in 1795?
"11. Exemption from due course of law for violations of its
charter.—This is a privilege which affects the administration of
justice, and stands without example in the annals of republican
legislation. In the case of all other delinquents, whether persons
or corporations, the laws take their course against those who
offend them. It is the right of every citizen to set the laws in
motion against every offender; and it is the constitution of the
law, when set in motion, to work through, like a machine,
regardless of powers and principalities, and cutting down the
guilty which may stand in its way. Not so in the case of this
bank. In its behalf, there are barriers erected between the
citizen and his oppressor, between the wrong and the remedy,
between the law and the offender. Instead of a right to sue out
a scire facias or a quo warranto, the injured citizen, with an
humble petition in his hand, must repair to the President of the
United States, or to Congress, and crave their leave to do so. If
leave is denied (and denied it will be whenever the bank has a
peculiar friend in the President, or a majority of such friends in
Congress, the convenient pretext being always at hand that the
general welfare requires the bank to be sustained), he can
proceed no further. The machinery of the law cannot be set in
motion, and the great offender laughs from behind his barrier at
the impotent resentment of its helpless victim. Thus the bank,
for the plainest violations of its charter, and the greatest
oppressions of the citizen, may escape the pursuit of justice.
Thus the administration of justice is subject to be strangled in
its birth for the shelter and protection of this bank. But this is
not all. Another and most alarming mischief results from the
same extraordinary privilege. It gives the bank a direct interest
in the presidential and congressional elections: it gives it need
for friends in Congress and in the presidential chair. Its fate, its
very existence, may often depend upon the friendship of the
President and Congress; and, in such cases, it is not in human
nature to avoid using the immense means in the hands of the
bank to influence the elections of these officers. Take the
existing fact—the case to which I alluded at the commencement
of this speech. There is a case made out, ripe with judicial
evidence, and big with the fate of the bank. It is a case of usury
at the rate of forty-six per cent., in violation of the charter,
which only admits an interest of six. The facts were admitted, in
the court below, by the bank's demurrer; the law was decided,
in the court above, by the supreme judges. The admission
concludes the facts; the decision concludes the law. The
forfeiture of the charter is established; the forfeiture is incurred;
the application of the forfeiture alone is wanting to put an end
to the institution. An impartial President or Congress might let
the laws take their course; those of a different temper might
interpose their veto. What a crisis for the bank! It beholds the
sword of Damocles suspended over its head! What an interest in
keeping those away who might suffer the hair to be cut!
"12. To have all these unjust privileges secured to the
corporators as a monopoly, by a pledge of the public faith to
charter no other bank.—This is the most hideous feature in the
whole mass of deformity. If these banks are beneficial
institutions, why not several? one, at least, and each
independent of the other, to each great section of the Union? If
malignant, why create one? The restriction constitutes the
monopoly, and renders more invidious what was sufficiently
hateful in itself. It is, indeed, a double monopoly, legislative as
well as banking; for the Congress of 1816 monopolized the
power to grant these monopolies. It has tied up the hands of its
successors; and if this can be done on one subject, and for
twenty years, why not upon all subjects, and for all time? Here
is the form of words which operate this double engrossment of
our rights: 'No other bank shall be established by any future law
of Congress, during the continuance of the corporation hereby
enacted, for which the faith of Congress is hereby pledged;'
with a proviso for the District of Columbia. And that no incident
might be wanting to complete the title of this charter, to the
utter reprobation of whig republicans, this compound monopoly,
and the very form of words in which it is conceived, is copied
from the charter of the Bank of England!—not the charter of
William and Mary, as granted in 1694 (for the Bill of Rights was
then fresh in the memories of Englishmen), but the charter as
amended, and that for money, in the memorable reign of Queen
Anne, when a tory queen, a tory ministry, and a tory parliament,
and the apostle of toryism, in the person of Dr. Sacheverell, with
his sermons of divine right, passive obedience, and non-
resistance, were riding and ruling over the prostrate liberties of
England! This is the precious period, and these the noble
authors, from which the idea was borrowed, and the very form
of words copied, which now figure in the charter of the Bank of
the United States, constituting that double monopoly, which
restricts at once the powers of Congress and the rights of the
citizens.
"These, Mr. President, are the chief of the exclusive privileges
which constitute the monopoly of the Bank of the United States.
I have spoken of them, not as they deserved, but as my abilities
have permitted. I have shown you that they are not only evil in
themselves, but copied from an evil example. I now wish to
show you that the government from which we have made this
copy has condemned the original; and, after showing this fact, I
think I shall be able to appeal, with sensible effect, to all liberal
minds, to follow the enlightened example of Great Britain, in
getting rid of a dangerous and invidious institution, after having
followed her pernicious example in assuming it. For this
purpose, I will have recourse to proof, and will read from British
state papers of 1826. I will read extracts from the
correspondence between Earl Liverpool, first Lord of the
Treasury, and Mr. Robinson, Chancellor of the Exchequer, on the
one side, and the Governor and Deputy Governor of the Bank of
England on the other; the subject being the renewal, or rather
non-renewal, of the charter of the Bank of England.
ebookbell.com