From 4e7df8d26983de70ee23d3521d825031eafd204a Mon Sep 17 00:00:00 2001 From: KadeStyron Date: Fri, 6 Sep 2024 16:18:49 -0400 Subject: [PATCH 01/13] How to initialize Spring Boot Application --- backend/README.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 backend/README.md diff --git a/backend/README.md b/backend/README.md new file mode 100644 index 0000000..e69de29 From af312994303ee17fcbe168c449e8aa7172d1d913 Mon Sep 17 00:00:00 2001 From: KadeStyron Date: Fri, 6 Sep 2024 16:28:15 -0400 Subject: [PATCH 02/13] trying to update README.md to include starting text --- backend/README.md | 50 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/backend/README.md b/backend/README.md index e69de29..c4590e0 100644 --- a/backend/README.md +++ b/backend/README.md @@ -0,0 +1,50 @@ +# Introduction to Spring Boot + + +## Prerequisites + +This tutorial assumes that the readers has basic knowledge of java and the structure of web applications. To learn more about Spring you should view [This Spring article] (#spring). + +## What is Spring Boot + Spring Boot is built on top of the Spring framework. It's used to set-up, configure, and run web-based applications. Each Spring Boot application also contains an Embedded HTTP Server which will allow us to create our own API for the frontend to use. + +## Why use Spring Boot + Spring Boot makes production-ready quickly and efficiently. It provides all of the features of spring but it's also easier to use. Everything is also auto-configured in Spring Boot. It minimizes the writing of boilerplate codes and xml configurations. + + Additional Spring Boot Advantages. + 1. Connecting to databases + 2. Spring Boot provides application metrics + 3. There's security modules available + 4. Easy to Learn + 5. So much more + + + +## How to start your Spring Boot application +1. Go to start.spring.io +2. Fill in your settings. + - Create a Maven Project + - Pick Java + - Keep the version as the default + - Convention for Group ID name is the reverse of your domain name. It identifies your project. Example: com.devdogs.schedulebuilder + - Convention for Artifact ID is lowercase letters with hyphens. It should be the name of your project's artifact. Example: optimal-schedule-builder. + -Package Name convention should be the same thing as your group ID. + - Add Dependencies. These are a list of some relevant ones. + - Spring Web is essential for our projects. + - Spring Data JDBC allows us to connect to a SQL database. + - H2 database proved an In-Memory Database that can be controlled through the browser. + - MySQL Driver allows java programs to connect to a MySQL database. + - There are SO many more. + - Select Jar packaging + - Select newest Java version. +3. Generate and then extract the zip file. +4. Open your project with your IDE! + + + + + + + +Sources: +https://www.javatpoint.com/spring-boot-tutorial \ No newline at end of file From b78b62afea97c0cb0426c6b76d9fe9179b7dabb7 Mon Sep 17 00:00:00 2001 From: KadeStyron Date: Fri, 6 Sep 2024 16:31:52 -0400 Subject: [PATCH 03/13] testing markdown formatting --- backend/README.md | 39 ++++++++++++++++++++++++++------------- 1 file changed, 26 insertions(+), 13 deletions(-) diff --git a/backend/README.md b/backend/README.md index c4590e0..003239b 100644 --- a/backend/README.md +++ b/backend/README.md @@ -3,20 +3,28 @@ ## Prerequisites -This tutorial assumes that the readers has basic knowledge of java and the structure of web applications. To learn more about Spring you should view [This Spring article] (#spring). +This tutorial assumes that the readers has basic knowledge of java and the +structure of web applications. To learn more about Spring you should view +[This Spring article] (#spring). ## What is Spring Boot - Spring Boot is built on top of the Spring framework. It's used to set-up, configure, and run web-based applications. Each Spring Boot application also contains an Embedded HTTP Server which will allow us to create our own API for the frontend to use. +Spring Boot is built on top of the Spring framework. It's used to set-up, +configure, and run web-based applications. Each Spring Boot application +also contains an Embedded HTTP Server which will allow us to create our + own API for the frontend to use. ## Why use Spring Boot - Spring Boot makes production-ready quickly and efficiently. It provides all of the features of spring but it's also easier to use. Everything is also auto-configured in Spring Boot. It minimizes the writing of boilerplate codes and xml configurations. +Spring Boot makes production-ready quickly and efficiently. It provides +all of the features of spring but it's also easier to use. Everything +is also auto-configured in Spring Boot. It minimizes the writing of +boilerplate codes and xml configurations. - Additional Spring Boot Advantages. - 1. Connecting to databases - 2. Spring Boot provides application metrics - 3. There's security modules available - 4. Easy to Learn - 5. So much more +Additional Spring Boot Advantages. +1. Connecting to databases +2. Spring Boot provides application metrics +3. There's security modules available +4. Easy to Learn +5. So much more @@ -26,13 +34,18 @@ This tutorial assumes that the readers has basic knowledge of java and the struc - Create a Maven Project - Pick Java - Keep the version as the default - - Convention for Group ID name is the reverse of your domain name. It identifies your project. Example: com.devdogs.schedulebuilder - - Convention for Artifact ID is lowercase letters with hyphens. It should be the name of your project's artifact. Example: optimal-schedule-builder. - -Package Name convention should be the same thing as your group ID. + - Convention for Group ID name is the reverse of your domain name. + It identifies your project. Example: com.devdogs.schedulebuilder + - Convention for Artifact ID is lowercase letters with hyphens. + It should be the name of your project's artifact. Example: + optimal-schedule-builder. + -Package Name convention should be the same thing as your + group ID. - Add Dependencies. These are a list of some relevant ones. - Spring Web is essential for our projects. - Spring Data JDBC allows us to connect to a SQL database. - - H2 database proved an In-Memory Database that can be controlled through the browser. + - H2 database proved an In-Memory Database that can be + controlled through the browser. - MySQL Driver allows java programs to connect to a MySQL database. - There are SO many more. - Select Jar packaging From 764c91e38354a75536ebd0f21c481fd188a3a882 Mon Sep 17 00:00:00 2001 From: KadeStyron Date: Mon, 9 Sep 2024 15:21:43 -0400 Subject: [PATCH 04/13] Changed formatting and added an example --- backend/README.md | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/backend/README.md b/backend/README.md index 003239b..2fc084a 100644 --- a/backend/README.md +++ b/backend/README.md @@ -5,7 +5,7 @@ This tutorial assumes that the readers has basic knowledge of java and the structure of web applications. To learn more about Spring you should view -[This Spring article] (#spring). +[This Spring article] (#spring). To best learn I would follow along with the code examples. ## What is Spring Boot Spring Boot is built on top of the Spring framework. It's used to set-up, @@ -49,11 +49,37 @@ Additional Spring Boot Advantages. - MySQL Driver allows java programs to connect to a MySQL database. - There are SO many more. - Select Jar packaging - - Select newest Java version. + - Select your Java version. 3. Generate and then extract the zip file. 4. Open your project with your IDE! +## How to implement a REST API + +### Starting +Go to your SpringBootApplication class. THis should come by default. +Add @RestController above your class. Then you need to add a rest endpoint. This endpoint can be any method with the annotation @GetMapping above the class. + +Your code should look something like this + +' +@SpringBootApplication +@RestController +public class DemoApplication { + + public static void main(String[] args) { + SpringApplication.run(DemoApplication.class, args); + } + + @GetMapping + public String hello() { + return "Hello World!"; + } + +} +' + + From 8aa34f3cf3bad263ebda0f2242da5c4138076051 Mon Sep 17 00:00:00 2001 From: KadeStyron Date: Mon, 9 Sep 2024 16:36:46 -0400 Subject: [PATCH 05/13] added student class example and altered sources links --- backend/README.md | 144 +++++++++++++++++++++++++++++----------------- 1 file changed, 91 insertions(+), 53 deletions(-) diff --git a/backend/README.md b/backend/README.md index 2fc084a..c938be8 100644 --- a/backend/README.md +++ b/backend/README.md @@ -1,89 +1,127 @@ # Introduction to Spring Boot - ## Prerequisites -This tutorial assumes that the readers has basic knowledge of java and the -structure of web applications. To learn more about Spring you should view -[This Spring article] (#spring). To best learn I would follow along with the code examples. +This tutorial assumes that the reader has basic knowledge of Java and the structure of web applications. To learn more about Spring, you should view this Spring article. To best learn, follow along with the code examples. ## What is Spring Boot -Spring Boot is built on top of the Spring framework. It's used to set-up, -configure, and run web-based applications. Each Spring Boot application -also contains an Embedded HTTP Server which will allow us to create our - own API for the frontend to use. + +Spring Boot is built on top of the Spring framework. It's used to set up, configure, and run web-based applications. Each Spring Boot application also contains an embedded HTTP server, which allows us to create our own API for the frontend to use. ## Why use Spring Boot -Spring Boot makes production-ready quickly and efficiently. It provides -all of the features of spring but it's also easier to use. Everything -is also auto-configured in Spring Boot. It minimizes the writing of -boilerplate codes and xml configurations. -Additional Spring Boot Advantages. +Spring Boot makes production-ready applications quickly and efficiently. It provides all of the features of Spring but is also easier to use. Everything is auto-configured in Spring Boot, minimizing the writing of boilerplate code and XML configurations. + +### Additional Spring Boot Advantages + 1. Connecting to databases 2. Spring Boot provides application metrics -3. There's security modules available -4. Easy to Learn +3. There are security modules available +4. Easy to learn 5. So much more - - ## How to start your Spring Boot application -1. Go to start.spring.io -2. Fill in your settings. - - Create a Maven Project - - Pick Java - - Keep the version as the default - - Convention for Group ID name is the reverse of your domain name. - It identifies your project. Example: com.devdogs.schedulebuilder - - Convention for Artifact ID is lowercase letters with hyphens. - It should be the name of your project's artifact. Example: - optimal-schedule-builder. - -Package Name convention should be the same thing as your - group ID. - - Add Dependencies. These are a list of some relevant ones. - - Spring Web is essential for our projects. - - Spring Data JDBC allows us to connect to a SQL database. - - H2 database proved an In-Memory Database that can be - controlled through the browser. - - MySQL Driver allows java programs to connect to a MySQL database. - - There are SO many more. - - Select Jar packaging - - Select your Java version. -3. Generate and then extract the zip file. -4. Open your project with your IDE! +1. Go to start.spring.io +2. Fill in your settings: + - **Project**: Maven + - **Language**: Java + - **Version**: Default + - **Group ID**: Reverse of your domain name (e.g., `com.devdogs.schedulebuilder`) + - **Artifact ID**: Lowercase letters with hyphens (e.g., `optimal-schedule-builder`) + - **Package Name**: Same as Group ID + - **Dependencies**: + - Spring Web for this demo + - We will definitely use more for the project +3. Select Jar packaging and your Java version +4. Generate and extract the zip file +5. Open your project with your IDE + +> For this demo, I will be keeping everything as the default settings and adding Spring Web. + +> For this demo, I will be keeping everything as the default settings and adding Spring Web. ## How to implement a REST API -### Starting -Go to your SpringBootApplication class. THis should come by default. -Add @RestController above your class. Then you need to add a rest endpoint. This endpoint can be any method with the annotation @GetMapping above the class. +### Starting Your First Local Server! + +Go to your `SpringBootApplication` class. This should come by default. Add `@RestController` above your class. Then you need to add a REST endpoint. This endpoint can be any method with the annotation `@GetMapping` above the class. -Your code should look something like this +Your code should look something like this: -' +``` @SpringBootApplication @RestController public class DemoApplication { - public static void main(String[] args) { - SpringApplication.run(DemoApplication.class, args); + public static void main(String[] args) { + SpringApplication.run(DemoApplication.class, args); + } + + @GetMapping + public String hello() { + return "Hello World!"; + } +} +``` + +Now your server should be ready to run! All you need to do is hit run on your DemoApplication class and type in `localhost:8080`. + +### JSON Formatting + +We can return more than Strings. We will likely need to provide the frontend with a JSON at some point. This is how to make your Hello World! a JSON. + +> In order to do this you need to import `java.util.List`. + +` + @GetMapping + public List hello() { + return List.of("Hello", "World!"); } +` +## Returning a Custom Object +In this example we will create a student class to return. + +1. Create a new package for the student class `com.example.demo.student`. +2. Create a Student class and put in the class variables as well as basic methods (getters, setters, constructor, and toString(). I added ... +``` + private long id; + private String name; + private String email; + private LocalDate dob; + private Integer age; +``` +> Pro tip highlight the code above and hit the lightbulb to generate the getters, setters, and constructors on vscode. Use the code menu if you're on IntelliJ. + +Now we can change our endpoint to return a custom object. Change the `List` into a `List` in our demoApplication class. + +Replace the "Hello World!" Strings with a new Student. + +``` @GetMapping - public String hello() { - return "Hello World!"; + public List hello() { + return List.of( + new Student( + 1L, + "John", + "johnsmith@gmail.com", + LocalDate.of(2005, 1, 10), + 19 + ) + ); } +``` + +Awesome! Your output should look like a JSON of a student object. -} -' +## Sources: +This is the **[video where I obtained the example](https://www.youtube.com/watch?v=9SGDpanrc8U)**. -Sources: -https://www.javatpoint.com/spring-boot-tutorial \ No newline at end of file +**[This tutorial](https://www.javatpoint.com/spring-boot-tutorial)** showed me the benefits of using Spring Boot. From ca81fe655fedd0f01aa595226e151ad07fae36e3 Mon Sep 17 00:00:00 2001 From: KadeStyron Date: Sat, 14 Sep 2024 18:47:50 -0400 Subject: [PATCH 06/13] start student Controller class --- .vscode/settings.json | 4 ++++ backend/README.md | 44 ++++++++++++++++++++++++++++++++++++------- 2 files changed, 41 insertions(+), 7 deletions(-) create mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..36db945 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,4 @@ +{ + "ecl.launchConfiguration": "not found", + "ecl.targetCluster": {} +} \ No newline at end of file diff --git a/backend/README.md b/backend/README.md index c938be8..82bdec5 100644 --- a/backend/README.md +++ b/backend/README.md @@ -39,8 +39,6 @@ Spring Boot makes production-ready applications quickly and efficiently. It prov > For this demo, I will be keeping everything as the default settings and adding Spring Web. -> For this demo, I will be keeping everything as the default settings and adding Spring Web. - ## How to implement a REST API ### Starting Your First Local Server! @@ -71,15 +69,13 @@ Now your server should be ready to run! All you need to do is hit run on your De We can return more than Strings. We will likely need to provide the frontend with a JSON at some point. This is how to make your Hello World! a JSON. -> In order to do this you need to import `java.util.List`. - -` +``` @GetMapping public List hello() { return List.of("Hello", "World!"); } -` -## Returning a Custom Object +``` +## Returning an API In this example we will create a student class to return. 1. Create a new package for the student class `com.example.demo.student`. @@ -114,6 +110,40 @@ Replace the "Hello World!" Strings with a new Student. ``` Awesome! Your output should look like a JSON of a student object. +--- + +## API Layer Class + +Inside of using Demo Application create a StudentController.java class inside of the student file. +Move everything inside the getMapping annotation from DemoApplication to StudentController. Also move the @RestController annotation. + +Additionally add the code `@RequestMapping(path = "api/v1/student")` to try custom paths api calls. + +Finally change hello() to getStudents() since thats the correct nomenclature. + +New StudentController class: + + ``` + @RestController + @RequestMapping(path = "api/v1/student") + public class StudentController { + @GetMapping + public List getStudents() { + return List.of( + new Student( + 1L, + "John", + "johnsmith@gmail.com", + LocalDate.of(2005, 1, 10), + 19 + ) + ); + } + } + ``` + + + From 500a5e97635f90a6c09b3c0642ca28a2a327b23f Mon Sep 17 00:00:00 2001 From: KadeStyron Date: Tue, 17 Sep 2024 19:23:28 -0400 Subject: [PATCH 07/13] first rough draft --- backend/README.md | 157 -------------------- backend/SpringBoot/README.md | 277 +++++++++++++++++++++++++++++++++++ 2 files changed, 277 insertions(+), 157 deletions(-) delete mode 100644 backend/README.md create mode 100644 backend/SpringBoot/README.md diff --git a/backend/README.md b/backend/README.md deleted file mode 100644 index 82bdec5..0000000 --- a/backend/README.md +++ /dev/null @@ -1,157 +0,0 @@ -# Introduction to Spring Boot - -## Prerequisites - -This tutorial assumes that the reader has basic knowledge of Java and the structure of web applications. To learn more about Spring, you should view this Spring article. To best learn, follow along with the code examples. - -## What is Spring Boot - -Spring Boot is built on top of the Spring framework. It's used to set up, configure, and run web-based applications. Each Spring Boot application also contains an embedded HTTP server, which allows us to create our own API for the frontend to use. - -## Why use Spring Boot - -Spring Boot makes production-ready applications quickly and efficiently. It provides all of the features of Spring but is also easier to use. Everything is auto-configured in Spring Boot, minimizing the writing of boilerplate code and XML configurations. - -### Additional Spring Boot Advantages - -1. Connecting to databases -2. Spring Boot provides application metrics -3. There are security modules available -4. Easy to learn -5. So much more - -## How to start your Spring Boot application - -1. Go to start.spring.io -2. Fill in your settings: - - **Project**: Maven - - **Language**: Java - - **Version**: Default - - **Group ID**: Reverse of your domain name (e.g., `com.devdogs.schedulebuilder`) - - **Artifact ID**: Lowercase letters with hyphens (e.g., `optimal-schedule-builder`) - - **Package Name**: Same as Group ID - - **Dependencies**: - - Spring Web for this demo - - We will definitely use more for the project -3. Select Jar packaging and your Java version -4. Generate and extract the zip file -5. Open your project with your IDE - -> For this demo, I will be keeping everything as the default settings and adding Spring Web. - -## How to implement a REST API - -### Starting Your First Local Server! - -Go to your `SpringBootApplication` class. This should come by default. Add `@RestController` above your class. Then you need to add a REST endpoint. This endpoint can be any method with the annotation `@GetMapping` above the class. - -Your code should look something like this: - -``` -@SpringBootApplication -@RestController -public class DemoApplication { - - public static void main(String[] args) { - SpringApplication.run(DemoApplication.class, args); - } - - @GetMapping - public String hello() { - return "Hello World!"; - } -} -``` - -Now your server should be ready to run! All you need to do is hit run on your DemoApplication class and type in `localhost:8080`. - -### JSON Formatting - -We can return more than Strings. We will likely need to provide the frontend with a JSON at some point. This is how to make your Hello World! a JSON. - -``` - @GetMapping - public List hello() { - return List.of("Hello", "World!"); - } -``` -## Returning an API -In this example we will create a student class to return. - -1. Create a new package for the student class `com.example.demo.student`. - -2. Create a Student class and put in the class variables as well as basic methods (getters, setters, constructor, and toString(). I added ... -``` - private long id; - private String name; - private String email; - private LocalDate dob; - private Integer age; -``` -> Pro tip highlight the code above and hit the lightbulb to generate the getters, setters, and constructors on vscode. Use the code menu if you're on IntelliJ. - -Now we can change our endpoint to return a custom object. Change the `List` into a `List` in our demoApplication class. - -Replace the "Hello World!" Strings with a new Student. - -``` - @GetMapping - public List hello() { - return List.of( - new Student( - 1L, - "John", - "johnsmith@gmail.com", - LocalDate.of(2005, 1, 10), - 19 - ) - ); - } -``` - -Awesome! Your output should look like a JSON of a student object. ---- - -## API Layer Class - -Inside of using Demo Application create a StudentController.java class inside of the student file. -Move everything inside the getMapping annotation from DemoApplication to StudentController. Also move the @RestController annotation. - -Additionally add the code `@RequestMapping(path = "api/v1/student")` to try custom paths api calls. - -Finally change hello() to getStudents() since thats the correct nomenclature. - -New StudentController class: - - ``` - @RestController - @RequestMapping(path = "api/v1/student") - public class StudentController { - @GetMapping - public List getStudents() { - return List.of( - new Student( - 1L, - "John", - "johnsmith@gmail.com", - LocalDate.of(2005, 1, 10), - 19 - ) - ); - } - } - ``` - - - - - - - - - -## Sources: - -This is the **[video where I obtained the example](https://www.youtube.com/watch?v=9SGDpanrc8U)**. - -**[This tutorial](https://www.javatpoint.com/spring-boot-tutorial)** showed me the benefits of using Spring Boot. diff --git a/backend/SpringBoot/README.md b/backend/SpringBoot/README.md new file mode 100644 index 0000000..4a2b748 --- /dev/null +++ b/backend/SpringBoot/README.md @@ -0,0 +1,277 @@ +# Introduction to Spring Boot + +## Prerequisites + +This tutorial assumes that the reader has basic knowledge of Java and the structure of web applications. To learn more about Spring, you should view this Spring article. To best learn, follow along with the code examples. + +## What is Spring Boot + +Spring Boot is built on top of the Spring framework. It's used to set up, configure, and run web-based applications. Each Spring Boot application also contains an embedded HTTP server, which allows us to create our own API for the frontend to use. + +## Why use Spring Boot + +Spring Boot makes production-ready applications quickly and efficiently. It provides all of the features of Spring but is also easier to use. Everything is auto-configured in Spring Boot, minimizing the writing of boilerplate code and XML configurations. + +### Additional Spring Boot Advantages + +1. Connecting to databases +2. Spring Boot provides application metrics +3. There are security modules available +4. Easy to learn +5. So much more + +## How to start your Spring Boot application + +1. Go to start.spring.io +2. Fill in your settings: + - **Project**: Maven + - **Language**: Java + - **Version**: Default + - **Group ID**: Reverse of your domain name (e.g., `com.devdogs.schedulebuilder`) + - **Artifact ID**: Lowercase letters with hyphens (e.g., `optimal-schedule-builder`) + - **Package Name**: Same as Group ID + - **Dependencies**: + - Spring Web for this demo + - We will definitely use more for the project +3. Select Jar packaging and your Java version +4. Generate and extract the zip file +5. Open your project with your IDE + +> For this demo, I will be keeping everything as the default settings and adding Spring Web. + +## How to implement a REST API + +### Starting Your First Local Server! + +Go to your `SpringBootApplication` class. This should come by default. Add `@RestController` above your class. Then you need to add a REST endpoint. This endpoint can be any method with the annotation `@GetMapping` above the class. + +Your code should look something like this: + +``` +@SpringBootApplication +@RestController +public class DemoApplication { + + public static void main(String[] args) { + SpringApplication.run(DemoApplication.class, args); + } + + @GetMapping + public String hello() { + return "Hello World!"; + } +} +``` + +Now your server should be ready to run! All you need to do is hit run on your DemoApplication class and type in `localhost:8080`. + +### JSON Formatting + +We can return more than Strings. We will likely need to provide the frontend with a JSON at some point. This is how to make your Hello World! a JSON. + +``` + @GetMapping + public List hello() { + return List.of("Hello", "World!"); + } +``` +## Returning an API +In this example we will create a student class to return. + +1. Create a new package for the student class `com.example.demo.student`. + +2. Create a Student class and put in the class variables as well as basic methods (getters, setters, constructor, and toString(). I added ... +``` + private long id; + private String name; + private String email; + private LocalDate dob; + private Integer age; +``` +> Pro tip highlight the code above and hit the lightbulb to generate the getters, setters, and constructors on vscode. Use the code menu if you're on IntelliJ. + +Now we can change our endpoint to return a custom object. Change the `List` into a `List` in our demoApplication class. + +Replace the "Hello World!" Strings with a new Student. + +``` + @GetMapping + public List hello() { + return List.of( + new Student( + 1L, + "John", + "johnsmith@gmail.com", + LocalDate.of(2005, 1, 10), + 19 + ) + ); + } +``` + +Awesome! Your output should look like a JSON of a student object. +--- + +## API Layer Class + +Inside of using Demo Application create a StudentController.java class inside of the student file. +Move everything inside the getMapping annotation from DemoApplication to StudentController. Also move the @RestController annotation. + +Additionally add the code `@RequestMapping(path = "api/v1/student")` to try custom paths api calls. + +Finally change hello() to getStudents() since thats the correct nomenclature. + +New StudentController class: + +``` + @RestController + @RequestMapping(path = "api/v1/student") + public class StudentController { + @GetMapping + public List getStudents() { + return List.of( + new Student( + 1L, + "John", + "johnsmith@gmail.com", + LocalDate.of(2005, 1, 10), + 19 + ) + ); + } + } +``` + +Now when we run our demo application we can type `http://localhost:8080/api/v1/student` into our browser to get the same output. + +Why is this important: This lets the frontend call different methods from calling different links. This gives us much more flexibility with all of the information we'll send to frontend and makes it much more organized. + + +# Business/Service Layer + +This layer is responsible for holding all of our methods. We can put all of our methods like getStudents into a service class called StudentService. Since it is a Spring service annotate it with @Service. This will be important for dependency injections. + + +``` +@Service +public class StudentService { + + public List getStudents() { + return List.of( + new Student( + 1L, + "John", + "johnsmith@gmail.com", + LocalDate.of(2005, 1, 10), + 19 + ) + ); + } +} +``` + +Since we have our methods in here, studentController just has to read an input. create a new student service class and call the method like so. + +``` +@RestController +@RequestMapping(path = "api/v1/student") +public class StudentController { + + private final StudentService studentService; + + public StudentController(StudentService studentService) { + this.studentService = new StudentService(); + } + + @GetMapping + public List getStudents() { + return studentService.getStudents(); + } +} +``` + +This collection method of separating the Student, StudentService, and StudentController class is the best way to maintain an organized Spring Boot project. + +## Dependency Injection + +While `this.studentService = new StudentService();` works we should avoid using this approach and instead use dependency injections. Dependency injections are easier to test, and properly manages the lifecycle of `@Autowired` (annotation for dependency injection) objects. Spring handles the creation, initialization, and destruction of these objects so you don't need to manually do these things. + +Implementing dependency injections is really easy. Place the annotation @Autowired on top of the constructor and replace `this.studentService = new StudentService();` with `this.student = studentService;`. This will allow Spring to automatically instantiate the `@Component`s. + +> @Service is the same thing as @Component. It's used over component for semantics only. + + +## Using optional parameters + + An advantage of Spring Boot is it can read variables in the URL it is given. For example if we want to get certain students instead of all of our students we can use this modified Student controller getStudents() to filter our students collected if we want. + + @RequestParam is used to define query parameters. required = false makes these parameters optional. If an optional parameter is not provided it will default to null. + + ``` + @GetMapping + public List getStudents( + @RequestParam(required = false) String name, + @RequestParam(required = false) Integer age) { + return studentService.getStudents(name, age); + } + ``` + + For the example modify your Student service to the following. This is just to show the example, you don't need to know how every method works. + + ``` + private List students = List.of( + new Student(1L, "John", "johnsmith@gmail.com", LocalDate.of(2005, 1, 10), 19), + new Student(2L, "Jane", "janedoe@gmail.com", LocalDate.of(2003, 5, 15), 21), + new Student(3L, "Mike", "mikejones@gmail.com", LocalDate.of(2004, 8, 20), 20) + ); + + public List getStudents(String name, Integer age) { + return students.stream() + .filter(student -> (name == null || student.getName().equalsIgnoreCase(name)) && + (age == null || student.getAge().equals(age))) + .collect(Collectors.toList()); + } + ``` + +This shows how you can use optional variables to get different data. Use these examples to try it out. + + +http://localhost:8080/api/v1/student should return all students. +http://localhost:8080/api/v1/student?name=John should return all students named John. +http://localhost:8080/api/v1/student?age=20 should return all 20 year old students. +http://localhost:8080/api/v1/student?name=Jane&age=21 should return all 21 year old students named Jane. + +If these examples don't work you may need to edit your xml file. Try adding this in your build section. + +``` + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + true + + + +``` + + +--- + +There's so much more to Spring Boot, especially for database access and management. For our project we will have a team devoted to this so it is not currently needed. I will update this tutorial if needed, but feel free to update/edit this document on our DevDogs Academy repository! + + + + + + + + +## Sources: + +This is the **[video where I obtained the example](https://www.youtube.com/watch?v=9SGDpanrc8U)**. + +**[This tutorial](https://www.javatpoint.com/spring-boot-tutorial)** showed me the benefits of using Spring Boot. + +https://start.spring.io/ is the initializer for spring. \ No newline at end of file From 4dbf43f5d6b091c149bf833b7c81656849938b26 Mon Sep 17 00:00:00 2001 From: KadeStyron Date: Tue, 17 Sep 2024 19:26:47 -0400 Subject: [PATCH 08/13] removed .vscode --- .vscode/settings.json | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index 36db945..0000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "ecl.launchConfiguration": "not found", - "ecl.targetCluster": {} -} \ No newline at end of file From 0b1e9d3ff3f4ed8b1ca3cbc557570326543fa0f9 Mon Sep 17 00:00:00 2001 From: KadeStyron Date: Tue, 17 Sep 2024 19:31:21 -0400 Subject: [PATCH 09/13] fixed formatting issues --- backend/SpringBoot/README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/backend/SpringBoot/README.md b/backend/SpringBoot/README.md index 4a2b748..43fed2d 100644 --- a/backend/SpringBoot/README.md +++ b/backend/SpringBoot/README.md @@ -196,7 +196,7 @@ This collection method of separating the Student, StudentService, and StudentCon While `this.studentService = new StudentService();` works we should avoid using this approach and instead use dependency injections. Dependency injections are easier to test, and properly manages the lifecycle of `@Autowired` (annotation for dependency injection) objects. Spring handles the creation, initialization, and destruction of these objects so you don't need to manually do these things. -Implementing dependency injections is really easy. Place the annotation @Autowired on top of the constructor and replace `this.studentService = new StudentService();` with `this.student = studentService;`. This will allow Spring to automatically instantiate the `@Component`s. +Implementing dependency injections is really easy. Place the annotation @Autowired on top of the constructor and replace `this.studentService = new StudentService();` with `this.student = studentService;`. This will allow Spring to automatically instantiate the @Components. > @Service is the same thing as @Component. It's used over component for semantics only. @@ -236,10 +236,10 @@ Implementing dependency injections is really easy. Place the annotation @Autowir This shows how you can use optional variables to get different data. Use these examples to try it out. -http://localhost:8080/api/v1/student should return all students. -http://localhost:8080/api/v1/student?name=John should return all students named John. -http://localhost:8080/api/v1/student?age=20 should return all 20 year old students. -http://localhost:8080/api/v1/student?name=Jane&age=21 should return all 21 year old students named Jane. +http://localhost:8080/api/v1/student should return all students. \\ +http://localhost:8080/api/v1/student?name=John should return all students named John. \\ +http://localhost:8080/api/v1/student?age=20 should return all 20 year old students. \\ +http://localhost:8080/api/v1/student?name=Jane&age=21 should return all 21 year old students named Jane. \\ If these examples don't work you may need to edit your xml file. Try adding this in your build section. @@ -270,8 +270,8 @@ There's so much more to Spring Boot, especially for database access and manageme ## Sources: -This is the **[video where I obtained the example](https://www.youtube.com/watch?v=9SGDpanrc8U)**. +This is the **[video where I obtained the example](https://www.youtube.com/watch?v=9SGDpanrc8U)**. \\ -**[This tutorial](https://www.javatpoint.com/spring-boot-tutorial)** showed me the benefits of using Spring Boot. +**[This tutorial](https://www.javatpoint.com/spring-boot-tutorial)** showed me the benefits of using Spring Boot. \\ https://start.spring.io/ is the initializer for spring. \ No newline at end of file From d8ba98bb8b9435d8364ee5819f851e25b715007f Mon Sep 17 00:00:00 2001 From: KadeStyron Date: Tue, 17 Sep 2024 19:39:03 -0400 Subject: [PATCH 10/13] tried to alter code block for optional parameters section --- backend/SpringBoot/README.md | 106 +++++++++++++++++------------------ 1 file changed, 53 insertions(+), 53 deletions(-) diff --git a/backend/SpringBoot/README.md b/backend/SpringBoot/README.md index 43fed2d..8f0870f 100644 --- a/backend/SpringBoot/README.md +++ b/backend/SpringBoot/README.md @@ -88,25 +88,25 @@ In this example we will create a student class to return. private LocalDate dob; private Integer age; ``` -> Pro tip highlight the code above and hit the lightbulb to generate the getters, setters, and constructors on vscode. Use the code menu if you're on IntelliJ. +> Pro tip, highlight the code above and hit the lightbulb to generate the getters, setters, and constructors on vscode. Use the code menu if you're on IntelliJ. Now we can change our endpoint to return a custom object. Change the `List` into a `List` in our demoApplication class. Replace the "Hello World!" Strings with a new Student. ``` - @GetMapping - public List hello() { - return List.of( - new Student( - 1L, - "John", - "johnsmith@gmail.com", - LocalDate.of(2005, 1, 10), - 19 - ) - ); - } +@GetMapping +public List hello() { + return List.of( + new Student( + 1L, + "John", + "johnsmith@gmail.com", + LocalDate.of(2005, 1, 10), + 19 + ) + ); +} ``` Awesome! Your output should look like a JSON of a student object. @@ -124,22 +124,22 @@ Finally change hello() to getStudents() since thats the correct nomenclature. New StudentController class: ``` - @RestController - @RequestMapping(path = "api/v1/student") - public class StudentController { - @GetMapping - public List getStudents() { - return List.of( - new Student( - 1L, - "John", - "johnsmith@gmail.com", - LocalDate.of(2005, 1, 10), - 19 - ) - ); - } +@RestController +@RequestMapping(path = "api/v1/student") +public class StudentController { + @GetMapping + public List getStudents() { + return List.of( + new Student( + 1L, + "John", + "johnsmith@gmail.com", + LocalDate.of(2005, 1, 10), + 19 + ) + ); } +} ``` Now when we run our demo application we can type `http://localhost:8080/api/v1/student` into our browser to get the same output. @@ -203,35 +203,35 @@ Implementing dependency injections is really easy. Place the annotation @Autowir ## Using optional parameters - An advantage of Spring Boot is it can read variables in the URL it is given. For example if we want to get certain students instead of all of our students we can use this modified Student controller getStudents() to filter our students collected if we want. +An advantage of Spring Boot is it can read variables in the URL it is given. For example if we want to get certain students instead of all of our students we can use this modified Student controller getStudents() to filter our students collected if we want. - @RequestParam is used to define query parameters. required = false makes these parameters optional. If an optional parameter is not provided it will default to null. +@RequestParam is used to define query parameters. required = false makes these parameters optional. If an optional parameter is not provided it will default to null. - ``` - @GetMapping - public List getStudents( - @RequestParam(required = false) String name, - @RequestParam(required = false) Integer age) { - return studentService.getStudents(name, age); - } - ``` - - For the example modify your Student service to the following. This is just to show the example, you don't need to know how every method works. +``` +@GetMapping +public List getStudents( + @RequestParam(required = false) String name, + @RequestParam(required = false) Integer age) { + return studentService.getStudents(name, age); +} +``` - ``` - private List students = List.of( - new Student(1L, "John", "johnsmith@gmail.com", LocalDate.of(2005, 1, 10), 19), - new Student(2L, "Jane", "janedoe@gmail.com", LocalDate.of(2003, 5, 15), 21), - new Student(3L, "Mike", "mikejones@gmail.com", LocalDate.of(2004, 8, 20), 20) - ); +For the example modify your Student service to the following. This is just to show the example, you don't need to know how every method works. - public List getStudents(String name, Integer age) { - return students.stream() - .filter(student -> (name == null || student.getName().equalsIgnoreCase(name)) && - (age == null || student.getAge().equals(age))) - .collect(Collectors.toList()); - } - ``` +``` + private List students = List.of( + new Student(1L, "John", "johnsmith@gmail.com", LocalDate.of(2005, 1, 10), 19), + new Student(2L, "Jane", "janedoe@gmail.com", LocalDate.of(2003, 5, 15), 21), + new Student(3L, "Mike", "mikejones@gmail.com", LocalDate.of(2004, 8, 20), 20) +); + +public List getStudents(String name, Integer age) { + return students.stream() + .filter(student -> (name == null || student.getName().equalsIgnoreCase(name)) && + (age == null || student.getAge().equals(age))) + .collect(Collectors.toList()); +} +``` This shows how you can use optional variables to get different data. Use these examples to try it out. From f498ece475220a9a6a8d19f2f53491c7741b9c3b Mon Sep 17 00:00:00 2001 From: KadeStyron Date: Sun, 13 Oct 2024 17:21:49 -0400 Subject: [PATCH 11/13] first draft --- career/ResumeInclusion.md | 49 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 career/ResumeInclusion.md diff --git a/career/ResumeInclusion.md b/career/ResumeInclusion.md new file mode 100644 index 0000000..e8784e4 --- /dev/null +++ b/career/ResumeInclusion.md @@ -0,0 +1,49 @@ +## Including DevDogs on Your Resume + +When adding your involvement with **DevDogs**, it's essential to use a well-structured resume format that clearly communicates your skills and experience. A good resume template can make your accomplishments stand out, especially when it comes to open-source contributions and teamwork in tech-related clubs. + +### Start with a Strong Resume Template + +A strong resume template ensures your information is presented cleanly and professionally. If you're unsure where to find one, a great resource is the [UGA Career Center's Technical Resume](https://career.uga.edu/resume_examples). This template is pretty standard and designed to highlight your technical skills while maintaining a clean, readable format. Additionally, OverLeaf has a bunch of good [templates](https://www.overleaf.com/gallery/tagged/cv) you can browse through. + + + +### Quantify Your Impact + +DevDogs gives out contribution points and leader board spots which provides great quantitative statistics. For example, "Ranked #3 on the DevDogs contribution leader board for the 2024 project, **UGA Optimized Schedule Builder**, by contributing 200+ lines of code and resolving 10 issues." Quantifying your contributions gives a clearer picture of the value you’ve brought to the project and stands out to employers. + +### Example + +Here's a modified section of Tony Technology's resume assuming they were in frontend + +DevDogs - Google Developer Group, University of Georgia +August 2024 – Present + +- Worked on the frontend of the UGA Optimized Schedule Builder, building intuitive and responsive user interfaces using React. +- Collaborated with design teams to ensure the app provided an optimized user experience for students. +- Contributed to the codebase by implementing [insert components you contributed towards] +- Regularly participated in team meetings to ensure alignment with backend development and overall project goals. + +Here's one if Tony worked towards multiple groups + +Database & Backend Developer +DevDogs - Google Developer Group, University of Georgia +January 2024 – Present + + +Here’s the updated section focusing on the backend and database work using Spring Boot and Spring JPA: + +Database & Backend Developer +DevDogs - Google Developer Group, University of Georgia +January 2024 – Present + +- Developed and maintained the backend of the UGA Optimized Schedule Builder using Spring Boot for the application framework. +- Utilized Spring JPA to design and manage the relational database, optimizing data retrieval for the scheduling engine. +- Implemented key backend services, ensuring smooth integration with the frontend and efficient processing of scheduling algorithms. +- Worked using a sprint system to implement a variety of microservices + + + + + + From 76447dbd77e6b33efaa0de2e19b299822bc45c16 Mon Sep 17 00:00:00 2001 From: KadeStyron Date: Sun, 13 Oct 2024 18:04:28 -0400 Subject: [PATCH 12/13] added pitch inclusion --- career/InclusionInPitch.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 career/InclusionInPitch.md diff --git a/career/InclusionInPitch.md b/career/InclusionInPitch.md new file mode 100644 index 0000000..7de9d65 --- /dev/null +++ b/career/InclusionInPitch.md @@ -0,0 +1,20 @@ +## Including DevDogs in your Elevator Pitch + +### What is an Elevator Pitch? + +An elevator pitch is your introduction for a company. It is generally used at networking events or some interviews. The UGA Career Center has some great [examples](https://career.uga.edu/introducing_yourself_to_an_employer#:~:text=%E2%80%9CHello%2C%20my%20name%20is%20(,the%20(position%2Frole).). + +### What to include in your DevDogs elevator pitch + +1. Highlight Your Role and Project +Mention your specific role within the project. Include what position/role you have and what the project is. + +2. Showcase Skills and Tools +Talk about what technologies, frameworks, and languages you use in your role. + +3. Emphasize Impact and spread +Tell the employers why the project is important. An example would be this project is aimed at revolutionizing the class registering process for thousands of UGA students and academic advisors. + +### Example + +"Hi, my name is [Your Name]. I'm a [1st/2nd/3rd/4th year] Computer Science major, and I’m currently looking for a [full-time/internship] position in software development. I’ve been a [Frontend Developer/Database & Backend Developer] for DevDogs, a Google Developer Group on campus. I’m working on the UGA Optimized Schedule Builder, which uses React and Spring Boot/Spring JPA to help students optimize their course schedules. This project is designed to improve the scheduling process for thousands of UGA students and advisors, making course registration easier and more efficient." \ No newline at end of file From f246fd55507d4b7f5fc799b21fd1922ade000fb7 Mon Sep 17 00:00:00 2001 From: KadeStyron Date: Sun, 13 Oct 2024 18:31:18 -0400 Subject: [PATCH 13/13] StandingOut --- career/StandingOut.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 career/StandingOut.md diff --git a/career/StandingOut.md b/career/StandingOut.md new file mode 100644 index 0000000..9be0ec4 --- /dev/null +++ b/career/StandingOut.md @@ -0,0 +1,26 @@ +## Standing Out in the CS Field + +In the field of computer science, it's essential to go beyond technical proficiency to distinguish yourself from others. Here are some strategies to stand out: + +### 1. Learn Relevant Tools + DevDogs’ mission is to equip members with industry-standard tools to ensure you're prepared for real-world challenges. Learning the tools in class is not enough and their's always a more efficient method. + + +### 2. Emphasize Problem-Solving and Collaboration + Employers value teamwork and problem-solving skills as much as coding ability. Share how you’ve collaborated with others to solve tough challenges. Use DevDogs projects, you have worked with a diverse group to overcome technical and group-work hurdles, turning obstacles into learning experiences. These stories show employers you’re not just technically proficient but also a strong team player. + +### 3. Highlight Leadership Opportunities + Leadership experience, even on small-scale projects, can be a huge differentiator. At DevDogs we want to give as many leadership positions as possible, while giving them experience to mention. You could mention specific situations like resolving team conflicts or making pivotal technical decisions. + +### 4. Leverage Recognition from DevDogs + Becoming **Member of the Week** is another great way to stand out. This title spotlights your contributions, which are shared on DevDogs' social media platforms like Instagram and LinkedIn. You can repost this recognition on your own social profiles, providing direct proof of your achievements to employers. + + +### 5. Expand Your Network + Take advantage of the professional community that comes with being part of DevDogs, everyone here is motivated enough to go beyond a classroom setting and has potential to do great things. Connecting with these members has the potential to increase your opportunities in the future. Additionally, as a GDGC we will be able to host meetings with Google which gives you the opportunity to connect with a professional in the field. + +### 7. Be Ready to Discuss Projects in Detail + Employers love to hear about practical, tangible projects. Be ready to go beyond just listing projects on your resume. Dive into the technical challenges you faced and how you overcame them. Employers will want to hear how you used and learned various tools to create or optimize some part of the project. + +### Conclusion +By building a strong technical foundation, contributing to real-world projects like DevDogs, highlighting leadership and teamwork, and leveraging recognition, you’ll set yourself apart in the CS field. Use these strategies in interviews and elevator pitches to leave a lasting impression on potential employers.