https://github.com/naspredam/rest-rust-users
User management service
https://github.com/naspredam/rest-rust-users
diesel-rs mysql mysql-database rest-api rust rust-lang
Last synced: 2 months ago
JSON representation
User management service
- Host: GitHub
- URL: https://github.com/naspredam/rest-rust-users
- Owner: naspredam
- Created: 2020-10-31T14:44:17.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2020-11-06T02:40:53.000Z (over 5 years ago)
- Last Synced: 2025-03-22T06:16:23.778Z (over 1 year ago)
- Topics: diesel-rs, mysql, mysql-database, rest-api, rust, rust-lang
- Language: Rust
- Homepage:
- Size: 54.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# rest-rust-users
This project has as objective to have a rest api build on:
- Rust (nightly) 1.49.0-nightly
- Diesel
- Rocket
- MySQL (8.0.22)
Using standard rest/web strategy, non-reactive.
## What the rest api stands for
The rest will have the resource:
```vim
/users
```
Where the endpoints exposed are:
| Method | Endpoint | Description |
| --- |:------- |:-----|
|GET| /users | Get all the users |
|POST| /users | Create a new user |
|PUT| /users/{user_id} | Update specific user data |
|GET| /users/{user_id} | Get specific user data |
|DELETE| /users/{user_id} | Delete specific user data |
## Run application
This project has been set to run under docker.
To run the application the `Makefile` has been set to:
- start: to start the application in docker
- stop: stop and drop the containers
- restart: does stop and start
- logs: display the logs of the deployed docker containers
So, the `start` action will do:
- build the image, which will compile the code as a builder inside of a rust docker image
- start the containers of the database (mysql) and service
The `stop` action will do:
- stop the application and database
- destroy the containers for the application and the database