<commit_before># Diskette

MongoDB + REST API + Authentication + Authorization + Mail Notifications

## Status

Under heavy development.

## Roadmap

- 0.1.0
    - REST API
        - Get documents
        ```bash
        # get all documents from collection
        http localhost:5025/<mongodb_collection>
        # get the documents that match a query
        http localhost:5025/<mongodb_collection>?q='<mongodb_query>'
        ```
        - [x] `GET    /collection?st={sessionToken}&q={query}`
        - [x] `POST   /collection?st={sessionToken}           BODY={document}`
        - [x] `PUT    /collection?st={sessionToken}&q={query} BODY={updateDocument}`
        - [x] `DELETE /collection?st={sessionToken}&q={query}`

- 0.2.0
    - Authentication API
        - Unauthenticated User:
            - [x] Signup
            ```
            http POST localhost:5025/user/signup \
                name="<NAME>" email=<EMAIL> password=<PASSWORD> language=en
            ```
            - [ ] `ConfirmSignup(confirmationToken string) error`
            - [ ] `ResendConfirmationMail(email, lang string) (confirmationToken string, err error)`
            - [ ] `Signin(email, password string) (sessionToken string, err error)`
            - [ ] `ForgotPasword(email, lang string) (resetToken string, err error)`
            - [ ] `ResetPassword(resetToken, newPassword string) error`
        - Authenticated User:
            - [ ] `Signout(sessionToken) error`
            - [ ] `SignoutAllSessions(sessionToken) error`
            - [ ] `ChangePassword(sessionToken, oldPassword, newPassword string) error`
            - [ ] `ChangeEmail(sessionToken, password, newEmail string) error`
        - Admin User:
            - [ ] `GetUsers() ([]User, error)`
            - [ ] `CreateUser(email, password, lang string) error`
            - [ ] `ChangeUserPassword(userId, newPassword string) error`
            - [ ] `ChangeUserEmail(userId, newEmail string) error`
            - [ ] `RemoveUsers(userIds ...string) error`
            - [ ] `SignoutAllSessions(userIds ...string) error`
            - [ ] `SuspendUsers(userIds ...string) error`
            - [ ] `UnsuspendUsers(userIds ...string) error`<commit_msg>updated the readme<commit_after># Diskette

MongoDB + REST API + Authentication + Authorization + Mail Notifications

## Status

Under heavy development.

## Roadmap

- 0.1.0
    - REST API
        - [x] Get documents
        ```bash
        # get all documents from collection
        http localhost:5025/<mongodb_collection>
        # example:
        http localhost:5025/user
        # get the documents that match a query
        http localhost:5025/<mongodb_collection>?q='<mongodb_json_query>'
        # examples:
        http localhost:5025/user?q='{"name":"<NAME>"}'
        http localhost:5025/user?q='{"name":{"$ne":"<NAME>"}}'
        ```

        - [x] Create a new document
        ```bash
        http POST localhost:5025/<mongodb_collection> <mongodb_document>
        # example:
        http POST localhost:5025/user name="<NAME>" email=<EMAIL>
        ```

        - [x] Update one or more documents
        ```bash
        # update the documents that match a query
        http PUT localhost:5025/<mongodb_collection>?q='<mongodb_json_query>' <mongodb_update>
        # example:
        http PUT localhost:5025/user?q='{"name":"<NAME>"}' \$set:='{"email":"<EMAIL>"}'
        ```

        - [x] Delete documents
        ```bash
        # delete the documents that match a query
        http DELETE localhost:5025/<mongodb_collection>?q='<mongodb_json_query>'
        # example
        http DELETE localhost:5025/user?q='{"name":"<NAME>"}'
        ```

- 0.2.0
    - Authentication API
        - Unauthenticated User:
            - [x] Signup
            ```
            http POST localhost:5025/user/signup \
                name="<NAME>" email=<EMAIL> password=<PASSWORD> language=en
            ```
            - [ ] `ConfirmSignup(confirmationToken string) error`
            - [ ] `ResendConfirmationMail(email, lang string) (confirmationToken string, err error)`
            - [ ] `Signin(email, password string) (sessionToken string, err error)`
            - [ ] `ForgotPasword(email, lang string) (resetToken string, err error)`
            - [ ] `ResetPassword(resetToken, newPassword string) error`
        - Authenticated User:
            - [ ] `Signout(sessionToken) error`
            - [ ] `SignoutAllSessions(sessionToken) error`
            - [ ] `ChangePassword(sessionToken, oldPassword, newPassword string) error`
            - [ ] `ChangeEmail(sessionToken, password, newEmail string) error`
        - Admin User:
            - [ ] `GetUsers() ([]User, error)`
            - [ ] `CreateUser(email, password, lang string) error`
            - [ ] `ChangeUserPassword(userId, newPassword string) error`
            - [ ] `ChangeUserEmail(userId, newEmail string) error`
            - [ ] `RemoveUsers(userIds ...string) error`
            - [ ] `SignoutAllSessions(userIds ...string) error`
            - [ ] `SuspendUsers(userIds ...string) error`
            - [ ] `UnsuspendUsers(userIds ...string) error`
{'fraction_non_alphanumeric': 0.13246702870442204, 'fraction_numerical': 0.013964313421256789, 'mean_word_length': 2.2556818181818183, 'pattern_counts': {'":': 6, '<': 29, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7598721', 'n_tokens_mistral': 1547, 'n_tokens_neox': 1477, 'n_words': 329}