Welcome to the CarSharingApp API project, where we bring you an exceptional online car rental experience!
Here's a brief high-level overview of the tech stack the Car sharing service API uses:
- Spring Boot: provides a set of pre-built templates and conventions for creating stand-alone, production-grade Spring-based applications.
- Spring Security: provides features like authentication, authorization, and protection against common security threats.
- Spring Web: includes tools for handling HTTP requests, managing sessions, and processing web-related tasks.
- Spring Data JPA: provides a higher-level abstraction for working with databases and includes support for JPA (Java Persistence API).
- Hibernate: simplifies the interaction between Java applications and databases by mapping Java objects to database tables and vice versa.
- Lombok: helps reduce boilerplate code by automatically generating common code constructs (like getters, setters, constructors, etc.) during compile time.
- Mapstruct: generates mapping code based on annotations, reducing the need for manual, error-prone mapping code.
- Liquibase: helps manage database schema changes over time, making it easier to track and deploy database updates.
- Swagger: provides a framework for generating interactive API documentation, allowing developers to understand, test, and use APIs more easily.
- Docker: provides a consistent and reproducible way to deploy applications across different environments.
First, let's download a repository.
Via IDE:
- Open IntelliJ IDEA.
- Select "File" -> "New Project from Version Control."
- Paste the link: https://github.com/jv-jun23-team1/car-sharing-app.git
Via git console command:
git clone https://github.com/jv-jun23-team1/car-sharing-app.git
Then we should build a project using Maven:
mvn clean install
Then, rise a Docker container of your app:
docker build -t {your-image-name} .
docker-compose build
docker-compose up
That's all you need to know to start! 🎉
In our application, we use JWT tokens to ensure secure authentication and authorization. This guarantees that only verified users can access sensitive features.
Users can get list of all cars or details of specific car by its id. Managers can add, update (change model, brand, type or amount available) and delete cars.
Our platform supports payment function provided through Stripe platform. You can make your payment or get list of payments by user id.
Handles notifications about new rentals, overdue rentals, and successful payments. Other services interact with it to send notifications to car sharing service administrators. Utilizes the Telegram API, Telegram Chats, and Bots for communication.:
In our API, functionality is divided for Customers and Managers:
Controller | Customer | Manager |
---|---|---|
AuthenticationController | Registration, authentication | - |
CarController | Get list of cars, get car by id | Create, update, delete functionality |
PaymentController | Create a new payment, get all payments by user ID | - |
RentalController | Create a new rental, get list of own rentals by status, get details of own rental by id, return car | Get list or details of any rentals |
UserController | Get public information about account, update data | Change user roles |
We have integrated Swagger for easy API documentation. To access the API documentation after running the application, visit the Swagger API documentation.
To simplify the testing process, we've prepared a Postman collection and environment that encompass some customer and manager requests.
We welcome contributions from the community to enhance the car sharing service project. Whether you want to fix a bug, improve an existing feature, or propose a new one, your contributions are valuable to us.
This project is a RESTful API for a car sharing service, designed to manage user authentication, user profiles, car inventory, car rentals, payments via Stripe, and notifications via Telegram. It provides various endpoints under different controllers to handle these functionalities.
This project is licensed under the MIT license. Feel free to edit and distribute this template as you like.