Example application using Ent. Library is easy to use and really powerful (especially FK
and M2M
relations) with code generation.
Clone the repo.
$ git clone https://github.com/sinisaos/chi-ent.git
$ cd chi-ent
$ cp .env.example .env && rm .env.example # WARNING: change the DSN to your credentials and database name
$ make server
To generate changes in the Ent schema.
$ make generate
To run tests.
$ make tests
After application is running you can visit localhost:8000/swagger/
and use interactive Swagger documentation which was generated using Entoas, with minor modifications to use authorization.
This application uses the Chi router, but since all database interaction is in the service layer, you can use any other router or framework for web part.