We've published a new version of Goxygen, a generator of Go-backed web projects, now with t...

栏目: IT技术 · 发布时间: 4年前

内容简介:Goxygen aims at saving your time while setting up a new project. It creates a skeleton of an application with all configuration done for you. You can start implementing your business logic straight away. Goxygen generates back end Go code, connects it with

Goxygen

Generate a Web project with Go, Angular/React/Vue, and MongoDB in seconds.

Goxygen aims at saving your time while setting up a new project. It creates a skeleton of an application with all configuration done for you. You can start implementing your business logic straight away. Goxygen generates back end Go code, connects it with front end components, provides a Dockerfile for the application and creates docker-compose files for convenient run in development and production environments.

How to use

You need to have Go 1.11 or newer on your machine.

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

This generates a project in my-app folder.

By default, a React-based project is generated. You can choose

from Angular, React and Vue by passing angular , react and vue to the --frontend flag. For example:

go run github.com/shpota/goxygen init --frontend vue my-app

The generated project is ready to run with docker-compose :

cd my-app
docker-compose up

After the build is completed, the application is accessible on http://localhost:8080 .

You can find more details on how to work with the generated project in its readme file.

We've published a new version of Goxygen, a generator of Go-backed web projects, now with t...

Structure of a generated project (React-based app)

my-app
├── server                   # Go project files
│   ├── db                   # MongoDB communications
│   ├── model                # domain objects
│   ├── web                  # REST APIs, web server
│   ├── server.go            # the starting point of the server
│   └── go.mod               # server dependencies
├── webapp                    
│   ├── public               # icons, static files, and index.html
│   ├── src                       
│   │   ├── App.js           # the main React component
│   │   ├── App.css          # App component-specific styles
│   │   ├── index.js         # the entry point of the application          
│   │   └── index.css        # global styles
│   ├── package.json         # front end dependencies
│   ├── .env.development     # holds API endpoint for dev environment
│   └── .env.production      # API endpoint for prod environment
├── Dockerfile               # builds back end and front end together
├── docker-compose.yml       # prod environment deployment descriptor
├── docker-compose-dev.yml   # runs local MongoDB for development needs
├── init-db.js               # creates a MongoDB collection with test data
├── .dockerignore            # specifies files ignored in Docker builds
├── .gitignore
└── README.md                # guide on how to use the generated repo

Files such as unit tests or sample components are not included here for simplicity.

Dependencies

Goxygen generates a basic structure of a project and doesn't force you to use a specific set of tools. That's why it doesn't bring unneeded dependencies to your project. It uses only mongo-go-driver on the back end side and axios in React and Vue projects. Angular projects use only Angular specific libraries.

How to contribute

If you found a bug or have an idea on how to improve the project open an issue and we will fix it as soon as possible. You can also propose your changes via a Pull Request. Fork the repository, make changes, send us a pull request and we'll review it shortly. We also have a Gitter chat where we discuss all the changes.

Credits

Goxygen's logo was created by Egon Elbre .


以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

HTML5与CSS3基础教程(第8版)

HTML5与CSS3基础教程(第8版)

[美] Elizabeth Castro、[美] Bruce Hyslop / 望以文 / 人民邮电出版社 / 2014-5 / 69.00元

本书是风靡全球的HTML和CSS入门教程的最新版,至第6版累积销量已超过100万册,被翻译为十多种语言,长期雄踞亚马逊书店计算机图书排行榜榜首。 第8版秉承作者直观透彻、循序渐进、基础知识与案例实践紧密结合的讲授特色,采用独特的双栏图文并排方式,手把手指导读者从零开始轻松入门。相较第7版,全书2/3以上的内容进行了更新,全面反映了HTML5和CSS3的最新特色,细致阐述了响应式Web设计与移......一起来看看 《HTML5与CSS3基础教程(第8版)》 这本书的介绍吧!

CSS 压缩/解压工具
CSS 压缩/解压工具

在线压缩/解压 CSS 代码

XML 在线格式化
XML 在线格式化

在线 XML 格式化压缩工具

HSV CMYK 转换工具
HSV CMYK 转换工具

HSV CMYK互换工具