Gorose orm+dotweb Framework Quick Build Go Web site Combat (ii)

Source: Internet
Author: User
This is a creation in Article, where the information may have evolved or changed.

Go Web project directory planning

Because gorose orm and dotweb frameworks are based on separate components, we can make a free plan for the catalog of the project.
Here, we plan a project directory that follows the general MVC structure.
For the ease of maintenance and high availability of the project, we try to adopt a mature architecture, separate the business module, here to draw on the php most popular framework pull laravel design ideas, to make a simple design-related architecture
The table of contents is as follows:

One. Routing:/router/

Place all routes, where the Dotweb routing component is used, and all the requested portals pass through here

Two. Controller:/controller/

Place all controllers, here is the basic business logic processing has

Three. Data manipulation:/model/

Place all the model, this is the main battlefield of Gorose ORM, all the database operations are done here

Four. Front page:/view/

Place all pages, here main write front end of Html+js+css

Five. Middleware:/middleware/

Place all of the middleware, where you can place a variety of cool hanging elements of the blast day

Six. Entry directory:/bootstrap/

Components used in the system, unified here Drive, easy maintenance management, this project mainly contains Gorose and dotweb here Drive

Seven. Configuration directory:/config/

Must be to place all the configuration files here

Eight. Log directory:/log/

It's nothing to say.

Forming directory structure

kuaixinwen    bootstrap        bootDatabase.go        bootRouter.go    config        database.go    middleware        Auth.go    controller        news.go    model        News.go    router        route.go    view        home.html        admin.html    main.go

The above components, in addition to the Model module using Gorose ORM components, Routing and some of the middleware modules are dotweb in the corresponding components to complete, here is more able to show the power of the modular framework Dotweb

view after the page in the directory is later expanded, it will be used vue to quickly build a simple web site, just use home.html and admin.html do an example

The project Source: Https://github.com/gohouse/kuaixinwen

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.