This project is a implementation of a Car Rental API in Node.js. It uses Express as web framework and MongoDB as database. The code is fully covered by tests, using Jest.
The application allows new users to register and authenticate by using JSON Web Tokens. Registered users are able to rent a car and return it at any time. Admins have additional privileges such as adding new cars to the database or viewing all active rentals.
In order to run the application on your local machine some requirements need to be installed.
Install npm
which is distributed with Node.js.
https://nodejs.org/en/download/
Install MongoDB and make sure the database server is running.
https://www.mongodb.com/download-center/community
Change the directory to the project folder and install the dependencies.
npm install
Run the tests to make sure everything is installed correctly and working.
npm test
Finally, start the Node web server.
npm start
The application will run on http://localhost:3000 by default.
If the port is already in use, it can be changed by setting the PORT
environment variable.
The easiest way to interact with the server is by installing a API development environment such as Postman.
Code released under the MIT License.