Vending Machine Exercice

€ 8.00 — 30.00 EUR
Exercise brief
Design an API for a vending machine, allowing users with a "seller“ role to add, update or remove
products, while users with a "buyer" role can deposit coins into the machine and make purchases.

Your vending machine should only accept 5, 10, 20. 50 and 100 cent coins.

Tasks
• REST API should be implemented consuming and producing "application/json"
• Implement product model with amountAvailable. cost, productName and sellerld fields
• Implement user model with username, password, deposit and role fields
• Implement an authentication method (basic, oAuth, JWT or something else, the choice is
yours)
• All of the endpoints should be authenticated unless stated otherwise
• Implement CRUD for users (POST /user should not require authentication to allow new user
registration)
• Implement CRUD for a product model (GET can be called by anyone, while POST, PUT and
DELETE can be called only by the seller user who created the product)
• Implement /deposit endpoint so users with a "buyer" role can deposit only 5, 10, 20, 50 and
100 cent coins into their vending machine account

• Implement /buy endpoint (accepts productld. amount of products) so users with a 'buyer-
role can buy products with the money they've deposited.
API should return total they've

spent. products they've purchased and their change if there's any (in an array of 5, 10, 20, 50
and 100 cent coins)
• Implement /reset endpoint so users with a "buyer" role can reset their deposit back to 0
• Take time to think about possible edge cases and access issues that should be solved
• If somebody is already logged in with the same credentials, the user should be given a
message 'There is already an active session using your account".
In this case the user should
be able to terminate all the active sessions on their account via an endpoint i.e. /logout/all
• Attention to security
Evaluation criteria:
• Language/Framework of choice best practices
• Edge cases covered
• Write tests for /deposit. /buy and one CRUD endpoint of your choice
• Code readability and optimization
*****
I prefer it to be done with React js

Similar Freelance jobs:

