Example authentication API using Python + Starlette + Sqlalchemy.
Build the project:
make build
Run the app:
make run
Get a shell:
make shell
Application is available at http://localhost:8000
Request:
GET /health
Response: 200 OK
OK
Request:
POST /account
Request body:
{
"email": "[email protected]",
"password": "goldenretriever123"
}
Response: 201 CREATED
No content
POST /login
Request body:
{
"email": "[email protected]",
"password": "goldenretriever123"
}
Response: 201 CREATED
{
"session": "8b10a24e5cf54908acb5bfd288b56b0d",
"expires_at": "2023-08-05T00:40:12.848103+00:00"
}
- Poetry - Python dependency management
- Starlette - Fast async Python web framework
- Sqlalchemy - Python database ORM
- OWASP Password Guidelines - Best practices for secure password storage