This is a simple Twitter clone built with Rust and Actix-web.
- User authentication (login and registration)
- Fetch user details by ID
- Secure password hashing with bcrypt
- JWT token generation for authentication
- actix-web
- rusqlite
- r2d2
- r2d2_sqlite
- serde
- futures-util
- tokio
- tracing
- chrono
- env_logger
- jsonwebtoken
- bcrypt
-
Clone the repository:
git clone https://github.com/yourusername/twitter-clone.git cd twitter-clone -
Install Rust and Cargo if you haven't already:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
-
Build the project:
cargo build
-
Run the server:
cargo run
- The server will start on
http://localhost:8080. - Use tools like Postman or curl to interact with the API.
GET /user/{id}: Fetch user details by ID.POST /auth: Authenticate user and get JWT token.
This project is licensed under the MIT License.