Skip to content

πŸš€ A collection of realworld starter projects with good practices that can be modified for your needs in πŸ•• 30 seconds.

License

Notifications You must be signed in to change notification settings

neon-mmd/30-seconds-realworld-app-starter-collections

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

15 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Actix service bootstrap

What is this

This repository contain a fully working example of a service written with actix. It is meant to be as close as production ready as possible while remaining minimal and easy to understand. The service itself is a basic Create / Read / Update / Delete of a todo list, showcasing good production practices for web applications

What you may reuse pulling this example

  • A fast web service in an extensible port and adapter pattern, using dependency injection
  • Documented sources you can play around and make experimental changes with
  • Multi stage docker file for building minimal images
  • API documentation and manual testing with Swagger UI, Redoc, Rapi
  • Async postgres client storage example
  • Unit testing using fixtures
  • Integration testing
  • Access logging

Run and build the project

With docker:

Run docker compose up -d. On the first creation of db, it sends too soon a ready signal which may crash the web app. You may do docker compose start app to restart the service

Without docker

Out of the box you will need a running postgres local instance. The code is provided without Tls option enabled. Once your postgres server is running, simply cargo run. Alternatively you can use an in-memory store provided. Swapping storage method is only a couple of line changes in the main.rs.

Testing

  • Unit testing cargo test --lib --bins
  • Integration testing cargo test --test '*'. You will need to run the server instance to be able to pass integration test. See notes in the source file.

License

MIT Meant to be used, derived or commercialised freely and openly anywhere.

About

πŸš€ A collection of realworld starter projects with good practices that can be modified for your needs in πŸ•• 30 seconds.

Topics

Resources

License

Stars

Watchers

Forks