blob: 30344deb43772293e482a188f4f389b696ff2825 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
# Balalaika
Lyrics api written in rust (school project).
## Deployment notes
Deployment hasn't gone all that well and has needed
a few changes to work correctly.
These changes are not in the master branch.
In order to access the documentation, go to niliara.net/balalaika/doc.
From there you can also execute commands to the api.
The main routes can still be accessed from niliara.net/balalaika.
## Setup
### Dependencies
This project requires mariadb and cargo.
### Set up env
Create a .env file and fill it using the env_example as a guide.
### Set up database
To manage the database through the program's scripts use
`cargo run-script`
(installable through cargo with `cargo install cargo-run-script`).
Available scripts:
```
db_create
db_fast_populate
db_start
db_stop
```
The start/stop scripts assume that you're using systemd.
If not, just start/stop the mariadb service manually.
db_fast_populate is an alternative to populate the database
without having to interact with Genius' api.
You can still use the original method by executing
./scripts/populate.main.py with a python interpreter.
## Changes
### Single parameters only
You can only search a parameter at a time.
This is because Rust needs to process the sql queries ahead of time
in order to make them safe to injection attacks.
### No music genres
Skipped for the sake of simplicity
### Song titles renamed to "names"
For the sake of making it easier to understand.
### API requests moved into a new scope
To keep things organised,
the main API requests have been moved to the /api scope.
Routes such as /song are now /api/song.
### Authentication routes have been added
In order to create/remove users and retrieve the tokens,
a new scope has been created (/auth).
|