Giter Club home page Giter Club logo

cs209_finalproject's Introduction

Spring-Project

HOPE YOU CLICK A STAR:star::star::star:

In this project, you need to implement a system which can crawl data from websites can display them in the front end. Your front end should communicate with the back end and send a request, then the back end will give the front end feedback.

  • We suggest you follow the MVC (Model–view–controller) design pattern, which is used for developing user interfaces that divide the related program logic into three interconnected elements. This is done to separate internal representations of information from the ways information is presented to and accepted from the user.
  • Also, you can learn by yourself how to design spring-boot layers, you can refer to this link for more information.

This part will explain how this demo work.

  1. In src/main/resources/static/index.html, it is the entrance of front end. When you enter localhost:8084 (you can change 8084 to other port in file Spring-Project/application.yml), the browser would open index.html. In the script part of this html, it send a url: /repo/getInfo2 to the back end, and then display the response from back end.

  2. When the back end received the url request, more detailed in RepoController.java, back end would process @GetMapping("/getInfo2"), and you can see the following part would return response to front end.

  3. @GetMapping("/getInfo2") is the most simple example of communication between frond end and back end. However, it is not so elegant. When you project is more complex or has more codes to maintain, it is really a bad idea to just use controller. We highly suggest you follow the MVC pattern, where you can refer to@GetMapping("/getInfo1"), which is followed more strict design idea:

    controller gets the url

    $\Downarrow$

    interface executes the abstract method

    $\Downarrow$

    interface-implementation runs the real method

    $\Downarrow$

    most time you would return an object in domain/entity layer

However, we would not grade for how you design you project, but a kind suggestion is that you should keep to these good habit and clean codes.


What's more, to reduce your workload, we do not add database requirement in our project. However, one of spring-boot's advantages is its interaction with database. You can add postgresql or mysql, with the aid of Mybatis or Hibernate. There are several ways to connect the database, you can explore by yourself.

Also, there are lots of tricks, like Lombok and Swagger, which would greatly help you during development. If you want to implement more elaborate front end, we suggest thymeleaf, vue-cli, bootstrap, react, element-ui, etc. Nevertheless, you should look for their communication with back end, once you master one technique, it would be convenient for future study.


If you have any question, feel free to leave an issue.

cs209_finalproject's People

Contributors

zhouziyiaichifeiniu 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.