Car rental API developed during Ignite bootcamp from Rocketseat.
- Features
- Api Documentation
- Application Requirements
- Database Model
- Api Status Codes
- First steps
- Getting Started Without Docker
- Getting Started With Docker
- Build
- Technologies
- License
- Car specifications CRUD
- Car categories CRUD
- Car CRUD
- Car rental
- Users CRUD
Once you got this application running on your machine you can go to localhost:3000/api_docs to see the full api documentation built with swagger
Check out the REQUIREMENTS page to see the full application requirements such as Business Rules and function and non-function requirements
Check the following status codes in this API:
Status Code | Description |
---|---|
200 | OK |
201 | CREATED |
400 | BAD REQUEST |
422 | UNPROCESSABLE ENTITY |
404 | NOT FOUND |
500 | INTERNAL SERVER ERROR |
To clone this project via HTTPS, you can run the following command:
git clone https://github.com/cunhaedu/rentx-api.git
Create your environment variables based on the examples of .env.example
cp .env.example .env
Install dependencies
yarn install
Or
npm install
Setup a database
Install Postgres to create a database, then you should modify the .env
with your credentials
Run the transactions in order to configure the database schema:
yarn typeorm migration:run
Run the following command in order to start the application in a development environment:
yarn dev:server
Once you have following all these previous commands your application will be available in localhost on Port 3000
To run this application with Docker you need to have Docker and docker-compose installed in your machine. Furthermore, you also need an account in Docker Hub in order to run docker commands
Once you have docker configured in your machine run the following commands:
docker build -t rentx .
docker-compose up
Run the following command in order to convert the .ts file to .js file in a folder called dist:
yarn build
Run the following command in order to start the application in a production environment:
yarn start
This project use the following technologies:
This project is under MIT License.See the LICENSE file for more details.