- Introduction
- Prerequisites and dependencies
- Setup Instructions
- Build
- Running the server
- Running the client
This is a sample application which implements a Simple Pokedex like application, used for demonstrating gRPC implementation with Rust. This application is for demo purposes only.
Apart from the rust lang dependencies, you need the PostgreSQL as a backend to run this project.
The following dependencies are used in this project
Dependency | Purpose |
---|---|
diesel | For ORM |
tonic | gRPC |
dotenv | For configuring and reading environment variables |
Install diesel-cli
by running
cargo install diesel_cli
Create a copy of the .env.example
as .env
cp .env.example .env
Alter the values in the .env file to the required values. Then run
diesel setup
First, to run all migrations, run
diesel migration run
To build the application, run
cargo build
To start the server, run
cargo run --bin server
The server will start running on the APP_PORT
specified in .env
file.
The application can be tested using a app like BloomRPC or a CLI application like grpcc or grpcurl.
Ensure that there is a SERVER_URL
in the format http://<ip>:<port>
in the .env
file.
To run the client, run
cargo run --bin client
The client will start make a pokedex entry and will query the result.
Pokémon images, names and information (c) 1995-2014 Nintendo/Game freak.
This site was built entirely for education purposes only.