Skip to content

Sleepy4k/rust-scholarmate-api

Repository files navigation

Scholarmate

an API service made for the needs of scholarship registration for students to ease the burden of registering for lectures

Screenshots

App Screenshot

Tech Stack

Server: Rust, Postgresql, Actix Web

Features

  • Authentication system
  • Middleware
  • Database model
  • Database schema
  • Database migration
  • Unit test

Lessons Learned

When i make this service, i feel like this project has good performance than the other like laravel and express. After some update i learn something that i think i don't get it before, like i get better when search problem error, implement new system and server security.

Run Locally

Clone the project

  git clone https://github.com/Sleepy4k/rust-scholarmate-api

Go to the project directory

  cd rust-scholarmate-api

Install dependencies (if you already install sqlx-cli than skip it)

  cargo install sqlx-cli

Copy .env file

  copy .env.example .env

Create database (if you already create one and make sure you already setting up .env file)

  sqlx database drop

Create database (make sure you already setting up .env file)

  sqlx database create

Migrate database (make sure you already setting up .env file)

  sqlx migrate run

Build the server

  cargo build

Start the server

  cargo run

Start the server (for production)

  cargo run --release

Enabling auth service

  cargo run --bin auth_service

Enabling export data

  cargo run --bin export_data

Enabling websocket service

  cargo run --bin ws_service

Want to run all service and run for production? build all service and run it in release mode (run it from target/release)

  cargo build --release
  cargo build --release --bin export_data
  cargo build --release --bin auth_service
  cargo build --release --bin ws_service

Environment Variables

To run this project, you will need to add the following environment variables to your .env file

DATABASE_URL

JWT_TOKEN_TITLE

JWT_TOKEN_SECRET

Acknowledgements

Feedback

If you have any feedback, please reach out to us at sarahpalastrin@gmail.com

License

MIT

About

Api service for scholarmates project using rust

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages