Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

ramieali/Rust-Backend

Repository files navigation

forge-api

This README explains how to collaborate on this Gerust application.

The example application implements a simple tasks management system. Tasks are stored in PostgreSQL and can be created, read, updated, and deleted via the web interface. Any writing operations require authentication via a token.

Prerequisites

Project Structure

Distinct parts of the project are separated into separate crates:

.
├── cli // CLI tools for running DB migrations or generating project files
├── config // Defines the `Config` struct and handles building the configuration from environment-specific TOML files and environment variables
├── db // Encapsulates database access, migrations, as well as entity definitions and related code (if the project uses a database)
├── macros // Contains macros for application tests
└── web // The web interface as well as tests for it

Environment

The project uses .env and .env.test files to store configuration settings for the development and test environments respectively. Those files are read automatically by the parts of the application that require configuration settings to be present.

A Docker setup with preconfigured databases for the development and test environments is created out-of-the-box with the project. Boot the containers with

docker compose up

The .env and .env.test contain matching configuration out-of-the-box.

Commands

Running the application in development mode:

cargo run

Running the application tests:

cargo test

Running database tasks like executing migrations or seeding the database (see the CLI create for detailed documentation):

cargo db

Generating project files like entities, controllers, tests, etc. (see the CLI create for detailed documentation):

cargo generate

Building the project's docs:

Building documentation

Build the project's documentation with:

cargo doc --workspace --all-features

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

AltStyle によって変換されたページ (->オリジナル) /