Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nflaig/car-rental-api
Node.js Car Rental API
https://github.com/nflaig/car-rental-api
expressjs jest jwt mongodb nodejs restful-api
Last synced: 8 days ago
JSON representation
Node.js Car Rental API
- Host: GitHub
- URL: https://github.com/nflaig/car-rental-api
- Owner: nflaig
- License: mit
- Created: 2018-10-23T21:42:22.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2024-06-18T06:40:34.000Z (5 months ago)
- Last Synced: 2024-10-04T13:42:50.933Z (about 1 month ago)
- Topics: expressjs, jest, jwt, mongodb, nodejs, restful-api
- Language: JavaScript
- Size: 924 KB
- Stars: 16
- Watchers: 3
- Forks: 7
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Introduction
This project is a implementation of a Car Rental API in [Node.js](https://nodejs.org/en/).
It uses [Express](https://expressjs.com/) as web framework and [MongoDB](https://www.mongodb.com/) as database.
The code is fully covered by tests, using [Jest](https://jestjs.io/).The application allows new users to register and authenticate by using [JSON Web Tokens](https://jwt.io/).
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.## Installation
In order to run the application on your local machine some requirements need to be installed.
#### Node.js
Install `npm` which is distributed with Node.js.
https://nodejs.org/en/download/
#### MongoDB
Install MongoDB and make sure the database server is running.
https://www.mongodb.com/download-center/community
#### Dependencies
Change the directory to the project folder and install the dependencies.
```
npm install
```## Tests
Run the tests to make sure everything is installed correctly and working.
```
npm test
```## Usage
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](https://www.getpostman.com/).## License
Code released under the [MIT License](https://github.com/nflaig/car-rental-api/blob/master/LICENSE).