We've published a new version of Goxygen, a generator of Go-backed web p...
source link: https://github.com/Shpota/goxygen/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
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.
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 .
Recommend
-
5
OpenSSL version 3.0.0 publishedOpenSSL version 3.0.0 published OpenSSL
-
5
Lots of optional features — USB-C can hit 120Gbps with newly published USB4 Version 2.0 spec USB-IF's new USB-C spec supports up to 120Gbps across three lanes....
-
4
TechWhy everyone is talking about an image generator released by an Elon Musk-backed A.I. lab Published Fri, Jan 8 20216:42 AM ESTUpdated Fri,...
-
13
< Back to the blog Conan 1.42 : New Conan XcodeDeps multi-config generator for Xcode, added new OSX version 12.0 (Monterey), easier aggregated environment deactivation....
-
4
extreme close-up — “Too easy”—Midjourney tests dramatic new version of its AI image generator Version 4 offers greater detail and better compositions from simple prompts.
-
0
Andre Fischer January 30, 2023 1 minute read...
-
2
Real AI - AI Photo Generator & InpaintCreate realistic AI photosFree OptionsReal AI – AI Photo Generator Are you looking for an app to easily create or transform phot...
-
4
Support is great. Feedback is even better."The real question is, for anyone who calls themselves a traveler (or even someone who might vacation this year): would you use this product? What would make you use this product? (I.e.: what...
-
2
Support is great. Feedback is even better."Please if you have any feedback or suggestion, let me know, thanks."The makers of Keyboard AI
-
4
Generate your privacy policy & tos using AI, 100% freeSupport is great. Feedback is even better."Thanks for checking out my first launch of 2024. I'd love for you to follow my journey, if you have any feedback or what you w...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK