https://github.com/rbw/songmeta
Aioli HTTP/REST+RDBMS Example
https://github.com/rbw/songmeta
Last synced: 3 months ago
JSON representation
Aioli HTTP/REST+RDBMS Example
- Host: GitHub
- URL: https://github.com/rbw/songmeta
- Owner: rbw
- License: mit
- Created: 2022-01-06T21:53:42.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-01-07T22:57:35.000Z (over 4 years ago)
- Last Synced: 2025-10-29T00:39:01.627Z (8 months ago)
- Language: Python
- Homepage:
- Size: 122 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
SongMeta
## About
Fully functional example built on top of [aioli-flavors/rest-rdbms](https://github.com/aioli-flavors/rest-rdbms).
## Setting up
Requires Python 3.9+, Git, and Poetry.
### Building
```
$ git clone https://github.com/rbw/songmeta.git
$ cd songmeta
$ poetry update
```
## Starting Postgres
The application requires an SQLAlchemy-supported relational database. This example uses pg.ARRAY in AlbumModel, making it compatible with Postgres only.
A docker-compose file for running a Postgres server is available in the project root.
```
$ docker-compose up
```
## Starting SongMeta
```
$ poetry shell
$ python -m songmeta
```
## Usage
### Get all albums
```
$ curl http://localhost:5000/albums
```
### Create an album
```
$ curl -X POST --data '{"title": "test", "release_date": "2035-01-20", "stores": ["APPLE", "YOUTUBE"], "tracks": ["TEST000000001", "TEST000000002"], "upc": "00000000000005"}' http://localhost:5000/albums
```
### Show an album
```
$ curl http://localhost:5000/albums/00000000000005
```