goxygen

goxygen

Go全栈Web项目自动生成工具

Goxygen是一个开源的Web项目生成工具,用于快速创建基于Go后端和Angular、React或Vue前端的应用框架。它通过自动化配置简化了全栈开发流程,支持MongoDB、MySQL和PostgreSQL数据库集成。Goxygen还提供Docker支持,方便开发和生产环境部署。该工具旨在让开发者能够迅速搭建项目结构,专注于核心业务逻辑的实现。

GoxygenWeb开发Go前端框架数据库Github开源项目
<h1 align="center"> <a href="https://github.com/Shpota/goxygen/tree/main/.github/README.md"> <img height="25px" src="https://cdnjs.cloudflare.com/ajax/libs/flag-icon-css/3.4.6/flags/4x3/gb.svg"> </a> <a href="https://github.com/Shpota/goxygen/tree/main/.github/README_zh.md"> <img height="20px" src="https://cdnjs.cloudflare.com/ajax/libs/flag-icon-css/3.4.6/flags/4x3/cn.svg"> </a> <a href="https://github.com/Shpota/goxygen/tree/main/.github/README_ua.md"> <img height="20px" src="https://cdnjs.cloudflare.com/ajax/libs/flag-icon-css/3.4.6/flags/4x3/ua.svg"> </a> <a href="https://github.com/Shpota/goxygen/tree/main/.github/README_ko.md"> <img height="20px" src="https://cdnjs.cloudflare.com/ajax/libs/flag-icon-css/3.4.6/flags/4x3/kr.svg"> </a> <a href="https://github.com/Shpota/goxygen/tree/main/.github/README_pt-br.md"> <img height="20px" src="https://cdnjs.cloudflare.com/ajax/libs/flag-icon-css/3.4.6/flags/4x3/br.svg"> </a> <a href="https://github.com/Shpota/goxygen/tree/main/.github/README_by.md"> <img height="20px" src="https://raw.githubusercontent.com/Shpota/goxygen/main/.github/flag-by.svg"> </a> <a href="https://github.com/Shpota/goxygen/tree/main/.github/README_fr.md"> <img height="20px" src="https://cdnjs.cloudflare.com/ajax/libs/flag-icon-css/3.4.6/flags/4x3/fr.svg"> </a> <a href="https://github.com/Shpota/goxygen/tree/main/.github/README_es.md"> <img height="20px" src="https://cdnjs.cloudflare.com/ajax/libs/flag-icon-css/3.4.6/flags/4x3/es.svg"> </a> <a href="https://github.com/Shpota/goxygen/tree/main/.github/README_jp.md"> <img height="20px" src="https://cdnjs.cloudflare.com/ajax/libs/flag-icon-css/3.4.6/flags/4x3/jp.svg"> </a> <a href="https://github.com/Shpota/goxygen/tree/main/.github/README_id.md"> <img height="20px" src="https://cdnjs.cloudflare.com/ajax/libs/flag-icon-css/3.4.6/flags/4x3/id.svg"> </a> <a href="https://github.com/Shpota/goxygen/tree/main/.github/README_he.md"> <img height="20px" src="https://cdnjs.cloudflare.com/ajax/libs/flag-icon-css/3.4.6/flags/4x3/il.svg"> </a> <a href="https://github.com/Shpota/goxygen/tree/main/.github/README_tr.md"> <img height="20px" src="https://cdnjs.cloudflare.com/ajax/libs/flag-icon-css/3.4.6/flags/4x3/tr.svg"> </a> <br> Goxygen <a href="https://github.com/Shpota/goxygen/actions?query=workflow%3Abuild"> <img src="https://github.com/Shpota/goxygen/workflows/build/badge.svg"> </a> <a href="https://github.com/Shpota/goxygen/releases"> <img src="https://img.shields.io/github/v/tag/shpota/goxygen?color=green&label=version"> </a> <a href="https://gitter.im/goxygen/community"> <img src="https://badges.gitter.im/goxygen/community.svg"> </a> <a href="https://github.com/Shpota/goxygen/pulls"> <img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg"> </a> </h1> <img src="../templates/vue.webapp/src/assets/logo.svg" align="right" width="230px" alt="goxygen logo">

Generate a Web project with Go and Angular, React or Vue.

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.

<table> <thead> <tr align="center"> <td colspan=4><b>Supported Technologies</b></td> </tr> </thead> <tbody> <tr align="center"> <td align="center">Front End</td> <td>Angular</td> <td>React</td> <td>Vue</td> </tr> <tr align="center"> <td>Back End</td> <td colspan=3>Go</td> </tr> <tr align="center"> <td>Database</td> <td>MongoDB</td> <td>MySQL</td> <td>PostgreSQL</td> </tr> </tbody> </table>

