To run the appication you need running docker with docker compose
You also need to have local image of file-storage build and stored. The tag for image should be maxit/file-storage. Refer to documentation on how to do it.
docker compose up --build -dAtlas is used for database migrations. You can find migration files in migrations folder.
To generate new migration file you can use the following command:
atlas migrate diff --env gormTo apply migrations to database you can use:
atlas migrate apply --env gorm --url <database_url>If you set DUMP=true in the .env file, and start application using provided dev docker compose the app will start with some values present in database. For now this includes:
- Admin user. Email=
admin@admin.comPassword=adminadmin - Teacher user. Email=
teacher@teacher.comPassword=teacherteacher - Student user. Email=
student@student.comPassword=studentstudent
In order to generate swagger documentation you need to have installed swag tool. You can install it using:
go install github.com/swaggo/swag/cmd/swag@latestNext you can generate swagger documentation using:
make docsYou can access it at /api/v1/docs when the application is running.
In order to generate mocks for services and repositories, you need to have the mockgen tool installed. You can install it using:
go install go.uber.org/mock/mockgen@latest
make mocksYou can check automaticaly generated swagger documentation here. Documentation is generated from code comments, so please excuse if there are mistakes.