Skip to content

ricehub-io/api

RiceHub API

Repository containing RiceHub's API source code.

Written in Go using Gin web framework.

Usage documentation

You can find the API usage documentation and list of all endpoints on our Postman.

Building

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).

Requirements

Steps

The building steps below assume you are on a Unix-like system with all basic development tools installed.

  1. Clone the repository:
git clone https://github.com/ricehub-io/api.git
cd api
  1. Generate keys for asymmetric token verification/signing using provided script
./keys/generate.sh
  1. Create config file by copying config.toml.example to config.toml
cp config.toml.example config.toml
  1. Edit the config.toml using your favorite text editor

  2. Import database schema from schema.sql file. I recommend doing that using your favorite database explorer (I personally use DataGrip).

  3. Run the API in development mode

go run src/main.go

If 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 ./src

The executable can be found in build/ directory.

Contributing

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).

Contact

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.

About

API for RiceHub website - where you can share your Linux rices

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Contributors

Languages