Skip to content

MarkoSOE/codingcuecards

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Introduction

Full stack interview flashcards

This is a web application where the user is greeted with a homepage that contains a heading and a button. Upon clicking the button, the user is presented a random interview type question in the space below. The user can click the button any number of times to generate new questions.

How it's made

badge sample badge sample badge sample badge sample badge sample badge sample badge sample

The web application is built using the Express framework, allowing us to manage client requests to our server.js. Upon opening the application, the static HTML is sent to the browser as a response to the '/' route. Once the user clicks the button on the homepage, a get request is sent to our server.js file. The server then grabs the contents of the collection within the database, converts it to an array, and sends a single document to our EJS file which renders an HTML with the contents of the document displayed.

Optimizations

Currently, the server grabs all documents from the collection, converts it to an array, generates a random number to index the array, and from there sends the single element length array to the EJS file. An optimization would be to grab a single document from the mongodb collection instead of the whole collection. This would reduce the time between getting the question from the database to the HTML the EJS renders for the user to see. Another optimization could be made to make the grabbing of random documents more random. As of now there's a chance of getting the same document twice in a row. To improve this I would implement a method of keeping track of the past document that was obtained and preventing the server from obtaining the same document a second time in a row.

Lessons learned

In this project I learned more about CSS styling and animations, as well as organization of sections using flexbox. I've also learned more about connecting to mongodb using express/node.js even though the application only uses read requests, I've initially had to insert the documents into the collection in a single array of objects. The biggest hurdle was getting the application working once deployed to Heroku. Hours were spent debugging when the issue was not adding in the database connection string as a config variable within Heroku.

About

Train for your next interview with questions from different categories using this flash card mongodb app

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors