Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Building Applications with Spring 5 and Kotlin

You're reading from   Building Applications with Spring 5 and Kotlin Build scalable and reactive applications with Spring combined with the productivity of Kotlin

Arrow left icon
Product type Paperback
Published in May 2018
Publisher Packt
ISBN-13 9781788394802
Length 310 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Miloš Vasić Miloš Vasić
Author Profile Icon Miloš Vasić
Miloš Vasić
Arrow right icon
View More author details
Toc

Table of Contents (12) Chapters Close

Preface 1. Starting Up FREE CHAPTER 2. Starting with Spring 3. Building Your First Spring RESTful Service with Kotlin 4. Working with Spring Data JPA and MySQL 5. Securing Applications with Spring Security 6. Spring Cloud 7. Using Project Reactor 8. Development Practices 9. Testing 10. Project Deployment 11. Other Books You May Enjoy

Setting up a Git repository

We have installed the IDE and Spring Framework. It is time to start working on our project. We will develop a REST application API for Notes and TODOs. This is a tool that everybody needs. We will give it a name: Journaler API. Journaler API will be a REST application capable of creating Notes and TODOs with reminders. Many different applications, such as mobile ones, will be synced to our backend instance running this REST application.

The first step in development is initializing a Git repository. Git will be our code versioning system. It is up to you to decide whether you will use GitHub, BitBucket, or something else for your remote Git instance. Create your remote repository and keep its URL ready along with your credentials. So, let's start!

The following are the steps to set up Git:

  1. Go into the directory containing the project.
  2. Execute the following command:
$ git init .
  1. The console output will be something like the following:
Initialized empty Git repository in <directory_you_choose/.git>
  1. We have initialized the repository. Now let's add the first file by executing the following command:
$ vi notes.txt
Here we are using vi editor to edit notes.txt. If you are familiar with some other editor, use that.
  1. Populate notes.txt with some content and save it.
  2. To add all of the relevant files, execute the following commands:
$ git add .
$ git commit -m "Journaler API: First commit"
  1. The console output will be something like the following:
[master (root-commit) 5e98ea4] Journaler API: First commit
 
1 file changed, 1 insertion(+)
 
create mode 100644 notes.txt
  1. Use the remote Git repository URL that you have prepared previously with credentials, and execute the following command:
$ git remote add origin <repository_url>
  • This sets the new remote.
  1. Execute the following command to verify the new remote URL:
$ git remote -v
  1. Finally, push everything we have to remote, by executing the following command:
$ git push -u origin master
  • If you are asked for credentials, enter them and confirm by pressing Enter.
You have been reading a chapter from
Building Applications with Spring 5 and Kotlin
Published in: May 2018
Publisher: Packt
ISBN-13: 9781788394802
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime