https://github.com/slashtechno/inbox
https://github.com/slashtechno/inbox
Last synced: over 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/slashtechno/inbox
- Owner: slashtechno
- Created: 2025-01-19T02:33:49.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-31T02:50:17.000Z (over 1 year ago)
- Last Synced: 2025-01-31T03:23:09.384Z (over 1 year ago)
- Language: Python
- Size: 67.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Inbox
A rudimentary API for creating "inboxes", which you can receive messages to. Even without creating an inbox, you can send messages to other inboxes.
Please note, content is user-generated so use at your own risk.
I also used Inbox as a learning project to get famillar with SQLModel and OAuth with FastAPI.
## Endpoints
Besides `/login`, data is sent via a JSON body.
Authentication is done via JWT tokens, which are passed in the `Authorization` header as `Bearer `.
### `POST /login`
Takes form data with a `username` and `password` field. Returns a JWT token.
### `POST /inbox`
Takes a JSON body with a `username` and `password` field. Returns a JWT token. **The password is hashed in the database!**
### `GET /inboxes`
Get your current inbox and its information, including the messages in it. Requires authentication.
### `POST /messages/send`
Takes a JSON body with a `to`, `name`, and `text` field. Sends a message to the inbox with the given `to` username. Requires authentication.
### `GET /messages`
Get all messages in your inbox. Requires authentication.
### `GET /help`
Returns basic information about the API.