Goxygen
Generate a modern Web project with Go and Angular, React, or Vue in seconds š²
Install / Use
/learn @Shpota/GoxygenREADME
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.16 or newer on your machine.
How to use
Run:
go run github.com/shpota/goxygen@latest init my-app
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.

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.
