Giter Club home page Giter Club logo

twimi's Introduction

Twimi

A Twitter-like API implemented based on Layered Architecture.
(This is a deliverable of the internship at Yumemi Inc.)

How to build (MacOS)

Pre-requisites

  • Docker
brew install --cask docker
  • mold
brew install mold
  • sqlx-cli
cargo install sqlx-cli --no-default-features --features rustls,mysql

Build

Create and migrate MySQL database via Docker:

./scripts/init_mysql.sh

Set a key to encode a JWT with:

export SECRET_KEY="your-jwt-secret"

Build the server:

cargo build

twimi's People

Contributors

ryuma017 avatar

Stargazers

 avatar  avatar

Watchers

 avatar

twimi's Issues

JWT

"dummy token" を返してるので jwt を返すようにする。

image

Recreate database

あえて不適切な命名をしていたりするところがあるから直す

password service

自分だったらPasswordServiceというtraitを作ってそこにcompute_password_hash()verify_password_hash()を持たせるかも。

理由としては、ハッシュアルゴリズムの都合でハッシュ化と検証に同じsaltが必要になった場合、構造体が別れていると両方に同じsaltをDIする必要が出てくるからです👀。
構造体が同一ならDIする箇所は一箇所で済みます。

ただ、compute_password_hash()だけしたいときにもverify_password_hash()が構造体に生えてしまうので、メモリ効率的には若干悪くなるのかも?(おそらく気にするレベルではないが)

Originally posted by @ggg-mzkr in #30 (comment)

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.