Skip to content

An Actix Web boilerplate with R2D2 and Diesel ORM/Migrations

License

Notifications You must be signed in to change notification settings

jkcdarunday/actix-web-boilerplate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Actix Web Boilerplate

An Actix Web boilerplate with R2D2 and Diesel ORM/Migrations support

Requirements

  • Rust Stable/Nightly
  • Cargo

Database Support

Currently the repository is set up to use PostgreSQL as its DBMS. However, you can change this to other diesel-compatible DBMSes by changing PgConnection in src/db/mod.rs to your preferred choice and importing necessary dependencies in Cargo.toml

Folder Structure

The following are the notable folders with their descriptions:

  • /migrations - Contains your diesel migrations
  • /src/app - Contains most files related to your app
    • /src/app/api - Contains methods for handling requests
    • /src/app/db - Contains methods for connecting to the database and setting up connection pools
    • /src/app/models - Contains your diesel model files

Configuration

  • You can set configuration variables in config.toml
  • You can also configuration variables via environment variables which will override config.toml
    • i.e. APP_LISTEN_ADDRESS=localhost:9999

Building

Build using cargo:

cargo build

Running

Run using cargo:

cargo run

About

An Actix Web boilerplate with R2D2 and Diesel ORM/Migrations

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published