{"id":20767680,"url":"https://github.com/kingwingfly/concreter","last_synced_at":"2025-09-28T00:32:12.016Z","repository":{"id":206743832,"uuid":"717599051","full_name":"kingwingfly/Concreter","owner":"kingwingfly","description":"A web app to enhance document with chatGPT and sympy. ","archived":false,"fork":false,"pushed_at":"2024-12-08T00:03:58.000Z","size":660,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"dev","last_synced_at":"2024-12-08T01:17:03.659Z","etag":null,"topics":["axum","docker","grpc","kubernetes","nextjs","reveal-js","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kingwingfly.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-11-12T00:34:14.000Z","updated_at":"2024-12-08T00:04:02.000Z","dependencies_parsed_at":"2023-12-02T06:26:17.375Z","dependency_job_id":"bcee9481-8584-4b7c-9f23-b5d8d7f6060f","html_url":"https://github.com/kingwingfly/Concreter","commit_stats":null,"previous_names":["kingwingfly/concreter"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kingwingfly%2FConcreter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kingwingfly%2FConcreter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kingwingfly%2FConcreter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kingwingfly%2FConcreter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kingwingfly","download_url":"https://codeload.github.com/kingwingfly/Concreter/tar.gz/refs/heads/dev","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234475314,"owners_count":18839358,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["axum","docker","grpc","kubernetes","nextjs","reveal-js","rust"],"created_at":"2024-11-17T11:33:00.749Z","updated_at":"2025-09-28T00:32:11.592Z","avatar_url":"https://github.com/kingwingfly.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ca name=\"readme-top\"\u003e\u003c/a\u003e\n\n\u003c!-- PROJECT SHIELDS --\u003e\n[![Contributors][contributors-shield]][contributors-url]\n[![Forks][forks-shield]][forks-url]\n[![Stargazers][stars-shield]][stars-url]\n[![Issues][issues-shield]][issues-url]\n[![MIT License][license-shield]][license-url]\n[![LinkedIn][linkedin-shield]][linkedin-url]\n\n\n\n\u003c!-- PROJECT LOGO --\u003e\n\u003cbr /\u003e\n\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://github.com/kingwingfly/Concreter\"\u003e\n    \u003cimg src=\"images/screenshot.png\" alt=\"Logo\" width=\"80\" height=\"80\"\u003e\n  \u003c/a\u003e\n\n\u003ch3 align=\"center\"\u003eConcreter\u003c/h3\u003e\n\n  \u003cp align=\"center\"\u003e\n    A web app to enhance document with chatGPT and sympy.\n    \u003cbr /\u003e\n    \u003ca href=\"https://github.com/kingwingfly/Concreter\"\u003e\u003cstrong\u003eExplore the docs »\u003c/strong\u003e\u003c/a\u003e\n    \u003cbr /\u003e\n    \u003cbr /\u003e\n    \u003ca href=\"https://github.com/kingwingfly/Concreter\"\u003eView Demo\u003c/a\u003e\n    ·\n    \u003ca href=\"https://github.com/kingwingfly/Concreter/issues\"\u003eReport Bug\u003c/a\u003e\n    ·\n    \u003ca href=\"https://github.com/kingwingfly/Concreter/issues\"\u003eRequest Feature\u003c/a\u003e\n  \u003c/p\u003e\n\u003c/div\u003e\n\n\n\n\u003c!-- TABLE OF CONTENTS --\u003e\n\u003cdetails\u003e\n  \u003csummary\u003eTable of Contents\u003c/summary\u003e\n  \u003col\u003e\n    \u003cli\u003e\n      \u003ca href=\"#about-the-project\"\u003eAbout The Project\u003c/a\u003e\n      \u003cul\u003e\n        \u003cli\u003e\u003ca href=\"#built-with\"\u003eBuilt With\u003c/a\u003e\u003c/li\u003e\n      \u003c/ul\u003e\n    \u003c/li\u003e\n    \u003cli\u003e\n      \u003ca href=\"#getting-started\"\u003eGetting Started\u003c/a\u003e\n      \u003cul\u003e\n        \u003cli\u003e\u003ca href=\"#prerequisites\"\u003ePrerequisites\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"#installation\"\u003eInstallation\u003c/a\u003e\u003c/li\u003e\n      \u003c/ul\u003e\n    \u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#usage\"\u003eUsage\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#roadmap\"\u003eRoadmap\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#contributing\"\u003eContributing\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#license\"\u003eLicense\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#contact\"\u003eContact\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#acknowledgments\"\u003eAcknowledgments\u003c/a\u003e\u003c/li\u003e\n  \u003c/ol\u003e\n\u003c/details\u003e\n\n\n\n\u003c!-- ABOUT THE PROJECT --\u003e\n## About The Project\n\n[![Product Name Screen Shot][product-screenshot]](https://github.com/kingwingfly/Concreter)\n\n### The Graph Database\n![graph aliases](images/graph_aliases.png)\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\n\n### Built With\n\n* [![Rust][Rust]][Rust-url]\n* [![Python][Python]][Python-url]\n* [![typescript][typescript]][typescript-url]\n* [![gRPC][gRPC]][gRPC-url]\n* [![docker][docker]][docker-url]\n* [![kubernetes][kubernetes]][kubernetes-url]\n* [![postgresql][postgresql]][postgresql-url]\n* [![agdb][agdb]][agdb-url]\n* [![openai][openai]][openai-url]\n* [![Next][Next.js]][Next-url]\n* [![React][React.js]][React-url]\n* [![reveal][reveal]][reveal-url]\n* [![three][three]][three-url]\n\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\n\n\u003c!-- GETTING STARTED --\u003e\n## Getting Started\nHere's how you can init and start the project.\n\nThree ways: local docker k8s\n\n\n### Local\n- Postgres database\n- AgDb database\n- Python gRPC server\n- Axum server\n\n#### Postgres\n```sh\n# Init a Postgres database with the following settings:\ninitdb -D /path/to/pgdata --locale=en_US.UTF-8 -U $USER -W\n\n# Start the database:\npg_ctl -D /path/to/pgdata -l /path/to/log.log start\n\n# Create database:\ncreatedb app_db -O $USER\n\n# Set the PgUrl environment variable:\nexport PG_URL=\"postgres://$USER:password@localhost/app_db\"\n\n# Follows is the commands to end and clean the service:\npg_ctl -D /path/to/pgdata stop\nrm -rf /path/to/pgdata\n```\n\n#### AgDb\n[`AgDb`](https://github.com/agnesoft/agdb) is a graph database.\n\nYou need give it a `.agdb` suffix file to init the database. For example:\n\n```sh\nmkdir -p ag_db \u0026\u0026 touch ag_db/ag.agdb\nexport AG_FILE=\"path/to/ag.agdb\"\n```\n\n#### python gRPC\nTo enable symbolic computation, I use python's [`sympy`](https://docs.sympy.org/latest/index.html). For time limitation, I don't have enough time to explore `pyO3`, so I just use `gRPC` to interact with python in Rust. Sympy only support python \u003c= 3.10\n\n```sh\n# create a virtual environment\nconda create -n py310 python=3.10\n\n# activate the virtual environment\nconda activate py310\n\n# install the dependencies\npip install -r requirements.txt\n# For ARM Mac, use\npip install socksio\nconda install --file requirements.txt\npip install --upgrade openai\n\n# generate the gRPC python code\nexport PB=\"./src_py\" \u0026\u0026 python -m grpc_tools.protoc -I./proto --python_out=$PB --pyi_out=$PB --grpc_python_out=$PB proto/sym.proto\n\n# set env varibles\nexport OPENAI_API_KEY=sk-123456\n\n# Run gRPC service\npython ./src_py/main.py\n\n# Ctrl + C to end the service, and deactivate the virtual environment\nconda deactivate\n```\nFor both methods, you may need proxy configured. For docker, the host network should set proxy. For local machine, set the proxy in `src_py/openai_utils.py`:\n```python\nclient = OpenAI(\n    # In docker, do not need to set proxy, for it uses host network which does.\n    http_client=Client(proxies=\"http://127.0.0.1:7890\"), timeout=30, max_retries=0\n)\n```\n#### fronted\n```sh\ncd frontend \u0026\u0026 npm i \u0026\u0026 cd ..\nexport WEB_FOLDER=path/to/fronted/out\nexport FRONTEND_FOLDER=path/to/frontend\n```\n\n#### start axum server\n```sh\nexport RPC_ADDR=http://localhost:50051\nexport SERVICE_PWD_KEY=   # you can gernerate using\nexport SERVICE_TOKEN_KEY= # `cargo run --examples gen_key`\nexport SERVICE_TOKEN_DURATION_SEC=1800  # in seconds\ncargo run\n```\n\n### Docker\n#### postgres\n```sh\ndocker pull postgres\ndocker run --name postgres -e POSTGRES_PASSWORD=postgres -p 5432:5432 -d postgres\nexport PG_URL=postgres://postgres:postgres@localhost:5432/postgres\n```\n#### Agdb\n```sh\nmkdir -p ag_db \u0026\u0026 touch ag_db/ag.agdb\nexport AG_FILE=\"path/to/ag.agdb\"\n```\n\n#### gRPC\n```sh\n# At the root of the project, run:\ndocker build -t rpc-py --target=rpc-py .\ndocker run -it -p 50051:50051 -e OPENAI_API_KEY=sk-123456 --rm --name rpc-py rpc-py\n```\n\n#### Frontend\n```sh\ncd frontend \u0026\u0026 npm i \u0026\u0026 cd ..\nexport WEB_FOLDER=path/to/fronted/out\nexport FRONTEND_FOLDER=path/to/frontend\n```\n\n#### start axum server\n```sh\nexport RPC_ADDR=http://localhost:50051\nexport SERVICE_PWD_KEY=   # you can gernerate using\nexport SERVICE_TOKEN_KEY= # `cargo run --examples gen_key`\nexport SERVICE_TOKEN_DURATION_SEC=1800  # in seconds\ncargo run\n```\n\n### Kubernetes\n#### build images\n```sh\ndocker build -t rpc-py --target rpc-py .\ndocker build -t axum --target axum .\ndocker pull postgres\n```\nSet the env variables in deploy/k8s:\n- secrets in kustomization.yaml\n- persist voloum in postgres-deployment.yaml and axum-deployment.yaml\n\nAnd load the images rpc-py, axum, postgres to your cluster\n```sh\ncd deploy/k8s \u0026\u0026 kubectl apply -k ./\n# init the postgres, see blow\n# port-forward\nkubectl port-forward svc/axum-xxxx-xxx 8080:8080\n```\n\n### Initialize the postgres table\nConnect to db\n```sh\npsql postgres://postgres:postgres@localhost:5432/postgres\n# For those using k8s\nkubectl port-forward svc/postgres 5432:5432\n```\nRun sql in\n[init sql](sql/dev_init/01-schema.sql)\n\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\u003c!-- USAGE EXAMPLES --\u003e\n## Usage\nRegister and login in.\n\nUpload a markdown and enter the field the markdown about, you can see examples at examples folder.\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\n\u003c!-- ROADMAP --\u003e\n## Roadmap\n\n- [ ] Use [SeaORM](https://github.com/SeaQL/sea-orm) and openDAL\n- [ ] Fix: service dropped in minikube but works properly on docker kube\n- [ ] Use vector storage\n- [ ] Train transformer latex-sympy translator\n- [ ] Formular sub\n- [ ] 3D model support\n\nSee the [open issues](https://github.com/kingwingfly/Concreter/issues) for a full list of proposed features (and known issues).\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\n\u003c!-- CONTRIBUTING --\u003e\n## Contributing\n\nContributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**.\n\nIf you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag \"enhancement\".\nDon't forget to give the project a star! Thanks again!\n\n1. Fork the Project\n2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)\n3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)\n4. Push to the Branch (`git push origin feature/AmazingFeature`)\n5. Open a Pull Request\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\n\n\u003c!-- LICENSE --\u003e\n## License\n\nDistributed under the Apache 2.0 License. See `LICENSE.txt` for more information.\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\n\n\u003c!-- CONTACT --\u003e\n## Contact\n\nLouis - 20200581@cqu.edu.cn\n\nProject Link: [https://github.com/kingwingfly/Concreter](https://github.com/kingwingfly/Concreter)\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\n\n\u003c!-- MARKDOWN LINKS \u0026 IMAGES --\u003e\n\u003c!-- https://www.markdownguide.org/basic-syntax/#reference-style-links --\u003e\n[contributors-shield]: https://img.shields.io/github/contributors/kingwingfly/Concreter.svg?style=for-the-badge\n[contributors-url]: https://github.com/kingwingfly/Concreter/graphs/contributors\n[forks-shield]: https://img.shields.io/github/forks/kingwingfly/Concreter.svg?style=for-the-badge\n[forks-url]: https://github.com/kingwingfly/Concreter/network/members\n[stars-shield]: https://img.shields.io/github/stars/kingwingfly/Concreter.svg?style=for-the-badge\n[stars-url]: https://github.com/kingwingfly/Concreter/stargazers\n[issues-shield]: https://img.shields.io/github/issues/kingwingfly/Concreter.svg?style=for-the-badge\n[issues-url]: https://github.com/kingwingfly/Concreter/issues\n[license-shield]: https://img.shields.io/github/license/kingwingfly/Concreter.svg?style=for-the-badge\n[license-url]: https://github.com/kingwingfly/Concreter/blob/master/LICENSE.txt\n[linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg?style=for-the-badge\u0026logo=linkedin\u0026colorB=555\n[linkedin-url]: https://linkedin.com/in/linkedin_username\n[product-screenshot]: images/screenshot.png\n\n[Rust]: https://img.shields.io/badge/Rust-000000?style=for-the-badge\u0026logo=Rust\u0026logoColor=orange\n[Rust-url]: https://www.rust-lang.org\n[Python]: https://img.shields.io/badge/Python-000000?style=for-the-badge\u0026logo=Python\u0026logoColor=blue\n[Python-url]: https://www.python.org\n[axum]: https://img.shields.io/badge/axum-000000?style=for-the-badge\u0026logo=axum\u0026logoColor=white\n[axum-url]: https://github.com/tokio-rs/axum\n[typescript]: https://img.shields.io/badge/typescript-000000?style=for-the-badge\u0026logo=typescript\u0026logoColor=blue\n[typescript-url]: https://www.typescriptlang.org\n[gRPC]: https://img.shields.io/badge/gRPC-000000?style=for-the-badge\u0026logo=gRPC\u0026logoColor=yello\n[gRPC-url]: https://grpc.io\n[docker]: https://img.shields.io/badge/docker-000000?style=for-the-badge\u0026logo=docker\u0026logoColor=blue\n[docker-url]: https://www.docker.com\n[kubernetes]: https://img.shields.io/badge/kubernetes-000000?style=for-the-badge\u0026logo=kubernetes\u0026logoColor=blue\n[kubernetes-url]: https://kubernetes.io\n[postgresql]: https://img.shields.io/badge/postgresql-000000?style=for-the-badge\u0026logo=postgresql\u0026logoColor=blue\n[postgresql-url]: https://www.postgresql.org\n[agdb]: https://img.shields.io/badge/agdb-000000?style=for-the-badge\u0026logo=agdb\u0026logoColor=brown\n[agdb-url]: https://github.com/agnesoft/agdb\n[openai]: https://img.shields.io/badge/openai-000000?style=for-the-badge\u0026logo=openai\u0026logoColor=pink\n[openai-url]: https://openai.com\n[Next.js]: https://img.shields.io/badge/next.js-000000?style=for-the-badge\u0026logo=nextdotjs\u0026logoColor=white\n[Next-url]: https://nextjs.org/\n[React.js]: https://img.shields.io/badge/React-20232A?style=for-the-badge\u0026logo=react\u0026logoColor=white\n[React-url]: https://reactjs.org/\n[reveal]: https://img.shields.io/badge/reveal-000000?style=for-the-badge\u0026logo=revealdotjs\u0026logoColor=yellow\n[reveal-url]: https://revealjs.com\n[three]: https://img.shields.io/badge/three-000000?style=for-the-badge\u0026logo=threedotjs\u0026logoColor=yellow\n[three-url]: https://threejs.org/docs/#manual/en/introduction/Installation\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkingwingfly%2Fconcreter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkingwingfly%2Fconcreter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkingwingfly%2Fconcreter/lists"}