Implement a Web platform to provide a simple calculator functionality (addition, subtraction, multiplication, division, square root, and a random string generation) where each functionality will have a separate cost per request.
User’s will have a starting credit / balance. Each request will be deducted from the user’s balance. If the user’s balance isn’t enough to cover the request cost, the request shall be denied.
This Web application and its UI application should be live (on any platform of your choice) and should be ready to be configured and used locally for any other developer (having all instructions written for this purpose).
Requirements:
- Use third party operation for random string https://www.random.org/clients
- All client-server interaction should be through RESTful API (versionated).
- Collection endpoints should be able to provide filters and pagination.
- Use a Bootstrap or Material Design library (CSS/Design Library) of your choice.
- Add automated tests such as Unit Test (whether for frontend or backend).
- Records should be soft-deleted only.
🛠 With:
- Node.js
- Prisma
- JWT
- BCrypt
- AWS CloudFormation
- Lambda
- RDS
-
Be sure to follow this guide first: Prisma Docs
-
Clone the project
git clone https://github.com/NotoriousGOR/calcufy-backend
- Go to the project directory
cd my-project
- Install dependencies
npm install
To deploy this project run
npm run deploy
POST /sign-up
Parameter | Type | Description |
---|---|---|
username |
string |
Required |
password |
string |
Required |
POST /login
Parameter | Type | Description |
---|---|---|
username |
string |
Required |
password |
string |
Required |
POST /operations
Parameter | Type | Description |
---|---|---|
operandA |
string |
Required (not on random_string, or square_root) |
operandB |
string |
Required (not on random_string, or square_root) |
op |
string |
Required (addition, subtraction, multiplication, division, square_root, random_string) |
POST /records