Skip to content

Backend do AluraFlix feito com elixir, phoenix e fé. #alurachallengeback

Notifications You must be signed in to change notification settings

jpbrab0/aluraflix-backend

Repository files navigation

AluraflixBackend

Elixir CI

About the project 📜

This is a challenge from Alura Backend Challenges where all the participants builed the backend of AluraFlix.

And is builded with:

  • Elixir
  • Phoenix
  • Ecto
  • Docker-Compose

Installing the project 📦

Requirements:

Clone the github repo to your local machine

With HTTPS:

https://github.com/jpbrab0/aluraflix-backend.git

With SSH:

git clone [email protected]:jpbrab0/aluraflix-backend.git

With Github CLI:

gh repo clone jpbrab0/aluraflix-backend

Running the project 🏃

To start your Phoenix server:

  • Install dependencies with mix deps.get
  • Initialize the postgres with docker-compose -f docker-compose.database.yml up -d
  • Create and migrate your database with mix ecto.setup
  • Start Phoenix endpoint with HOSTNAME=localhost mix phx.server

Now you can visit localhost:4000 from your browser.

Running the project with Docker! 🐳

Build image

docker-compose build

Create and migrate database

docker-compose run app mix ecto.setup

Run project(if you dont want do see logs add -d)

docker-compose up

Now you can acess the project in localhost:8000 :)

Testing 🧪

To run all the test, execute in terminal:

the tests are under construction

mix test

Endpoints

Base Url: https://localhost:4000/api

View all registered videos

GET /videos

Search videos

GET /videos?search=

View a video by id

GET /videos/:id
Parameter Type
id integer

Create a video

POST /videos
Parameter Type
title string
category_id integer
description string
url string

Update a video

PUT /videos/:id
Parameter Type
id integer
title string
category_id integer
description string
url string

Delete a video

DELETE /videos/:id
Parameter Type
id integer

View all the videos of a specific category

GET /categories/:id/videos
Parameter Type
id integer

View all registered categories

GET /categories

View a category by id

GET /categories/:id
Parameter Type
id integer

Create a category

POST /categories
Parameter Type
title string
color string

Edit a category

PUT /categories/:id
Parameter Type
id integer
title string
color string

Delete a category

DELETE /categories/:id
Parameter Type
id integer

Learn more about Phoenix!

The project has made by João Pedro Resende

About

Backend do AluraFlix feito com elixir, phoenix e fé. #alurachallengeback

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published