Giter Site home page Giter Site logo

authrust's Introduction

Authentication Service in Rust (IN PROGRESS)

This is a simple, experimental authentication service built in Rust. It includes functionalities such as user registration and viewing all users. More functionality to follow.

Requirements

  • Rust (latest stable version)
  • PostgreSQL

Environment Variables

You need to set the following environment variables for database configuration:

  • DATABASE_URL: The connection string of your PostgreSQL database in the format postgres://username:password@localhost/database_name.
  • ROCKET_SECRET_KEY: The secret key Rocket will use to encrypt cookies. You can use openssl rand -base64 32 to generate a new key.

You can set this variables in your environment or in a .env file at the root of your project.

Running the Project

  1. Make sure you have created your database instance locally and set the DATABASE_URL environment variable correctly. Then run your Diesel migrations to set up the database schema.

    diesel migration run
    
  2. Use Cargo to build and run the project:

    cargo run --bin authrust

This will start the server. The port and host would depend on how you have configured your Rocket application.

Note: As this project is experimental, it may have issues or lack certain features. It is not recommended for use in production environments without further development and testing.

Project Structure

The project has been structured in a modular fashion with separate files for database operations, schema definitions, and business logic. If you're new to Rust, it may take some time to familiarize yourself with the ownership, borrowing and lifetime concepts which are heavily used in this project.

Feel free to explore the project and open issues or pull requests if you have any questions, comments, or improvements.

Happy coding!

authrust's People

Contributors

francoabaroa avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.