GithubHelp home page GithubHelp logo

nima-khodabandelou / rest_api_maven_postgresql Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 120 KB

Developing REST API using Java Spring framework along with Maven builder and PostgreSQL database

License: MIT License

Java 100.00%

rest_api_maven_postgresql's Introduction

REST_API_MAVEN_PostgreSQL

Developing API for student management system using Java Spring framework along with Maven and PostgreSQL. REST architecture is used for API development. Hibernate is utilized as ORM and data is persisted in PostgreSQL database. Also, Maven is chosen for building the project. Steps are as follows:

A repository is created on GitHub containing Licence, Readme, and gitignore (for Java) files.

The repo is cloned to hard-drive on a specific folder.

The Spring JAR file is generated on https://start.spring.io website considering relevant dependencies, i.e. Spring Boot Devtools, Spring Web, PostgreSQL Driver, and Spring Data JPA ( One may add H2 in-memory database dependency instead of external RDMS in order to be completely focused on the backend (and frontend if any) section(s) of the project; however, this is not the case with current development approach).

The generated JAR file is extracted in the project folder on hard-drive. The project is pre-configured by Spring Boot under the hood and several files and folders are available to start the software development process.

Using an appropriate IDE (Intellij Idea in the current approach), the project folder is opened and the newly added files are committed and pushed to the GitHub repo.

Postgres commands:

CREATE USER manager WITH LOGIN PASSWORD 'abc123';

CREATE DATABASE students;

ALTER DATABASE students OWNER TO manager;

INSERT INTO students (first_name, last_name, email) VALUES ('sample first name', 'sample last name', 'sample email');

// Note that having used Spring Data JPA, one doesn't need to create table and columns in SQL shell terminal, explicitly. Spring do the job!

SELECT * FROM students;

application.properties should be modified according to Postgres config as well as JPA requirements.

Controller, Model, Repository, and Exception packages are created and pertinent classes are developed.

Postman, Swagger UI, or other alternatives may be used for API testing.

rest_api_maven_postgresql's People

Contributors

nima-khodabandelou avatar

Stargazers

 avatar

Watchers

Kostas Georgiou avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.