summaryrefslogtreecommitdiff
path: root/README.md
blob: 4edf304f31ccd10947dd8ef26977dbf0a0f1b470 (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
# Balalaika
Lyrics api written in rust (school project).

## 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).

## TODO
[X] - User / Password system, use user id to generate tokens
[ ] - Add documentation (Utoipa)