Skip to content

Latest commit

 

History

History
123 lines (88 loc) · 2.03 KB

README.md

File metadata and controls

123 lines (88 loc) · 2.03 KB

Rust Training

This is the code to training materials.

Technologies are as below:

  • Rust programming language #rust_lang
  • Actix web framework
  • Postgres for database
  • Diesel ORM
  • REST API

Development steps

Run application

After downloading this repo:

  • install database

    diesel setup
    
  • run application

    cargo run
    

REST API queries using Postman

Total APIs to be developed as below:

  • register
  • login
  • user
  • refresh
  • logout
  • forgot
  • reset
  • two-factor
  • google-auth

register endpoint

  • Request:

    GET http://127.0.0.1:8000/register
    
        {
            "first_name": "...",
            "last_name": "...",
            "email": "...",
            "password": "...",
            "confirm_password": "..."
        }
  • Response:

    TODO
    

login endpoint

  • Request:

    GET http://127.0.0.1:8000/login
    
        {
            "email": "...",
            "password": "..."
        }
  • Response:

        {
            "message": "User authenticated",
            "data": true
        }


References

Below are little resources:
https://serde.rs/derive.html
https://stackoverflow.com/questions/62269278/how-can-i-make-protected-routes-in-actix-web
https://actix.rs/docs/middleware/
https://actix.rs/



Thanks

Developed by Moaz bin Mohamed Mokhtar