{"componentChunkName":"component---src-templates-case-study-js","path":"/case-studies/quicker-poll","result":{"data":{"markdownRemark":{"id":"bacf1098-8a94-5bec-9472-a43fc4a546eb","html":"<h2 id=\"About-QuickerPoll\"><a href=\"#About-QuickerPoll\" aria-label=\"About QuickerPoll permalink\" class=\"gatsby-remark-autolink\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>About QuickerPoll</h2>\n<p>QuickerPoll is a crowd-sourced real-time polling app created with React and Nodejs. QuickerPoll lets you create, edit, update, delete public polls and vote on them publicly. This project is just an example of using react, nodejs and restful APIs all together</p>\n<blockquote>\n<p>please do not create any violating contents here as is this database is publicly visible, and I'm not responsible for any violating content</p>\n</blockquote>\n<h2 id=\"Tools-used\"><a href=\"#Tools-used\" aria-label=\"Tools used permalink\" class=\"gatsby-remark-autolink\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Tools used</h2>\n<p><code class=\"language-text\">chart.js</code> <code class=\"language-text\">react-color</code> <code class=\"language-text\">styled-components</code> <code class=\"language-text\">socket.io</code></p>\n<ul>\n<li>\n<p>React</p>\n<p>React is a JavaScript library that aims to simplify the development of visual interfaces.</p>\n</li>\n<li>\n<p>Ant Design</p>\n<p>A design system with values of Nature and Determinacy for the better user experience of enterprise applications</p>\n</li>\n<li>\n<p>Express</p>\n<p>Express is a minimal and flexible Node.js web application framework that provides a robust set of features for web and mobile.</p>\n</li>\n<li>\n<p>Axios</p>\n<p>Promise based HTTP client for the browser and node.js.</p>\n</li>\n<li>\n<p>Mongoosejs</p>\n<p>Mongoose provides a straight-forward, schema-based solution to model your application data.</p>\n</li>\n<li>\n<p>mLab</p>\n<p>Database-as-a-Service for MongoDB. Now part of the MongoDB family, powering over 1 million deployments worldwide.</p>\n</li>\n</ul>\n<hr>\n<p><strong>Planning</strong></p>\n<p>The first thing in full-stack apps is Setting up the back-end server.</p>\n<hr>\n<p><strong>Setting up nodejs</strong></p>\n<p>I used nodejs to setup the back-end for this app because nodejs is scalable, fast and easy to create real-time apps</p>\n<hr>\n<p><strong>Express, Mongoose, mLab</strong></p>\n<p>In the third step I setup Express Server, Mongoose Schemas/Models and connect our app with mLab database which will act as a DBaaS (Database as a service)</p>\n<hr>\n<p><strong>Planing API Structure</strong></p>\n<p>RESTfull API should be consistent and easy to integrate with our Front-end app that's why planning the API models is necessary for example our polls API looks like this /api/polls</p>\n<hr>\n<p><strong>Creating API Endpoints</strong></p>\n<p>We are creating a CRUD (Create, Read, Update, Delete) API, which can be done quickly with mongoose queries.</p>\n<hr>\n<p><strong>Front-End</strong></p>\n<p>Since we are done with back-end, we are going to add client-side code, and we will use create-react-app boilerplate to make our life easy. To connect our front-end with back-end we are going to use the NPM package \"concurrently\" to start both our servers at the same time. and to talk with our api endpoint, we have to set a proxy to our client-side package.json \"proxy\": \"<a href=\"http://localhost:5000\">http://localhost:5000</a>\"</p>\n<hr>\n<p><strong>UI</strong></p>\n<p>We have to let users interact with our back-end database through an elegant UI. So i decided to use Ant Design to scaffold the UIs. antd provides all the sleek UI components which can be used easily integrated with our app for example Menu, List, Input, Card, Popover, Icon</p>\n<hr>\n<p><strong>Making it real-time</strong></p>\n<p>After setting up our UI for our client-side CRUD operations, i used socket.io to make our app real-time, and I used ReactContextAPI to manage Global state of the app</p>\n<hr>\n<p><strong>Deployment</strong></p>\n<p>I'm going to use Heroku to deploy our app online. Heroku lets us deploy nodejs apps for free it uses something called Dynos to deploy nodejs apps. Finally, to deploy our app, I'm going to build our client-side React code and make an optimized production build.</p>","fields":{"slug":"/case-studies/quicker-poll"},"frontmatter":{"demo":"//quickerpoll.herokuapp.com","iframe":"//www.youtube.com/embed/10sL4z9BHNE/?modestbranding=1&showinfo=0&autohide=1&rel=0","src":"//github.com/anuraghazra/QuickerPoll","title":"QuickerPoll","info":{"idea":"The basic idea of this project is to create a MERN stack app with basic CRUD operations, but not to make a todo app","links":[["Mongoose","https://https://mongoosejs.com/"],["Nodejs","http://nodejs.org"]],"tech":["Nodejs","AntDesign","React","MongoDB"]}}}},"pageContext":{"slug":"/case-studies/quicker-poll"}},"staticQueryHashes":["1033876704"]}