xgenx
v1.1.1
Published
A microservice template generator
Downloads
10
Maintainers
Readme
XgenX
XgenX is a microservice template generator. It helps you quickly scaffold a new microservice project with pre-configured architecture, APIs, and utility helpers, saving you time and ensuring consistency across your microservice projects.
Features
- Generate microservice boilerplate for Go language.
- Supports different architectural patterns like Clean Architecture.
- Option to include REST APIs and utilities.
- Select various databases like MySQL, PostgreSQL, MongoDB, Redis, and more.
- Easily add logging, time utilities, and response helpers.
- Supports custom external service integration.
- Automatically installs Google Wire when using Clean Architecture.
- Includes Makefile, editor config, and other project essentials.
Installation
xgenx is designed to be installed globally so you can use it in any project.
npm install -g xgenx
Once installed, you can run the xgenx
command to generate your project.
Usage
To create a new microservice project, run:
xgenx
You will be prompted with a series of questions to configure your project, such as:
- Project name
- Programming language (currently supports Go)
- Architecture type (e.g., Clean Architecture)
- API type (e.g., REST)
- Helpers and utilities to include (e.g., logging, time utilities)
- Database choice (MySQL, PostgreSQL, MongoDB, etc.)
- External service integration (optional)
- Sample domain generation (optional)
After answering the prompts, xgenx will scaffold a new project in the specified directory.
Example
xgenx
Example prompts:
? Enter project name (e.g., my-microservice): awesome-service
? Choose programming language: Go
? Choose architecture type: Clean Architecture
? Enter Golang Module Name: github.com/yourname/awesome-service
? Choose API type: REST
? Choose helpers to include: Logging, General Rest Utils
? Choose databases to use: PostgreSQL
? Do you want to include a sample domain source? Yes
? Provide a name for the example Domain: user
Once the generation is complete, the directory awesome-service/
will contain the scaffolded project.
Configuration Options
Languages
Currently, xgenx supports Go for generating microservice boilerplates. More languages will be added in future releases.
Architecture
- Clean Architecture: Pre-configured support for Clean Architecture.
- MVP Architecture (Coming soon)
Databases
Select one or more databases to include in the project:
- MySQL
- PostgreSQL
- MongoDB
- ElasticSearch
- Redis
Note: You cannot select both MySQL and PostgreSQL in the same project.
Helpers
xgenx allows you to include the following helpers in your project:
- General Rest Utils: Common utilities for working with REST APIs.
- Response Helper: Helpers for structuring API responses.
- Time Utilities: Functions to handle time manipulation.
- Logging: Structured logging for your service.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Contributing
Contributions are welcome! Feel free to submit issues or pull requests on the GitHub repository.
Author
Created and maintained by Teuku Mulia Ichsan.