firasrg / autocare-rest-api

AutoCare is a well-organized REST API sample app
GNU Affero General Public License v3.0
0 stars 2 forks source link
rest-api spring-boot web-application

AutoCare REST API Sample

Code Analysis java-version

Bugs Reliability Rating Maintainability Rating Vulnerabilities

Overview

The AutoCare REST API 🚗🧑‍🔧 offers a comprehensive solution for managing vehicle services . This developer-friendly project is designed to enhance proficiency with modern Spring applications, providing hands-on experience with real-world scenarios and best practices for backend development.

Goals :

Features

Technology Stack

Getting Started

  1. Clone the repository
git clone <GITHUB_REPOSITORY_URL>
cd autocare-rest-api
  1. Build

    ./mvnw clean install
  2. Run

    ./mvnw spring-boot:run "-Dspring-boot.run.profiles=demo"

    Note: Currently, the app doesn't have endpoints for CRUD operations yet (except one GET/api/cars). The demo profile refers to ../configs/LoadDatabase, which helps to fill database with some data at runtime.

  3. Check Endpoint:

From Web-browser (or Postman) check the following URL http://localhost:8080/api/cars with GET HTTP method :

docs/endpoint-test.png

  1. Check Database:

We use H2 Database to demonstrate the app while in DEV mode. SpringBoot autoconfigures H2 database :

Check the app's log, make sure to have something like this :

INFO ... Added connection conn0: url=jdbc:h2:mem:a917d8a4-bb16-46a1-84a4-f59d60f01ca8 user=SA
INFO ... H2 console available at '/h2-console'. Database available at 'jdbc:h2:mem:a917d8a4-bb16-46a1-84a4-f59d60f01ca8'

Next, from web-browser, try the following URL : http://localhost:8080/h2-console. This will take you to H2 console webpage:

docs/h2-login.png

Copy, paste your database URL and username from your app's log and press on Connect button :

docs/h2-db-view.png

There you go 🎉!

Contributing

If you want to dive in this project and help us to improve it, please read and follow our contributing guidelines.

Community

You can join us on Together Java Discord server: brainstorm ideas, ask questions, and collaborate with others. Be respectful and follow the server guidelines. We have a dedicated channel for this project.