https://github.com/wzslr321/glossary
Personal Glossary to keep track of new words in a simplest possible way!
https://github.com/wzslr321/glossary
cli docker go golang redis
Last synced: 5 days ago
JSON representation
Personal Glossary to keep track of new words in a simplest possible way!
- Host: GitHub
- URL: https://github.com/wzslr321/glossary
- Owner: wzslr321
- Created: 2021-08-06T18:44:30.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2021-08-22T13:46:54.000Z (about 4 years ago)
- Last Synced: 2025-02-16T06:53:36.790Z (8 months ago)
- Topics: cli, docker, go, golang, redis
- Language: Go
- Homepage:
- Size: 48.9 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Personal CLI Glossary
#
I encounter new English words every single day, I decided to put bigger pressure
on learning them. With Glossary you can add a new English word and its
definition to the database, simply typing `aw my_word` in the terminal.#
---
Found it useful? Want more updates?
Show your support by giving a :star:---
How does it work?
Repository contains already built, executable file - `glossary`.
It is the most convenient to create a new alias in your shell config file, e.g. `.zshrc`,
`.bashrc`, `.bash_profile`.
I added it to my .zshrc config with the following line: `alias aw="./development/words/glossary"`
Depending on where did you clone this repository on your local machine, path my differ - change it as needed.Now I can add new word ( hello in this case) to the `new_words.txt` file, simply typing `aw hello`
It runs without a docker container, so it is not stored in the database yet, and definition isn't assigned.I can also run docker containers with the following command: `docker compose up`
^ It requires docker and docker compose configured.Now with docker containers running, I can send a POST request to `localhost:8080/fetch`.
It takes all words from new_words.txt and puts them into words.txt file.
It also scraps the web (https://www.dictionary.com) and saves its definition in the key-value database
Of course, it also validates if words are being repeated and don't save them if so.Send a GET request to `localhost:8080/` to see definition of particular words.
Send a POST request to `localhost:8080/` to add a word and its definition to database. (Only with docker running)Plans
Someday I wish to nicely display all the words on a website, currently I am not willing to
code front-end though. Actual functionality is enough for my current needs.If someone is willing to code front-end, I can work on this project a little bit more
and create much better API.Of course, words.txt are going to steady be updated with new words.
If you want to add your own words, feel free to do it in new_words.txt file and create a PR.---
I am aware that code in this project is awful. I didn't want to spend too much time on
building it. I just wanted to create a simple program to save a new words that I encounter
while reading English books. It took me just few hours to create, without caring about
architecture and clean code.