Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test Jorge Labrador #17

Open
wants to merge 2 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

PORT=4000

POSTGRES_HOST='localhost'
POSTGRES_PORT=5432
POSTGRES_USER='postgres'
POSTGRES_PASS='postgres'
POSTGRES_DB='images-ms'

SECRET_KEY='asdasd'

#firebase
CREDENTIALS_FIREBASE_PATH='../../asdasd-7bd6b-firebase-adminsdk-2vgkp-6f245a8028aa.json' #in this path(.env path)
BUCKET_NAME='gs://asdasd-7bd6b.appspot.com'
24 changes: 21 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
# compiled output
/dist
/node_modules

# ENV
.env
/build

# Logs
logs
Expand Down Expand Up @@ -36,3 +34,23 @@ lerna-debug.log*
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json

# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local

# temp directory
.temp
.tmp

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
3 changes: 1 addition & 2 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"singleQuote": true,
"trailingComma": "all",
"endOfLine": "auto"
"trailingComma": "all"
}
Binary file modified .yarn/install-state.gz
Binary file not shown.
3 changes: 0 additions & 3 deletions .yarnrc.yml

This file was deleted.

17 changes: 8 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,17 +64,16 @@ You should use the following tech stack during this project:
```bash
yarn install

3. **.env variables**
- You should update this point to include env names needed.
3. **.env.example**
- You can use the .env.example to create the .env

4. **Start the Service**
```bash
yarn start:dev

6. **Final considerations and recomendations**
- Keep it simple.
- Be organized in your code.
- Don't forget to provide the necessary environment variable names needed to run and test the project.
- Good luck :).


5. **Test in Postman**
- You can import the postman `ms-images.postman_collection` collection located at the root of the project

6. **Documentation**
- in /api

222 changes: 222 additions & 0 deletions ms-images.postman_collection.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,222 @@
{
"info": {
"_postman_id": "d23619d1-6d3a-4551-9a6b-5a1bebbe5a5e",
"name": "ms-images",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
"_exporter_id": "36934634"
},
"item": [
{
"name": "create user",
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\r\n \"username\": \"user\",\r\n \"password\": \"1234\"\r\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "localhost:4000/users",
"host": [
"localhost"
],
"port": "4000",
"path": [
"users"
]
}
},
"response": []
},
{
"name": "login",
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\r\n \"username\": \"user\",\r\n \"password\": \"1234\"\r\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "localhost:4000/login",
"host": [
"localhost"
],
"port": "4000",
"path": [
"login"
]
}
},
"response": []
},
{
"name": "getAll",
"protocolProfileBehavior": {
"disableBodyPruning": true
},
"request": {
"method": "GET",
"header": [],
"body": {
"mode": "raw",
"raw": "{\r\n \"username\": \"user\",\r\n \"password\": \"1234\"\r\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "localhost:4000/images?name=descarga&username=us&limit=10&page=1",
"host": [
"localhost"
],
"port": "4000",
"path": [
"images"
],
"query": [
{
"key": "name",
"value": "descarga"
},
{
"key": "username",
"value": "us"
},
{
"key": "limit",
"value": "10"
},
{
"key": "page",
"value": "1"
}
]
}
},
"response": []
},
{
"name": "getById",
"protocolProfileBehavior": {
"disableBodyPruning": true
},
"request": {
"method": "GET",
"header": [],
"body": {
"mode": "raw",
"raw": "",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "localhost:4000/images/1",
"host": [
"localhost"
],
"port": "4000",
"path": [
"images",
"1"
]
}
},
"response": []
},
{
"name": "delete",
"request": {
"method": "DELETE",
"header": [],
"body": {
"mode": "raw",
"raw": "",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "localhost:4000/images/3",
"host": [
"localhost"
],
"port": "4000",
"path": [
"images",
"3"
]
}
},
"response": []
},
{
"name": "upload image",
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleGlzdGluZ1VzZXIiOiJ1c2VyIiwiaWQiOjEsImlhdCI6MTcyODY2NzU0NiwiZXhwIjoxNzI4NzUzOTQ2fQ.BoVEDOIUNQH8KwdwUseSaj-hk0eQxhGwHeEsdQnphK8",
"type": "string"
}
]
},
"method": "POST",
"header": [],
"body": {
"mode": "formdata",
"formdata": [
{
"key": "file",
"type": "file",
"src": "/C:/Users/EVELIN/Pictures/descarga.jpg"
}
]
},
"url": {
"raw": "localhost:4000/images/upload",
"host": [
"localhost"
],
"port": "4000",
"path": [
"images",
"upload"
],
"query": [
{
"key": "username",
"value": "user",
"disabled": true
},
{
"key": "password",
"value": "1234",
"disabled": true
}
]
}
},
"response": []
}
]
}
3 changes: 1 addition & 2 deletions nest-cli.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"collection": "@nestjs/schematics",
"sourceRoot": "src",
"compilerOptions": {
"deleteOutDir": true,
"plugins": ["@nestjs/swagger/plugin"]
"deleteOutDir": true
}
}
Loading