<commit_before># Relieve endpoint

## Development

1. setup postgres database with the following [schema][schema]

2. export port and datatabase environment variable
    
    ```
    export PORT=8080
    export DATABASE_URL=postgres://user:password@[host]:[port]/[dbname]
    ```

3. Build & run it
    
    ```
    go install
    relieve
    ``` 

4. start testing endpoint

## Testing endpoint

1. users endpoint
    
    ```
    curl -i -H "Accept: application/json" -X POST -d '{"user_email":"test", "user_gender":"male", "user_age":17, "user_profession":"student"}' http://localhost:8080/v0/users
    ```

2. psikolog endpoint
    <commit_msg>add more explanation on database setup<commit_after># Relieve endpoint

## Development

1. setup postgres database with the following [schema][schema]
    
    sudo su - postgres
    createuser -P relieve
    createdb -O relieve relieve

    note:
    update pg_hba.conf from
    local  all      all          peer
    to
    local  all      all          md5


2. export port and datatabase environment variable
    
    ```
    export PORT=8080
    export DATABASE_URL=postgres://user:password@[host]:[port]/[dbname]
    ```

3. Build & run it
    
    ```
    go install
    relieve
    ``` 

4. start testing endpoint

## Testing endpoint

1. users endpoint
    
    ```
    curl -i -H "Accept: application/json" -X POST -d '{"user_email":"test", "user_gender":"male", "user_age":17, "user_profession":"student"}' http://localhost:8080/v0/users
    ```

2. psikolog endpoint
    
{'fraction_non_alphanumeric': 0.1223021582733813, 'fraction_numerical': 0.02289077828646174, 'mean_word_length': 2.7226277372262775, 'pattern_counts': {'":': 8, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4272593', 'n_tokens_mistral': 503, 'n_tokens_neox': 473, 'n_words': 138}