https://github.com/raulpe7eira/nftex
ignite - module: nftex project from rocketseat by Rafael Camarda
https://github.com/raulpe7eira/nftex
absinthe course ecto elixir graphql ignite learn phoenix postgresql rocketseat
Last synced: about 1 month ago
JSON representation
ignite - module: nftex project from rocketseat by Rafael Camarda
- Host: GitHub
- URL: https://github.com/raulpe7eira/nftex
- Owner: raulpe7eira
- Created: 2022-05-15T02:40:59.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-02-18T23:48:57.000Z (about 1 year ago)
- Last Synced: 2025-02-12T07:23:57.951Z (3 months ago)
- Topics: absinthe, course, ecto, elixir, graphql, ignite, learn, phoenix, postgresql, rocketseat
- Language: Elixir
- Homepage:
- Size: 39.1 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Nftex API
This repository is the code corresponding to the [Rocketseat - Ignite, Module: Nftex Project](https://app.rocketseat.com.br/node/projeto-nftex-2022) lab by Rafael Camarda.
> The project simulates a NFT Art Catalog API that allows to register arts with GraphQL.
## Previous installations
**Database**, we recommends install [PostgreSQL](https://www.postgresql.org/) with [Docker](https://hub.docker.com/_/postgres). After that, sets connection configuration at:
- `config/dev.exs`
- `config/test.exs`## Gets dependencies, setups database, tests, coverages, reports and starts application
```bash
cd nftex
mix deps.get
mix ecto.setup
mix test
mix test --cover
mix phx.server
```## How to use?
```bash
# provides resources graphql
curl -X POST 'http://localhost:4000/api/graphql'# provides resources graphql with web development interface
curl -X POST 'http://localhost:4000/api/graphiql'# list all arts
curl -X GET 'http://localhost:4000/api/arts'
```### Resources GraphQL
```bash
# retrieves art
query {
art(id: "15794c31-2b9d-4aeb-aaf2-16eba64b4472") {
artist_name
description
price
hash
}
}# creates art
mutation {
createArt(input: {
description: "Ixi",
artistName: "Eita",
hash:"13xpto24",
price: 5.4
}) {
id
}
}# retrieves list of art
query {
arts {
id
artist_name
description
price
hash
}
}
```