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
Requirements:
- Elixir
- Erlang
- Docker
- Docker-compose
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
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.
docker-compose build
docker-compose run app mix ecto.setup
docker-compose up
Now you can acess the project in localhost:8000
:)
To run all the test, execute in terminal:
the tests are under construction
mix test
Base Url: https://localhost:4000/api
GET /videos
GET /videos?search=
GET /videos/:id
Parameter | Type |
---|---|
id |
integer |
POST /videos
Parameter | Type |
---|---|
title |
string |
category_id |
integer |
description |
string |
url |
string |
PUT /videos/:id
Parameter | Type |
---|---|
id |
integer |
title |
string |
category_id |
integer |
description |
string |
url |
string |
DELETE /videos/:id
Parameter | Type |
---|---|
id |
integer |
GET /categories/:id/videos
Parameter | Type |
---|---|
id |
integer |
GET /categories
GET /categories/:id
Parameter | Type |
---|---|
id |
integer |
POST /categories
Parameter | Type |
---|---|
title |
string |
color |
string |
PUT /categories/:id
Parameter | Type |
---|---|
id |
integer |
title |
string |
color |
string |
DELETE /categories/:id
Parameter | Type |
---|---|
id |
integer |
- Official website: https://www.phoenixframework.org/
- Guides: https://hexdocs.pm/phoenix/overview.html
- Docs: https://hexdocs.pm/phoenix
- Forum: https://elixirforum.com/c/phoenix-forum
- Source: https://github.com/phoenixframework/phoenix
The project has made by João Pedro Resende