GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - tarkalabs/muservice-rs: Boilerplate for a web service with Rust that connects to a database.

BranchesTags
Open more actions menu

Latest commit

 

History

59 Commits
59 Commits

Folders and files

NameName
Last commit message
Last commit date
.circleci
.circleci
 
 
migrations
migrations
 
 
settings
settings
 
 
src
src
 
 
tests
tests
 
 
.gitignore
.gitignore
 
 
Cargo.lock
Cargo.lock
 
 
Cargo.toml
Cargo.toml
 
 
Dockerfile
Dockerfile
 
 
Dockerfile.dev
Dockerfile.dev
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
docker-compose.yml
docker-compose.yml
 
 

Repository files navigation

muservice-rs

muservice-rs is a template for creating microservices in Rust. This template comes with:

  • Backend running an HTTP server with routing using axum
  • Postgres database connected to the backend using sqlx
  • Configuration with environment variables (12factor)
  • Logging
  • Example API endpoint handlers
  • Integration tests
  • CircleCI setup
  • Docker containers

Getting Started

Using Docker

  1. Clone the repository.
  2. Install Docker Compose.
  3. Build the service using docker compose build.
  4. Start the containers using docker compose up.
  5. View the logs using docker compose logs muservice.

Without Docker

  1. Clone the repository.
  2. Start a Postgres database.
  3. Set the database URL to point to a valid Postgres database in settings/default.json.
  4. Run the service using cargo run.

Environment variables

The environment variables are kept in the settings folder and are in JSON format. settings/default.json is always read and the values can be overwritten by having another JSON file whose name matches the environment variable ENV. You can also set environment variables through a .env file or the environment field of docker-compose.yml. Environment variables in .env files are written in uppercase and use _ as a separator between terms when specifying a nested field. An example can be found in docker-compose.yml. Each file can having missing fields, as long as the combination of all settings sources contains all necessary variables. For more details, such as other accepted file types for your settings, check the documentation of the config crate.

Tests

If you set up the project using Docker, the tests can be run by running cargo test within the muservice container. Otherwise, simply run cargo test from the project folder.

About

Boilerplate for a web service with Rust that connects to a database.

Topics

hacktoberfestrust

Resources

Readme
MIT license
Activity
Custom properties

Stars

5 stars

Watchers

14 watching

Forks

2 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.