Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ahmed-dinar/restful-in-peace
RESTful in Peace - A Pet Project
https://github.com/ahmed-dinar/restful-in-peace
hibernate java java-8 maven spring-boot spring-mvc springframework
Last synced: about 1 month ago
JSON representation
RESTful in Peace - A Pet Project
- Host: GitHub
- URL: https://github.com/ahmed-dinar/restful-in-peace
- Owner: ahmed-dinar
- License: mit
- Created: 2018-07-21T13:44:46.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-07-27T19:51:36.000Z (over 6 years ago)
- Last Synced: 2024-11-07T05:41:33.465Z (3 months ago)
- Topics: hibernate, java, java-8, maven, spring-boot, spring-mvc, springframework
- Language: Java
- Homepage: https://ahmed-dinar.github.io/restful-in-peace
- Size: 207 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# RESTful in Peace
##### [Database Schema File](https://github.com/ahmed-dinar/restful-in-peace/blob/master/database_schema.sql)
##### [Swagger Documentation](https://ahmed-dinar.github.io/restful-in-peace)
> ATTENTION!: After registration please insert a role named `ADMIN` in `role` table & user id in table `user_role` with the admin role id , otherwise `create, delete & update` of some endpoints will not work & without admin role.
> NOTE: A [`insomnia`](https://insomnia.rest/) generated file can be found [`HERE`](https://github.com/ahmed-dinar/restful-in-peace/blob/master/insomnia_restfulin_peace.json) & It can be imported in insomnia to test the api. All endpoints are added.
##### Technologies / Tools used
| | |
| ------------- | ------------- |
| JAVA | 1.8 |
| Web Application Framework | Spring Boot |
| Architecture | MVC |
| Database | MySQL |
| ORM | Hibernate |
| Database | Git(Github) |
| Build Tool | Maven |
| IDE | Spring Tool Suite |# Additional Documentation
### Generate Api Key
##### **URL** : `/apikey`**Method** : `GET`
**Privilege** : `ALL`
**Header**
```json
{}
```**Body**
```json
{}
```**Response**
```json
{
"key":
}
```### Create an Appointment
##### **URL** : `/api/insert/appointment/new`**Method** : `POST`
**Privilege** : `Admin`
**Header**
```json
token=
jwt_token=
```**Body**
```json
{
"doctor_id": ,
"patient_id": ,
"prescription": "",
"date_time": "31-07-2018 10:00:00"
}
```**Response**
```json
{
"Status": "Success"
}
```### Fetch All Appointments
##### **URL** : `/api/appointments `**Method** : `GET`
**Privilege** : `User`
**Header**
```json
token=
jwt_token=
```**Body**
```json
{}
```**Response**
```json
List of all the Appointments Object.
```### Fetch A Appointment
##### **URL** : `/api/appointments `**Method** : `GET`
**Privilege** : `User`
**Header**
```json
token=
jwt_token=
appointment_id=
```**Body**
```json
{}
```**Response**
```json
Appointments Object.
```### Fetch Appointments of A Doctor
##### **URL** : `/api/appointments `**Method** : `GET`
**Privilege** : `User`
**Header**
```json
token=
jwt_token=
doctor_id=
```**Body**
```json
{}
```**Response**
```json
List of all the Appointments Object of this doctor
```### Fetch Appointments of A Patient
##### **URL** : `/api/appointments `**Method** : `GET`
**Privilege** : `User`
**Header**
```json
token=
jwt_token=
patient_id=
```**Body**
```json
{}
```**Response**
```json
List of all the Appointments Object of this patient
```### Fetch Appointments between A Doctor & A Patient
##### **URL** : `/api/appointments `**Method** : `GET`
**Privilege** : `User`
**Header**
```json
token=
jwt_token=
doctor_id=
patient_id=
```**Body**
```json
{}
```**Response**
```json
List of all the Appointments Object with this doctor and patient
```### Update Appointment
##### **URL** : `/api/update/appointments`**Method** : `PUT`
**Privilege** : `Admin`
**Header**
```json
token=
jwt_token=
appointment_id=
```**Body**
```json
{
"prescription": "Long Live!"
}```
**Response**
```json
{
"status": "updated"
}
```### Delete Appointment
##### **URL** : `/api/delete/appointments`**Method** : `DELETE`
**Privilege** : `Admin`
**Header**
```json
token=
jwt_token=
appointment_id=
```**Body**
```json
{}
```**Response**
```json
{
"status": "deleted"
}
```### Create Role
##### **URL** : `/api/insert/role/new`**Method** : `POST`
**Privilege** : `Admin`
**Header**
```json
token=
jwt_token=
```**Body**
```json
{
"name":"MODERATOR",
"status":"ACTIVE"
}
```**Response**
```json
{
"status": "success"
}
```### Fetch All Roles
##### **URL** : `/api/roles `**Method** : `GET`
**Privilege** : `Admin`
**Header**
```json
token=
jwt_token=
```**Body**
```json
{}
```**Response**
```json
List of all Roles Object
```### Delete
##### **URL** : `/api/roles `**Method** : `DELETE`
**Privilege** : `Admin`
**Header**
```json
token=
jwt_token=
role_id=
```**Body**
```json
{}
```**Response**
```json
{
"status": "deleted"
}
```### Insert A Role of a User
##### **URL** : `/api/insert/userrole/new`**Method** : `POST`
**Privilege** : `Admin`
**Header**
```json
token=
jwt_token=
```**Body**
```json
{
"userId": ,
"roleId":
}```
**Response**
```json
{
"status": "success"
}
```### Get Roles of a User
##### **URL** : `/api/roles `**Method** : `GET`
**Privilege** : `Admin`
**Header**
```json
token=
jwt_token=
user_id=
```**Body**
```json
{}
```**Response**
```json
{
"first_name": ,
"email": ,
"mobile": ,
"roles" : [List of role object]
}
```### Delete a Role of a User
##### **URL** : `/api/delete/userrole`**Method** : `DELETE`
**Privilege** : `Admin`
**Header**
```json
token=
jwt_token=
role_id=
```**Body**
```json
{}
```**Response**
```json
{
"status": "deleted"
}
```### Get Registered User List
##### **URL** : `/user/all`**Method** : `GET`
**Privilege** : `Admin`
**Header**
```json
token=
jwt_token=
```**Body**
```json
{}
```**Response**
```json
List Of Registered User Object
```### Get A User
##### **URL** : `/user/:userId`**Method** : `GET`
**Privilege** : `Admin`
**Header**
```json
token=
jwt_token=
```**Body**
```json
{}
```**Response**
```json
The User Object
```
© MIT