Giter Site home page Giter Site logo

webdev's Introduction

WebDev Assignment M&B Book Shop

By Mark Clancy Sutton and Ben Connell

Front-end by Ben

The front-end is derived of 2 folders, pages and components. The pages contain the components such as the header or sidebar. The main page of the site is the home.js file. This file displays the carousel component created in the Carousel.js file. It also has a row of cards that are linked to the AllBooks.js page. This page is then surrounded by the footer.js component, the header.js file and the sidebar.js file. These are all imported and implemented across all pages as they all contain links around the site.

Back-end by Mark

In the backend is is all controlled by server.js which uses the functions and methods exporeted from the other .js files to connect to the mongodb server using the connection string and set it up to listen in on port 5000. The usermodel and bookmodel both crete the scheama that the database collection of users and books will be based off of and then export those to their repective controllers to allow them to do CRUD.In the controller folder both usercontroller and bookcontroller have created the functions to do CRUD on the 2 database collections books and users and export those functions to bookroutes and user routes. In the routes file for both of these collections is where the link between the front and back end is created by using the in built function of express.Router() to set up the get,post,patch and delete routes that we need when they are called in the front end to then start the function that they are linked with from the controller files. This will then allow the user form the front-end to access the datavabse in a limited settting to complete CRUD oeprations.

Deployment

To deploy our react-app can be done by installing the dependencies form both frontend and backend then run the backend using npm run backend and run the front end using npm start frontend. This should then open the react app and you can then see the books and login to the webpage. To login to do the CRUD operations you first would need to register an account to the email [email protected] and password as admin12. This only must be done if the database that you are connecting through is different then the connection we have already configured as of uploading. Then to login as the admin and have access to the databases login using the email [email protected] and password admin12 this should then redirect you to the userlist webpage then showing you all registered users allowing you to edit and delete them if you wish to. It also gives access to the book database using the button near the top left. While logging in also if you use a registered accounts details that isn't admin you will be redirected to the home page. Then you can explore as you wish too, even seeing a limited version of the book database without the ability to edit and delete like their is on the admin version of the page you can do this by hitting the information button on a card and then more info on that pop up.

webdev's People

Contributors

assassinsmaniac avatar c20424936 avatar markclancysutton avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.