Correcciones Css Y Responsive Aplicación Web
Fix css and responsive webapp http://test.moogo.com.co see attach file with issues.Correcciones css y responsive aplicación web http://test.moogo.com.co ver archivo adjunto con los issues, por favor cuéntame en cuanto tiempo me lo entregas, te agradezco que este tiempo sea estimado lo más concienzudo posible. 
Full Description of Correcciones css y responsive aplicación web
Cvat Does Not Work
I need help to install CVAT on my server https://github.com/openvinotoolkit/cvat I fixed it this way trying to make it work https://github.com/openvinotoolkit/cvat/issues/1011 Ports are allocated. But the page does not show. Managed to solve the ports were already allocated. Stuck! Help!
Full Description of CVAT does not work
Maintenance Tasks Of Zencart Ecommerce Website
Looking for a freelancer to help with a number of tasks on Zencart website, which include having images display better on hover, fixing broken links, fix the pricing of the GST and EX GST pricing on the TAX INVOICE, speed optimization, making the site mobile responsive, etc. More specification about the tasks will be given. We will agree on the set of tasks and budget and timeline before project is awarded. There will be other tasks that the employer would…
Full Description of Maintenance tasks of Zencart Ecommerce Website
Develop A Responsive Website Using Flutter
i have an app that need to be developed as website using Flutter. it has to be responsive and compatible with multiple screen sizes and most used browsers (edge, chrome, safari, firefox ). keep in mind that you'll only do the front end, as the backend is already made. i will provide you with and API so all you have to do is post/get information through urls
Full Description of develop a responsive website using flutter
Crear Un Software
Software de ingeniería aplicada a la geología para ingreso de datos, generación de gráficos y entorno de consultas. Sistema operativo Windows, posteriormente a iOS y Android.
Full Description of Crear un software
I Want To Build A Tool Using Hap.py Benchmarking (nist) To Validate Any Vcf File By Running The File
The inputs to hap.py are two VCF files (a "truth" and a "query" file), the truth file is found here https://www.nature.com/articles/sdata201625/tables/3 which includes extensive genome sequencing for 1 person. So we can validate any VCF file by comparing our VCF with the truth VCF and the outcome will include a table with TP FP TN FN and precision with the sensitivity you can read more about it on this page: https://github.com/RealTimeGenomics/rtg-tools https://github.com/Illumina/hap.py/blob/master/doc/happy.md#working-with-genome-vcfs
Full Description of I want to build a tool using Hap.py…
Nft Marketplace, Own Blockchain, Governance Token + Mobile App
Hello, I'm looking for a team to help with coding my business into blockchain (fork of BSC or ETH). It's going to be linking a website to an NFT marketplace along with a governance token and mobile app together with interactive features that connect with the marketplace/blockchain. NFT Marketplace like RARIBLE, OpenSea, etc. I have a budget of $2500 USD right now. Let me know if we can work and how long it will take you
Full Description of NFT Marketplace, Own blockchain, Governance token + Mobile…
Website Design And Re-branding
We are an IT services company, where we provide the following 1. Home 2. About 2.1 Who we are 2.2 Contact Us 2.3 Careers 2.4 Request a Demo 3. Solutions 3.1 iVisionMT Note: Workforce Managment 3.1.1 ROI 3.1.2 iVisionMT 3.1.3 How it works 3.2 iVisionHCM note: HCM software (It has folowing: Core HR, Payroll, Leave Managment, Recurtment, Performance Managent, Self Service, Learning Managment, Advance benifits) 3.3 xightStudio Note: BI tool, Data visualization 4. Services 4.1 AWS support Services 4.2 Data…
Full Description of Website design and re-branding
Software Centro Fitness
Desarrollador de software para centro fitness, registro de clientes, contratos automatizados, check in, reservas de clases, programación de eventos, etc
Full Description of Software centro fitness
Online Tutoring Platform
Hi, I work with a big E-learning company and I am looking to hire a team that can create an online tutoring platform that automatically matches tutor with the client. REQUIREMENTS - PLEASE DO NOT RESPOND IF YOU DO NOT MEET THE FOLLOWING: I will hire USA or native English only. Team must be professional and HAVE EXPERIENCE ALREADY CREATING A SIMILAR SYSTEM IN THE PAST My goal is to do this as fast as possible and correctly. I do…
Full Description of Online Tutoring Platform
Build Websocket User Interface For Remote Voicetracking
I need a webpage driven by websocket communication from VB6 and page via javascript. It will list a playlist of music tracks, and allow user to record a voice track and insert and preview the result. It will also upload back to vb6 server the voicetrack and changes to playlist. I will be working directing using simple json and blob communication from vb6 app. See attached spec for more details.
Full Description of Build Websocket user interface for Remote Voicetracking
Personal Financial Planning Tools -- 2
I have a website on optimizepress 3 theme. There are 2 pages - retirement planner and goal planner which i want you to develop for me. Providing the exact requirement document, 1 sample basic - html, JavaScript code to start with. This should work seamlessly on desktop, laptop, tablet, mobile, etc on any device. So responsive design and cross browser compatible. Earlier these 2 pages were developed on OP2 and now it is not working on OP3 theme. Whatever is…
Full Description of Personal Financial Planning Tools -- 2
Create A Vuejs App That Pushes Signature To Outlook Web
Hi! I need to replicate this functionality in a simple app. 1- Loggin to the microsoft exchange acount and list the users 2- Push signatures to outlook web with a button to all accounts (signature content can be only the name) I made 2 videos, 1 describing how a competitor uses it https://www.youtube.com/watch?v=Snw1wdOwKYo And the other what i spect from the simple app https://www.youtube.com/watch?v=W1IhtD22gHg
Full Description of Create a VueJS App That Pushes Signature to…
Rebuild Our Custom Website
1.Make our new frontend responsive (stocking) - so that it changes shape with any shaped screen including mobiles. 2.Have a new filter system that allows customer to narrow down their search of what they want. With the ability to add extra pages at anytime that can look like another company with a custom header banner and colour changes. 3.Have SEO, heat mapping and other important features build in. 4.Have it communicate fully both ways with Zero accounting software. 5.An easier…
Full Description of Rebuild our custom website
© 2006 — 2026 hirelancer.com is an affiliate website, listing the freelance projects. We are collaborating with other sites like getFreelancer.com. Feel free to bid on any project and good luck! You will need register first, before bidding or posting projects. Basic memberhsip is always free. We might earn commissions from referring you. You will never ever pay additional fees for we referred you.