🎓 Making an inventory software for a fictive laboratory (back-end)
Find a file
jusdepatate 74568393c0 typo
2023-09-30 19:27:25 +02:00
.vscode I have very mixed feelings towards this evil ecosystem 2023-09-20 12:15:30 +02:00
funcs stop using console.log 2023-09-27 11:07:51 +02:00
init-mongodb woopsy doopsy 2023-09-29 09:52:02 +02:00
objs objects 2023-09-27 11:06:46 +02:00
routes typo 2023-09-30 19:27:25 +02:00
schemas Working on HMU 2023-09-14 13:23:46 +02:00
.env dotenv 2023-09-27 09:14:56 +02:00
.env.example dotenv 2023-09-27 09:14:56 +02:00
.gitignore avoid mistakes 2023-09-27 09:15:09 +02:00
docker-compose.yml docker working 2023-09-28 09:47:27 +02:00
Dockerfile removed 8 useless commits from history 2023-09-27 20:50:48 +02:00
index.ts stop using console.log 2023-09-27 11:07:51 +02:00
package-lock.json friendship ended with eslinter 2023-09-27 14:22:28 +02:00
package.json friendship ended with eslinter 2023-09-27 14:22:28 +02:00
README.md Working on HMU 2023-09-14 13:23:46 +02:00
tsconfig.json TypeScript! 2023-09-14 10:20:07 +02:00

GSBVentory Backend

  • npm run dev
  • brew services start mongodb-community@7.0

Env

  • JWT_TOKEN
  • PORT (default 3000)
  • DB_URL

db

  • use gsbv
  • db.createUser({ user: "gsbv", pwd: "gsbv", roles:["dbAdmin"]})
  • db.users.insertOne({username: "john", password: "$2y$10$ZiVn1Phi9H5yYAPO34VL9e/Hi1edPXU5QGtP/nmRAkG8ETv/Pkqiy", userType: 4})
  • db.hardwares.insertOne({"type": "laptop", "buyDate": new Date("2022-01-12"), "serialNumber": "AZQSWX12", "manufacturer": "Dell", "model": "Lattitude", "endOfWarrantyDate": new Date("2024-01-11"), "internalId": "LA2022010001", "note": "i5-12400F, 16GB Ram, 512 NVMe"});

Logging in

curl --location 'http://localhost:3000/login' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'password=a' \
--data-urlencode 'username=john'

Returns a JWT in json under property token. To use it request any private endpoint with header Authorization: XXX.