Application showing an example of using Decorator and Dependency Injection design patterns. For this purpose, the popular typedi and routing-controllers libraries were used. In addition, the application uses JWT tokens to authorize users.
You can import Postman collection from docs directory with all API endpoints.
POST localhost:3000/api/register
- register new userPOST localhost:3000/api/sign-in
- get JWT token for the userPOST localhost:3000/api/generate-key-pair
- generate private and public key pair for the userPOST localhost:3000/api/encrypt
- encrypt sample file data/documents/sample.pdf by user public key
Just type: npm run docker
and wait until you see in the console: "Application listening on port 3000"
If it does not work, you probably have some permissions problems - fix them or run app directly on your local machine
- Generate local files:
npm run create-files-from-dist
- Set a valid configuration to your database in the config/local.json file
- Install dependencies:
npm install
- Compile Typescript files:
npm run build
- Run migrations:
npm run migration:run
- Run app:
npm run start