1

I'm new to REST API's in general and I have the following questions:

I want to make a website, and an App that share the same users, and data from database in general. For the website I plan to make it with spring for the backend, and for the app I plan to make it in kotlin, as well as an IOS version, to which I havent decided what language I will use. I also want an API the public can use. Is this when I would make a rest API, for the data, and the public API? The website and app would both contain login, registration, and more How do I make the website/app retrieve data from the REST API?

Also, what do I make the API in? Is this something I could use spring for?

Sorry if this is a really stupid question.

Aj3douglas
  • 51
  • 1
  • 7
  • You can use springboot to create api and call that api from mobile as well as web. – Sanjay Oct 11 '20 at 04:48
  • ok so the API just handles like storing the data and stuff, then I just like make POST requests to tell the API to make new users and stuff? Is that the general gist of things – Aj3douglas Oct 11 '20 at 04:51
  • Yes. You can configure database to store data.you can write logic to process data as per requirement. oyu can try example of angular+springboot+mysql. – Sanjay Oct 11 '20 at 04:52
  • What would angular be for? idk js, but if I make the backend to the website in spring, wont I get alot of duplicated code, mainly for the entities? – Aj3douglas Oct 11 '20 at 04:57
  • angular is used to make single page application. – Sanjay Oct 11 '20 at 05:00
  • The question is to generic, REST API are used to access data over HTTP and it can serve different client application(web,mobile, etc..) as long as they conform to REST Standards More on REST here : https://stackoverflow.com/questions/7551/best-practices-for-securing-a-rest-api-web-service – Wills Oct 11 '20 at 05:01

2 Answers2

0

Unlike your question supposes, which is declared as "general", you are mentioning Spring MVC as backend for REST-Endpoint API as well as Angular as independent frontend solution, altogether handling user, groups and their special rights on objects.

There are some dozen if not hundreds of possibilities to build an API, but I suppose you look at jhipster.tech, which is a code generator serving you the basic fundament for Spring backend and Angular frontend (you can choose other frontends, but I recommend to use Angular for generation as it is similar to Java in Spring framework).

As you can generate from easy first monolithic constructs for testing and learning all the modules and technics as well as high-level company-driving microservices for ERP including process-management and accounting, API for field workers, partner companies and clients, one or more Webstores, connecting mobile devices and everything else "in minutes", it is not only a splendid tool, that shows you best practice in development including good documentation, but it is also used as generator for professionals to start a project.

With jhipster and its community you'll learn from pro's and get some steps further - at least for me the work of those guys was and is an eye-opener - after years of reading books about programming and turning left and right, often enough to nowhere.

Of course, it is opinionated like Spring and Angular themselves. But the technics which are used are reliable, well combinated and do build the daily software-stack in many companies since and for years.

You'll code in Java or Kotlin in Spring and ECMAScript (Typescript as Javascript Transpiler) in Angular framework. The structure and ideas behind these programming languages are comparable - "Typescript is easy to understand for Java-guys". And you'll stay independent from support companies, platforms or library changes. Besides you'll learn how to update your own software, which is often forgotten in business software, too.

Jochen Haßfurter
  • 875
  • 2
  • 13
  • 27
0

I am not sure why you want to use kotlin. You can use Angular for UI and Spring Boot for Rest API. I have some POC for user registration. Please have a look.

https://github.com/numery009/springmvc-security-aop-hibernate-user-registration

https://github.com/numery009/numery009.github.io

For UI with Angular -- https://numery009.github.io/

Numery
  • 402
  • 1
  • 6
  • 16
  • 1
    Spring Boot is a framework, not a language; it can be used with Java or with Kotlin.  If you don't have any ties to Java, Kotlin is arguably a nicer language, and interoperates perfectly with all Java-based frameworks. – gidds Oct 11 '20 at 11:06