Ridiculous name for a chat application, I know.
_______________ |*\_/*|________
| ___________ | .-. .-. ||_/-\_|______ |
| | | | .****. .****. | | | |
| | 0 0 | | .*****.*****. | | 0 0 | |
| | - | | .**chuku**. | | - | |
| | \___/ | | .*chuku*. | | \___/ | |
| |___ ___| | .*****. | |___________| |
|_____|\_/|_____| .***. |_______________|
_|__|/ \|_|_.............*.............._|________|_
/ ********** \ / ********** \
/ ****chu***** \ / *****ku***** \
-------------------- --------------------
Currently there are two modes.
- The "dummy" mode, which keeps everything in-memory. In this mode, no persistence will take place. After closing the application everything will vanish.
- The "db" mode, which keeps everything inside a PostgreSQL database.
To choose between modes, edit the file config/config.yml
. The mode
field can be either "dummy"
or "db"
.
Both modes need a Redis database. To start a Redis instance on your machine, type:
make redis-start
To start a PostgreSQL instance on your machine, and run all the migrations available, type:
make db-start
make migrate
You can login in the database anytime you want, by typing:
make db-login
Finally. You can run the application by typing:
make run
Et voila!
Then check if everything is running successfully with:
curl -XGET "http://localhost:8000/health"
if response is 200, you're good to go.
GET /health
GET /info
Example response of the info
endpoint:
{
"listen_url": "http://test.com/radio.mp3",
"is_live": true,
"streamer_name": "The Streamer",
"song_artist": "Rage Against The Machine",
"song_title": "Take the power back",
"song_history": [
{
"song_artist": "The Roots",
"song_title": "What they do"
},
{
"song_artist": "Talib Kweli and Hi-Tek",
"song_title": "Just begun feat. Jay Electronica"
},
{
"song_artist": "Large Professor",
"song_title": "Ijuswannachill"
},
{
"song_artist": "Mos Def",
"song_title": "Sunshine"
},
{
"song_artist": Grand Puba",
"song_title": "I like it"
}
]
}
GET /channels
POST /channels
with body:
{
"name": "test channel",
"description": "test discussion"
"creator": "user1"
}
POST /channels/subscription
with body:
{
"channel": "channel name"
"user": "testuser"
}
DELETE /channels/{channelName}
GET /channels/{string}/lastMessages?amount={int}
GET /chat?username={string}
for creating a user && a websocket connection
GET /users
GET /users/{username}
DELETE /users/{username}
GET /users/{username}/channels