Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to quickly generate a full-stack Web project

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article focuses on "how to quickly generate a full-stack Web project", interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Now let the editor take you to learn how to quickly generate a full-stack Web project.

Goxygen is committed to saving you time building a project. It automatically generates a fully configured project skeleton so that you can immediately start implementing your business logic. Goxygen produces the back-end Go code and connects it to the front-end components, and provides Dockerfile and docker-compose files for the generated project so that the project can run quickly in both the development and production environments.

Easy to use

Note that please use Go1.11+.

Go get-u github.com/shpota/goxygen go run github.com/shpota/goxygen init my-app

This will generate a project in your my-app directory.

The project is ready to run with docker-compose:

Cd my-app docker-compose up

After that, you can view your Web project at http://localhost:8080.

You can see more details in the README in the generated project.

The structure of the generated project (React/MongoDB-based project).

My-app ├── server # Go Project File │ ├── db # MongoDB Communications │ ├── model # Domain objects │ ├── web # REST APIs Web server │ ├── server.go # backend entry │ └── go.mod # backend depends on ├── webapp │ ├── public # icons, static files And index.html │ ├── src │ │ ├── App.js # React main component │ │ ├── App.css # App component style │ │ ├── index.js # Front Application Portal │ │ └── index.css # Global style │ ├── package.json # front end relies on │ ├── .env.development # API endpoint │ └── .env.production # including production environment API endpoint ├── Dockerfile # front and back end build Dockerfile ├── docker-compose.yml # docker-compose ├── docker-compose-dev.yml for production environment # docker-compose ├── init-db.js # used by developers to create a MongoDB collection And write the test data ├──. Docker # indicates the file ├── .gitignore └── README.md # to ignore when Docker build. How to use the tutorial on generating repo

Note that Goxygen only generates the basic framework of a project for you, but does not force you to use any specific tools. It doesn't add any unnecessary dependencies to your project. The only dependencies are back-end database driver and front-end axios.

At this point, I believe you have a deeper understanding of "how to quickly generate a full-stack Web project". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report