https://github.com/codeitlikemiley/server_template
Create GRPC Server in sec
https://github.com/codeitlikemiley/server_template
cargo-generate grpc hyper proto rpc rust rust-lang template tonic
Last synced: 2 months ago
JSON representation
Create GRPC Server in sec
- Host: GitHub
- URL: https://github.com/codeitlikemiley/server_template
- Owner: codeitlikemiley
- License: mit
- Created: 2023-12-15T04:09:12.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-06-12T07:50:36.000Z (almost 2 years ago)
- Last Synced: 2024-06-12T12:44:44.150Z (almost 2 years ago)
- Topics: cargo-generate, grpc, hyper, proto, rpc, rust, rust-lang, template, tonic
- Language: Rust
- Homepage:
- Size: 59.6 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# GRPC Server Generator
[](https://github.com/codeitlikemiley/server_template/actions/workflows/build.yml)
## Requirements
Note: Install the following before you can use the template generator.
- [rust, rustup, cargo](https://www.rust-lang.org/tools/install)
- [cargo-workspace](https://crates.io/crates/cargo-workspaces)
- [cargo-generate](https://cargo-generate.github.io/cargo-generate/installation.html)
- [protoc](https://grpc.io/docs/protoc-installation/)
## Project Structure
```sh
workspace (root)
├── Cargo.toml
│
├── server <-- Generate Template this from **server_template**
│ └── .env.example
│ └── rust-toolchain.toml
│ └── Cargo.toml
│ └── README.md
│
├── frontend
│
└── services
```
## Usage
### Create a workspace
```sh
cd
cargo workspaces init .
```
or you can simply create a `Cargo.toml` with this content
```toml
[workspace]
resolver = "2"
members = [
server, # <- add this
# add here services here after you generated it
]
```
### Generate a new GRPC server template.
```sh
cargo generate --git codeitlikemiley/server_template --name server
cd server
```
### Build , Testing and Documentation
```sh
cargo build
cargo test
cargo doc --open
```
### Run Server
```sh
cargo run -p server
```
### Adding services
To add more services please check this [Services Template Repository](https://github.com/codeitlikemiley/services_template)
## [License](LICENSE)
## Pull Requests
If you need to make changes to the template, please submit a pull request.