An open API service indexing awesome lists of open source software.

https://github.com/anmamun0/datadonor-webapp

Backend
https://github.com/anmamun0/datadonor-webapp

django-rest-framework postgressql

Last synced: 10 months ago
JSON representation

Backend

Awesome Lists containing this project

README

          

# Data.Doner-Backend

## API Endpoints

### Authentication APIs
- **Register API:** [http://127.0.0.1:8000/accounts/](http://127.0.0.1:8000/accounts/)
- **Login API:** [http://127.0.0.1:8000/accounts/login/](http://127.0.0.1:8000/accounts/login/)
- **Logout API:** [http://127.0.0.1:8000/accounts/logout/](http://127.0.0.1:8000/accounts/logout/)
- **All User List:** [http://127.0.0.1:8000/accounts/users/](http://127.0.0.1:8000/accounts/users/)

### User Profile APIs
- **All Profile List:** [http://127.0.0.1:8000/accounts/profiles/](http://127.0.0.1:8000/accounts/profiles/)

**Filters:**
- `?user_id=`

**PUT Requests:**
- `/profiles//update-image/` - Update profile image with `{'image': }`
- `/profiles//update-profile/` - Update profile with the following fields:
- **User:** `{'first_name', 'last_name', 'email'}`
- **Profile:** `{'phone', 'age', 'gender', 'blood', 'division', 'country'}`

### Event Management APIs
- **All Events List:** [http://127.0.0.1:8000/event/events/](http://127.0.0.1:8000/event/events/)

**GET Requests:**
- `?user=`
- `?doner=`

**PUT Requests:**
- `/events//accepted/` - Accept an event request with `{'doner_id', 'doner_message'}`
- `/events//received/` - Mark the event creator as having received blood with `{}`

**Example:**
```json
{
"user": 14,
"title": "Blood Donation Event",
"description": "A description of the blood donation event",
"event_date": "2025-06-19",
"event_time": "14:00",
"blood": "A+"
}
```

- **Create Event:** [http://127.0.0.1:8000/event/events/create/](http://127.0.0.1:8000/event/events/create/)

**POST Request Body:**
```json
{
"user": 1,
"title": "Emergency Blood Donation",
"description": "Description of the event",
"event_date": "2025-01-25",
"event_time": "14:30:00"
}
```

**Filters:**
- `?user=`
- `?status=Completed`
- `?event_id=`
- `?doner=`
- `?event_date=`
- `?blood=`
- `?last_donate=`

##### data.doner-backend
##### data.doner-123

# DataDonor-webapp
# DataDonor-webapp