🚀 Clique aqui para acessar a aplicação!!!
Aplicação hospedada em Railway
◽ Clonar o repositório:
git clone https://github.com/brseghese/ivera-fullstack-test.git
◽ Instalar dependências:
npm install
◽ Criar arquivo config.env
na raiz do projeto e definir as variáveis:
NODE_ENV=development
PORT=3000
DATABASE=******
DATABASE_PASSWORD=******
JWT_SECRET=******
JWT_EXPIRES_IN=90d
JWT_COOKIE_EXPIRES_IN=90
MARVEL_PUBLIC_KEY=******
MARVEL_PRIVATE_KEY=******
MongoDb | JWT | Marvel Api
◽ Executar o script:
npm run start
Acesse aqui o Postman para ver a documentação.
🔴 A route to create admin users;
Cadastrar novo usuario:
http://127.0.0.1:3000/api/v1/user
{
"name": "Usuário",
"email": "[email protected]",
"password": "12345678",
"passwordConfirm": "12345678",
"role": "user"
}
- Administrador =
"role": "admin"
- Usuário:
"role": "user"
Para cadastrar usuário é preciso estar logado como administrador.
Use o email e a senha abaixo no endpoint de login para logar:
- email:
[email protected]
- senha:
12345678
Obs. a senha é salva no banco criptografada.
🔴 A route to login with admin users (Use the login method that you prefer);
Login:
http://127.0.0.1:3000/api/v1/login
{
"email": "[email protected]",
"password": "12345678"
}
JSON Web Tokens usado como método de login.
🔴 A route of character list, accepting parameters of filters and pagination;
http://127.0.0.1:3000/api/v1/characters
Parametros:
&limit=20
: limita a paginação em 20;
&offset=20
: avança 20 personagens para a próxima página;
&nameStartsWith
: pesquisa por nome do personagem;
🔴 A route of character details, taking the character id as a parameter;
http://127.0.0.1:3000/api/v1/characters/id
🔴 A middleware for log requests, containing request method, url and parameters saved;
🔴 A route (authenticated only admin users) of history, containing all the log requests saved on MongoDB (No need front-end, only back-end call. Only admin profile)
http://127.0.0.1:3000/api/v1/logs
Para acessar essa rota é preciso estar logado como administrador.
🔴 A page of character list, using parameters, filters and pagination created before;
🔴 A page of character details, that shows all info returned from the backend by clicking on a character on the list created before;
Com a aplicação em execução, abra http://localhost:3000 no seu navegador para ver a aplicação.
🟢 SITE RESPONSIVO
Preview:
Desenvolvido com ❤️ por Bruno Seghese
Create a Rest API and a SPA that consumes and shows the official Marvel Comics API.
🔴 A route to create admin users;
🔴 A route to login with admin users (Use the login method that you prefer);
🔴 A route of character list, accepting parameters of filters and pagination;
🔴 A route of character details, taking the character id as a parameter;
🔴 A middleware for log requests, containing request method, url and parameters saved;
🔴 A route (authenticated only admin users) of history, containing all the log requests saved on MongoDB (No need front-end, only back-end call. Only admin profile)
🔴 A page of character list, using parameters, filters and pagination created before;
🔴 A page of character details, that shows all info returned from the backend by clicking on a character on the list created before;
☑️ Javascript ES6+
☑️ Nodejs
☑️ MongoDB
☑️ Any front-end framework/library (feel free to use Vuejs, Reactjs, EJS or any other 🚀)
☑️ Express (for the back-end)
☑️ Be free to use any other tools/tecs if you need
- Create a fork of this project
- Do all the tasks to complete the application
- Create a README.md showing the steps to run the application
- Make a merge request on the main branch
- Send us the link of the merge request