Skip to content

cristovaoolegario/aluraflix-api

Repository files navigation

Aluraflix API

GitHub Workflow Status Codecov Go Report Card

GitHub tag (latest SemVer) GitHub release (latest SemVer)

Badge AluraFlix reduzido - Sharer

About the project

This is a challenge from Alura Backend Challenges.

This application was developed with:

  • Golang
  • Mongodb
  • Docker-Compose

This project image is being published to this Docker hub repository.

Pre-requisites

You need to have Go, Docker and NPM (for integration tests on command line) installed on your machine.

make pre-requisites

Running tests

To run unit tests you can use:

make test

To run integration tests you can use:

make integration-test

To run all the tests (unit and integration test) in this repo you can use:

make all-tests

Run instructions

Locally

To run it locally, you will need to set up a .env file like below:

  • PORT=
    ENV=
    AUD=
    ISS=
    APP_DB_USERNAME=
    APP_DB_PASSWORD=
    APP_DB_HOST=
    APP_DB_NAME=
  • Then run go run ./cmd/aluraflix-api/main.go

Docker container

docker-compose up -d

Import Postman Collection (API's)

Download Postman -> Import -> Import from link

Paste the link to : Aluraflix.postman_collection.json

Includes the following:

  • Auth
    • Credentials
    • Testing all endpoints with invalid token
  • Categories
    • Create Category
    • Get Categories with filters
    • Get Category By Id
    • Update Category
    • Delete Category
  • Videos
    • Create Video
    • Get Videos with filters
    • Get Video By Id
    • Update Video
    • Delete Video

License

MIT