Requirements

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

How to use

Go 1.17 and later:

go run github.com/shpota/goxygen@latest init my-app
<details> <summary>Older versions of Go</summary>

Go 1.16

Set the GO111MODULE environment variable to auto.

export GO111MODULE=auto

Run

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

Go 1.11 - 1.15

Run

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

This generates a project in my-app folder.

By default, it will use React and MongoDB. You can select a different front end framework and a database using --frontend and --db flags. For instance, this command will create a project with Vue and PostgreSQL:

go run github.com/shpota/goxygen@latest init --frontend vue --db postgres my-app

The --frontend flag accepts angular, react and vue. The --db flag accepts mongo, mysql and postgres.

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.

Showcase

Structure of a generated project (React/MongoDB example)

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 a database 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.

编辑推荐精选

扣子-AI办公

扣子-AI办公

职场AI,就用扣子

AI办公助手,复杂任务高效处理。办公效率低?扣子空间AI助手支持播客生成、PPT制作、网页开发及报告写作,覆盖科研、商业、舆情等领域的专家Agent 7x24小时响应,生活工作无缝切换,提升50%效率!

堆友

堆友

多风格AI绘画神器

堆友平台由阿里巴巴设计团队创建,作为一款AI驱动的设计工具,专为设计师提供一站式增长服务。功能覆盖海量3D素材、AI绘画、实时渲染以及专业抠图,显著提升设计品质和效率。平台不仅提供工具,还是一个促进创意交流和个人发展的空间,界面友好,适合所有级别的设计师和创意工作者。

图像生成热门AI工具AI图像AI反应堆AI工具箱AI绘画GOAI艺术字堆友相机
码上飞

码上飞

零代码AI应用开发平台

零代码AI应用开发平台,用户只需一句话简单描述需求,AI能自动生成小程序、APP或H5网页应用,无需编写代码。

Vora

Vora

免费创建高清无水印Sora视频

Vora是一个免费创建高清无水印Sora视频的AI工具

Refly.AI

Refly.AI

最适合小白的AI自动化工作流平台

无需编码,轻松生成可复用、可变现的AI自动化工作流

酷表ChatExcel

酷表ChatExcel

大模型驱动的Excel数据处理工具

基于大模型交互的表格处理系统,允许用户通过对话方式完成数据整理和可视化分析。系统采用机器学习算法解析用户指令,自动执行排序、公式计算和数据透视等操作,支持多种文件格式导入导出。数据处理响应速度保持在0.8秒以内,支持超过100万行数据的即时分析。

AI工具使用教程AI营销产品酷表ChatExcelAI智能客服
TRAE编程

TRAE编程

AI辅助编程,代码自动修复

Trae是一种自适应的集成开发环境(IDE),通过自动化和多元协作改变开发流程。利用Trae,团队能够更快速、精确地编写和部署代码,从而提高编程效率和项目交付速度。Trae具备上下文感知和代码自动完成功能,是提升开发效率的理想工具。

热门AI工具生产力协作转型TraeAI IDE
AIWritePaper论文写作

AIWritePaper论文写作

AI论文写作指导平台

AIWritePaper论文写作是一站式AI论文写作辅助工具,简化了选题、文献检索至论文撰写的整个过程。通过简单设定,平台可快速生成高质量论文大纲和全文,配合图表、参考文献等一应俱全,同时提供开题报告和答辩PPT等增值服务,保障数据安全,有效提升写作效率和论文质量。

数据安全AI助手热门AI工具AI辅助写作AI论文工具论文写作智能生成大纲
博思AIPPT

博思AIPPT

AI一键生成PPT,就用博思AIPPT!

博思AIPPT,新一代的AI生成PPT平台,支持智能生成PPT、AI美化PPT、文本&链接生成PPT、导入Word/PDF/Markdown文档生成PPT等,内置海量精美PPT模板,涵盖商务、教育、科技等不同风格,同时针对每个页面提供多种版式,一键自适应切换,完美适配各种办公场景。

热门AI工具AI办公办公工具智能排版AI生成PPT博思AIPPT海量精品模板AI创作
潮际好麦

潮际好麦

AI赋能电商视觉革命,一站式智能商拍平台

潮际好麦深耕服装行业,是国内AI试衣效果最好的软件。使用先进AIGC能力为电商卖家批量提供优质的、低成本的商拍图。合作品牌有Shein、Lazada、安踏、百丽等65个国内外头部品牌,以及国内10万+淘宝、天猫、京东等主流平台的品牌商家,为卖家节省将近85%的出图成本,提升约3倍出图效率,让品牌能够快速上架。

下拉加载更多