Repository containing RiceHub's API source code.
Written in Go using Gin web framework.
You can find the API usage documentation and list of all endpoints on our Postman.
To build this API you need to have some programming and API development knowledge. I tried my best keeping it as beginner-friendly as possible.
If you have hard time building the API, you're welcome to ask for help on our Discord server (link below).
- Working Postgres server (latest version ideally),
- Working Redis server,
- Installed Go language
The building steps below assume you are on a Unix-like system with all basic development tools installed.
- Clone the repository:
git clone https://github.com/ricehub-io/api.git
cd api- Generate keys for asymmetric token verification/signing using provided script
./keys/generate.sh- Create config file by copying
config.toml.exampletoconfig.toml
cp config.toml.example config.toml-
Edit the
config.tomlusing your favorite text editor -
Import database schema from
schema.sqlfile. I recommend doing that using your favorite database explorer (I personally use DataGrip). -
Run the API in development mode
go run src/main.goIf everything was done correctly, you should be able to access the API at http://127.0.0.1:3000.
To build the API for production, go to the root of the repository, and run:
go build -o build/api ./srcThe executable can be found in build/ directory.
If you're interested in contributing to the project, please first read CODE_OF_CONDUCT.md. Then check out CONTRIBUTING.md file which contains all the important information on how to contribute.
If your question is still unanswered, feel free to open an issue or ask on Discord server (link provided below).
If you need to contact us, you can do so either by sending us an email to contact@ricehub.io or via Discord server: https://discord.gg/z7Zu8MeTdG
You can find the previous version of README for this project in README.old. It's more complex but gives you the general idea of how the API works under the hood.