diff --git a/api.json b/api.json new file mode 100644 index 0000000..fa9b858 --- /dev/null +++ b/api.json @@ -0,0 +1,98 @@ +[ + { + "id": 849, + "question": "How to remove the docker container with container id mentioned in the command.", + "description": null, + "answers": { + "answer_a": "$ docker rm -rf 9b6343d3b5a0", + "answer_b": "$ docker -rm rf 9b6343d3b5a0", + "answer_c": "$ docker rm 9b6343d3b5a0", + "answer_d": null, + "answer_e": null, + "answer_f": null + }, + "multiple_correct_answers": "false", + "correct_answers": { + "answer_a_correct": "false", + "answer_b_correct": "false", + "answer_c_correct": "true", + "answer_d_correct": "false", + "answer_e_correct": "false", + "answer_f_correct": "false" + }, + "correct_answer": "answer_a", + "explanation": null, + "tip": null, + "tags": [ + { + "name": "Docker" + } + ], + "category": "Docker", + "difficulty": "Easy" + }, + { + "id": 26, + "question": "What is a daemon?", + "description": null, + "answers": { + "answer_a": "It is a generic name for e-mail servers on Linux. The most famous one is mailer-daemon", + "answer_b": "It is a program that keeps running on the background after it is called, answering to requests done by users and other programs.", + "answer_c": "It is an antivirus for Linux.", + "answer_d": "It is the generic name for any Linux server.", + "answer_e": null, + "answer_f": null + }, + "multiple_correct_answers": "false", + "correct_answers": { + "answer_a_correct": "false", + "answer_b_correct": "true", + "answer_c_correct": "false", + "answer_d_correct": "false", + "answer_e_correct": "false", + "answer_f_correct": "false" + }, + "correct_answer": "answer_b", + "explanation": null, + "tip": null, + "tags": [ + { + "name": "Linux" + } + ], + "category": "Linux", + "difficulty": "Medium" + }, + { + "id": 627, + "question": "How can we set infinite execution time for a PHP script?", + "description": null, + "answers": { + "answer_a": "Add set_time_limit() at the beginning of a script", + "answer_b": "Add set_time_limit(infinity) at the beginning of a script", + "answer_c": "Add set_time_limit(0) at the beginning of a script", + "answer_d": null, + "answer_e": null, + "answer_f": null + }, + "multiple_correct_answers": "false", + "correct_answers": { + "answer_a_correct": "false", + "answer_b_correct": "false", + "answer_c_correct": "true", + "answer_d_correct": "false", + "answer_e_correct": "false", + "answer_f_correct": "false" + }, + "correct_answer": "answer_a", + "explanation": null, + "tip": null, + "tags": [ + { + "name": "PHP" + } + ], + "category": "Code", + "difficulty": "Medium" + } + ] \ No newline at end of file diff --git a/build.gradle b/build.gradle index 71840fc..0e73eff 100644 --- a/build.gradle +++ b/build.gradle @@ -13,16 +13,18 @@ repositories { } dependencies { - // implementation 'org.springframework.boot:spring-boot-starter-data-jpa' - // implementation 'org.springframework.boot:spring-boot-starter-security' + implementation 'org.springframework.boot:spring-boot-starter-data-jpa' + implementation 'org.springframework.boot:spring-boot-starter-security' implementation 'org.springframework.boot:spring-boot-starter-thymeleaf' implementation 'org.springframework.boot:spring-boot-starter-web' implementation 'org.springframework.boot:spring-boot-starter-websocket' - // implementation 'org.thymeleaf.extras:thymeleaf-extras-springsecurity5' + implementation 'org.thymeleaf.extras:thymeleaf-extras-springsecurity5' developmentOnly 'org.springframework.boot:spring-boot-devtools' runtimeOnly 'org.postgresql:postgresql' testImplementation 'org.springframework.boot:spring-boot-starter-test' - // testImplementation 'org.springframework.security:spring-security-test' + testImplementation 'org.springframework.security:spring-security-test' + implementation 'com.google.code.gson:gson:2.8.8' + implementation 'com.googlecode.json-simple:json-simple:1.1.1' } test { diff --git a/json.json b/json.json new file mode 100644 index 0000000..5656071 --- /dev/null +++ b/json.json @@ -0,0 +1,115 @@ +[ + { + "id": 1, + "school": "Donald Bren School of Information and Computer Sciences", + "title": "Interactive Technology Studio", + "course_level": "Graduate/Professional Only (200+)", + "description": "Technologies, languages, and skills required for creating prototypes to communicate interactive technology concepts. Topics include HTTP, CSS, CSS scripting, AJAX, Design Patterns, Javascript, Javascript libraries such as jQuery, SQL, MVC, and cloud architectures.", + "image":"https://united-pop.com/website/var/tmp/image-thumbnails/0/3214/thumb__diplomaCourseDetail/interactive_audio_designer~-~480w.jpeg"}, + { + "id": 2, + + "school": "Donald Bren School of Information and Computer Sciences", + "title": "Programming in Java as a Second Language", + "course_level": "Lower Division (1-99)", + + "description": "An introduction to the lexical, syntactic, semantic, and pragmatic characteristics of the Java language for experienced programmers. Emphasis on object-oriented programming, using standard libraries, and programming with automatic garbage collection.", + "image":"https://miro.medium.com/max/750/1*HuoU7i1AIvkUSApmIx8XQw.png"}, + { + "id": 3, + + "school": "Donald Bren School of Information and Computer Sciences", + "title": "Computer Game Development", + "course_level": "Graduate/Professional Only (200+)", + + "description": "Introduction to the principles of interactive 2D and 3D computer game development. Concepts in computer graphics, algorithms, software engineering, art and graphics, music and sound, story analysis, and artificial intelligence are presented and are the basis for student work.", +"image":"https://images.ctfassets.net/3s5io6mnxfqz/32WnMVURX2H9rRiNA1qbsg/a93ccb573ad78895d20bccbfdeece606/AdobeStock_345938875.jpeg?fm=jpg&w=900&fl=progressive"}, + { + "id": 4, + + "school": "Donald Bren School of Information and Computer Sciences", + "title": "Artificial Intelligence in Biology and Medicine", + "course_level": "Upper Division (100-199)", + + "description": "Introduction to computational methods in molecular biology, aimed at those interested in learning about this interdisciplinary area. Covers computational approaches to understanding and predicting the structure, function, interactions, and evolution of DNA, RNA, proteins, and related molecules and processes.", + "image" : "https://th.bing.com/th/id/OIP.5snHE-VIA-roO_oqBZDjswHaE8?pid=ImgDet&rs=1" + }, + { + "id": 5, + + "school": "Donald Bren School of Information and Computer Sciences", + "title": "Digital Image Processing", + "course_level": "Upper Division (100-199)", + + "description": "Introduction to the fundamental concepts of digital signal and image processing as applicable in areas such as multimedia, graphics, AI, data mining, databases, vision, or video games. Topics include image representation, space- and frequency-domain transformations, filters, segmentation, and compression.", + "image" : "https://online.stanford.edu/sites/default/files/styles/figure_default/public/2018-03/ee_digitalimageprocessing_ee368.jpg?itok=S2vGmtU4" + }, + { + "id": 6, + + "school": "School of Physical Sciences", + "title": "Advanced Data Acquisition and Analysis", + "course_level": "Graduate/Professional Only (200+)", + + "description": "Introduces students to a variety of practical laboratory techniques, including lock-in, boxcar, coincidence counting, noise filtering, PID control, properties of common transducers, computer interfacing to instruments, vacuum technology, laboratory safety, basic mechanical design, and shop skills. Materials fee.", + "image" : "https://learn.g2.com/hubfs/what-is-advanced-analytics.jpg" + }, + { + "id": 7, + + "school": "Donald Bren School of Information and Computer Sciences", + "title": "Artificial Intelligence Frontiers: Technical, Ethical, and Societal", + "course_level": "Upper Division (100-199)", + + "description": "Explores the frontiers of artificial intelligence and related technologies with a focus on the underlying ethical, legal, and societal challenges and opportunities they create. Encourages critical thinking about these issues.", + "image" : "https://www.insurancejournal.com/app/uploads/2016/01/ethics-580x580.jpg" + }, + { + "id": 8, + + "school": "The Henry Samueli School of Engineering", + "title": "Biomedical Big Data", + "course_level": "Graduate/Professional Only (200+)", + + "description": "Analysis and visualization of large biomedical datasets. Topics covered include cloud computing, learning Structured Query Language (SQL), database normalization and joins, using Google’s BigQuery, using the statistical analysis package R, machine learning algorithms, application of machine learning for classification problems.", + "image" : "https://prod-discovery.edx-cdn.org/media/course/image/63f8ec13-8c6b-4c70-b380-3f95e56a21f6-d8de3c31749c.small.jpg" + }, + { + "id": 9, + + "school": "Donald Bren School of Information and Computer Sciences", + "title": "Network Security", + "course_level": "Graduate/Professional Only (200+)", + + "description": "Introduction to network security, including network threats and attacks, as well as defenses against such attacks. Topics include network infrastructure security, mobile and Wi-Fi security, spam, phishing, firewalls, anonymity, secure email, secure and private cloud computing, and web security.", + "image" : "https://images.anytask.com/resources/user/07b908f2cd365eec/task/1604585232973_secure.png"}, + { + "id":10 , + + "school": "Donald Bren School of Information and Computer Sciences", + "title": "Realistic Image Synthesis", + "course_level": "Graduate/Professional Only (200+)", + + "description": "Provides an in-depth overview on a core sub-field of computer graphics. Graduate students who take this course are better prepared for conducting research on the related topics in computer graphics, vision, and scientific computing.", + "image" : "https://pbs.twimg.com/media/DVZtj_GUQAAv6mp.jpg" + }, + { + "id": 11, + + "school": "The Henry Samueli School of Engineering", + "title": "Introduction to Programming", + "course_level": "Lower Division (1-99)", + "description": "An introduction to computers and programming. Python programming syntax/style, types. Numbers and sequences. Control flow. I/O and errors/exceptions. Function calling, parameter passing, formal arguments, return values. Variable scoping. Programming laboratory.", + "image" : "https://www.tuni.fi/sites/default/files/styles/base_landscape_lg/public/media/image/jop_pow_koodaus.png?itok=MbIrLPrF" + }, + { + "id": 12, + "school": "Donald Bren School of Information and Computer Sciences", + "title": "Project in Databases and Web Applications", + "course_level": "Upper Division (100-199)", + + "description": "Introduces students to advanced database technologies and Web applications. Topics include database connectivity (ODBC/JDBC), extending databases using stored procedures, database administration, Web servers, Web programming languages (Java servlets, XML, Ajax, and mobile platforms).", + "image" : "https://www.midaswebtech.com/wp-content/themes/midas_it/images/web-development.gif" + } + +] \ No newline at end of file diff --git a/recentquotes.json b/recentquotes.json new file mode 100644 index 0000000..fa6c1bc --- /dev/null +++ b/recentquotes.json @@ -0,0 +1 @@ +{"quoteText":"A lot of people give up just before theyre about to make it. You know you never know when that next obstacle is going to be the last one. ", "quoteAuthor":"Chuck Norris", "senderName":"", "senderLink":"", "quoteLink":"http://forismatic.com/en/2bc6cf0fd5/"} \ No newline at end of file diff --git a/src/main/java/com/example/init/InitApplication.java b/src/main/java/com/example/init/InitApplication.java index 365f755..400e74e 100644 --- a/src/main/java/com/example/init/InitApplication.java +++ b/src/main/java/com/example/init/InitApplication.java @@ -8,6 +8,7 @@ public class InitApplication { public static void main(String[] args) { SpringApplication.run(InitApplication.class, args); + } } diff --git a/src/main/java/com/example/init/controllers/CourseController.java b/src/main/java/com/example/init/controllers/CourseController.java new file mode 100644 index 0000000..32b6bbb --- /dev/null +++ b/src/main/java/com/example/init/controllers/CourseController.java @@ -0,0 +1,30 @@ +package com.example.init.controllers; + +import com.example.init.models.Courses; +import com.google.gson.Gson; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.GetMapping; + +import java.io.FileReader; +import java.lang.reflect.Type; +import java.util.List; + +@Controller +public class CourseController { + + @GetMapping("/courses") + public String getCourses(Model model) throws Exception { + + Gson gson = new Gson(); + JsonReader reader = new JsonReader(new FileReader( + "json.json")); + Type jsonCasting = new TypeToken>() { + }.getType(); + List jsonList = gson.fromJson(reader, jsonCasting); + model.addAttribute("courses", jsonList); + return "courses"; + } +} diff --git a/src/main/java/com/example/init/controllers/QuizController.java b/src/main/java/com/example/init/controllers/QuizController.java new file mode 100644 index 0000000..2681886 --- /dev/null +++ b/src/main/java/com/example/init/controllers/QuizController.java @@ -0,0 +1,62 @@ +package com.example.init.controllers; + +import com.example.init.models.Quiz; +import com.example.init.models.ResultsQuiz; +import com.example.init.repositories.CodersRepository; +import com.example.init.repositories.ResultsRepo; + +import com.google.gson.Gson; +import com.google.gson.reflect.TypeToken; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.lang.reflect.Type; +import java.net.HttpURLConnection; +import java.net.URL; +import java.security.Principal; +import java.util.List; + +@Controller +public class QuizController { + + @Autowired + ResultsRepo resultsRepo; + @Autowired + CodersRepository codersRepository; + + @GetMapping("/quiz") + public String getQuiz(Model model) throws IOException { + Gson gson = new Gson(); + String urlApi = "https://quizapi.io/api/v1/questions?apiKey=phkL2Z69NDCrImLlfnLoElQkoF3StoJlQrAeKvkf&limit=10&css"; + HttpURLConnection connection = (HttpURLConnection) new URL(urlApi).openConnection(); + InputStreamReader inputStreamReader = new InputStreamReader(connection.getInputStream()); + BufferedReader bufferedReader = new BufferedReader(inputStreamReader); + String data = bufferedReader.readLine(); + Type jsonCasting = new TypeToken>() { + }.getType(); + List jsonList = gson.fromJson(data, jsonCasting); + model.addAttribute("quiz", jsonList); + bufferedReader.close(); + return "quiz"; + } + + @PostMapping("/submit") + public String submit(Model model, Principal principal) { + ResultsQuiz resultsQuiz = new ResultsQuiz(); + // ApplicationUser applicationUser = new ApplicationUser(); + Quiz quiz = new Quiz(); + // resultsQuiz.setTotalCorrect(quiz.getAnswers()); + resultsQuiz.setUsername(codersRepository.findByUsername(principal.getName())); + resultsQuiz.setTotalCorrect(resultsQuiz.getTotalCorrect()); + model.addAttribute("quiz", resultsRepo.save(resultsQuiz)); + return "result"; + + } + +} diff --git a/src/main/java/com/example/init/controllers/User.java b/src/main/java/com/example/init/controllers/User.java new file mode 100644 index 0000000..1e771d2 --- /dev/null +++ b/src/main/java/com/example/init/controllers/User.java @@ -0,0 +1,169 @@ +package com.example.init.controllers; + +import com.example.init.models.Coders; +import com.example.init.models.Comment; +import com.example.init.models.Post; +import com.example.init.repositories.CodersRepository; +import com.example.init.repositories.CommentRepository; +import com.example.init.repositories.ContentRepository; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; +import org.springframework.security.core.Authentication; +import org.springframework.security.core.annotation.AuthenticationPrincipal; +import org.springframework.security.core.context.SecurityContextHolder; +import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.ModelAttribute; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.servlet.view.RedirectView; + +import java.security.Principal; +import java.util.ArrayList; +import java.util.List; +import java.util.Set; + +import javax.transaction.Transactional; + +@Controller +public class User { + + @Autowired + BCryptPasswordEncoder bCryptPasswordEncoder; + + @Autowired + CodersRepository codersRepository; + + @Autowired + ContentRepository contentRepository; + + @Autowired + CommentRepository commentRepository; + + @GetMapping("/signup") + public String getSignUpPage() { + return "signup"; + } + + @GetMapping("/login") + public String getSignInPage() { + return "login"; + } + + @PostMapping("/signup") + public RedirectView attemptSignUp(@ModelAttribute Coders user) { + Coders newUser = new Coders(user.getEmail(), user.getUsername(), + bCryptPasswordEncoder.encode(user.getPassword()), user.getFirstName(), user.getLastName(), + user.getDateOfBirth(), user.getBio()); + codersRepository.save(newUser); + Authentication authentication = new UsernamePasswordAuthenticationToken(user, null, new ArrayList<>()); + SecurityContextHolder.getContext().setAuthentication(authentication); + return new RedirectView("/login"); + } + + @PostMapping("/login") + public RedirectView loginResponse(@ModelAttribute Coders user, Model model) { + model.addAttribute("username", codersRepository.findByUsername(user.getUsername())); + return new RedirectView("profile"); + } + + @GetMapping("/profile") + public String getUserProfile(Principal principal, Model model) { + Coders user = codersRepository.findByUsername(principal.getName()); + model.addAttribute("username", principal.getName()); + model.addAttribute("userProfile", user); + return "profile"; + } + + @PostMapping("/addPost") + public RedirectView addPost(Principal principle, String body) { + Coders newUser = codersRepository.findByUsername(principle.getName()); + Post post = new Post(newUser, body); + contentRepository.save(post); + return new RedirectView("/profile"); + } + + @GetMapping("/user") + public String profile(@RequestParam long id, Model model, Principal principal) { + Coders user = codersRepository.findById(id).get(); + model.addAttribute("username", user.getUsername()); + model.addAttribute("userProfile", user); + model.addAttribute("logged", ((UsernamePasswordAuthenticationToken) principal).getPrincipal()); + return "user"; + } + + @GetMapping("/users") + public String getUsers(Model model, Principal principal) { + List users = codersRepository.findAll(); + model.addAttribute("allusers", users); + Coders user = codersRepository.findByUsername(principal.getName()); + model.addAttribute("username", user.getUsername()); + return "users"; + } + + @PostMapping("/follow") + public RedirectView followUser(@AuthenticationPrincipal Coders user, @RequestParam Long id) { + Coders feed = codersRepository.findByUsername(user.getUsername()); + Coders follow = codersRepository.findById(id).get(); + feed.getFollowers().add(follow); + codersRepository.save(feed); + return new RedirectView("/feed"); + } + + @GetMapping("/feed") + public String getUsersInfo(@AuthenticationPrincipal Coders user, Model model) { + Coders feed = codersRepository.findByUsername(user.getUsername()); + Set following = feed.getFollowers(); + model.addAttribute("followers", following); + return "feed"; + } + + @Transactional + @GetMapping("/delete/{id}") + public RedirectView deleteUserPost(@PathVariable String id, Principal principal, Model model) { + Post post = contentRepository.findById(Long.parseLong(id)).orElseThrow(); + Coders user = codersRepository.findByUsername(principal.getName()); + model.addAttribute("username", principal.getName()); + model.addAttribute("userProfile", user); + contentRepository.delete(post); + return new RedirectView("/profile"); + } + + @GetMapping("/edit/{id}") + public String showUpdateForm(@PathVariable("id") long id, Model model) { + Post post = contentRepository.findById(id) + .orElseThrow(() -> new IllegalArgumentException("Invalid user Id:" + id)); + model.addAttribute("post", post); + return "updateForm"; + } + + @PostMapping("/update/{id}") + public RedirectView updateUser(@PathVariable("id") long id, Post post) { + Post updatedPost = contentRepository.findById(id).orElseThrow(); + updatedPost.setBody(post.getBody()); + contentRepository.save(updatedPost); + return new RedirectView("/profile"); + } + + @PostMapping("/addComment") + public RedirectView addComment(Long id, String body) { + Post post = contentRepository.findById(id).get(); + System.out.println(post.getBody()); + Comment comment = new Comment(post, body); + commentRepository.save(comment); + System.out.println(comment.getBody()); + return new RedirectView("/profile"); + } + +// @GetMapping("/post") +// public String getPost(Model model, @AuthenticationPrincipal Coders user) { +// List posts = (List) codersRepository.findByUsername(user.getUsername()).getPosts(); +// model.addAttribute("posts", posts); +// return "post"; +// } + +} diff --git a/src/main/java/com/example/init/controllers/adminController.java b/src/main/java/com/example/init/controllers/adminController.java new file mode 100644 index 0000000..c5fa318 --- /dev/null +++ b/src/main/java/com/example/init/controllers/adminController.java @@ -0,0 +1,86 @@ +package com.example.init.controllers; + +import java.security.Principal; +import java.util.List; + +import javax.transaction.Transactional; + +import com.example.init.models.Coders; +import com.example.init.repositories.CodersRepository; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.servlet.view.RedirectView; + +@Controller +public class adminController { + @Autowired + CodersRepository codersRepository; + + @Autowired + BCryptPasswordEncoder bCryptPasswordEncoder; + + @GetMapping("/admin") + + String admin(Model model) { + List coders = codersRepository.findAll(); + model.addAttribute("coders", coders); + return "admin"; + } + + @PostMapping("/admin") + RedirectView addCoder(String email, String username, String password, String firstName, String lastName, + String dateOfBirth, String bio) { + + Coders newCoder = new Coders(email, username, bCryptPasswordEncoder.encode(password), firstName, lastName, + dateOfBirth, bio); + codersRepository.save(newCoder); + return new RedirectView("/admin"); + } + + @GetMapping("/coder") + public String getCoder(@RequestParam long id, Model model, Principal principal) { + Coders coder = codersRepository.findById(id).get(); + model.addAttribute("coder", coder); + return "coder"; + } + + @Transactional + @GetMapping("/del/{id}") + public RedirectView delete(@PathVariable String id, Principal principal, Model model) { + Coders coder = codersRepository.findById(Long.parseLong(id)).orElseThrow(); + model.addAttribute("coder", principal.getName()); + codersRepository.delete(coder); + return new RedirectView("/admin"); + } + + @GetMapping("/form/{id}") + public String showUpdateForm(@PathVariable("id") long id, Model model) { + Coders coder = codersRepository.findById(id) + .orElseThrow(() -> new IllegalArgumentException("Invalid user Id:" + id)); + model.addAttribute("coder", coder); + return "putForm"; + } + + @Transactional + @PostMapping("/upd/{id}") + public RedirectView updateUser(@PathVariable("id") long id, Coders coder) { + Coders updatedCoder = codersRepository.findById(id).orElseThrow(); + updatedCoder.setEmail(coder.getEmail()); + updatedCoder.setUsername(coder.getUsername()); + updatedCoder.setPassword(coder.getPassword()); + updatedCoder.setFirstName(coder.getFirstName()); + updatedCoder.setLastName(coder.getLastName()); + updatedCoder.setDateOfBirth(coder.getDateOfBirth()); + updatedCoder.setBio(coder.getBio()); + codersRepository.save(updatedCoder); + return new RedirectView("/admin"); + } + +} \ No newline at end of file diff --git a/src/main/java/com/example/init/models/Coders.java b/src/main/java/com/example/init/models/Coders.java new file mode 100644 index 0000000..1643c05 --- /dev/null +++ b/src/main/java/com/example/init/models/Coders.java @@ -0,0 +1,167 @@ +package com.example.init.models; + +import org.springframework.security.core.GrantedAuthority; +import org.springframework.security.core.userdetails.UserDetails; +import javax.persistence.*; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import java.util.Set; + +@Entity +public class Coders implements UserDetails { + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "id", nullable = false) + private Long id; + + @Column(unique = true) + private String email; + + @Column(unique = true) + private String username; + private String password; + private String firstName; + private String lastName; + private String dateOfBirth; + private String bio; + + @OneToMany(mappedBy = "applicationUser", fetch = FetchType.EAGER) + private List posts; + + @ManyToMany + @JoinTable(name = "follower_follower", joinColumns = @JoinColumn(name = "from_id"), inverseJoinColumns = @JoinColumn(name = "to_id")) + Set followers; + @ManyToMany(mappedBy = "followers") + Set following; + + public Coders() { + } + + public Coders(String email, String username, String password, String firstName, String lastName, String dateOfBirth, + String bio) { + this.email = email; + this.username = username; + this.password = password; + this.firstName = firstName; + this.lastName = lastName; + this.dateOfBirth = dateOfBirth; + this.bio = bio; + } + + @Override + public boolean isAccountNonExpired() { + return true; + } + + @Override + public boolean isAccountNonLocked() { + return true; + } + + @Override + public boolean isCredentialsNonExpired() { + return true; + } + + @Override + public boolean isEnabled() { + return true; + } + + public void setUsername(String username) { + this.username = username; + } + + @Override + public Collection getAuthorities() { + return null; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + @Override + public String getUsername() { + return username; + } + + @Override + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public String getFirstName() { + return firstName; + } + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public String getLastName() { + return lastName; + } + + public void setLastName(String lastName) { + this.lastName = lastName; + } + + public String getDateOfBirth() { + return dateOfBirth; + } + + public void setDateOfBirth(String dateOfBirth) { + this.dateOfBirth = dateOfBirth; + } + + public String getBio() { + return bio; + } + + public void setBio(String bio) { + this.bio = bio; + } + + public List getPosts() { + return posts; + } + + public void setPosts(List posts) { + this.posts = posts; + } + + public Set getFollowers() { + return this.followers; + } + + public void setFollowers(Set followers) { + this.followers = followers; + } + + public Set getFollowing() { + return this.following; + } + + public void setFollowing(Set following) { + this.following = following; + } + +} diff --git a/src/main/java/com/example/init/models/Comment.java b/src/main/java/com/example/init/models/Comment.java new file mode 100644 index 0000000..77fbc3a --- /dev/null +++ b/src/main/java/com/example/init/models/Comment.java @@ -0,0 +1,63 @@ +package com.example.init.models; + +import javax.persistence.*; +import java.text.SimpleDateFormat; + +@Entity +public class Comment { + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "id", nullable = false) + private Long id; + + private String body; + + private String createdAt; + + @ManyToOne + @JoinColumn(name = "post_id") + private Post post; + + public Post getPost() { + return post; + } + + public Comment(Post post, String body) { + this.post = post; + this.body = body; + SimpleDateFormat sdf = new SimpleDateFormat("yyyy.MM.dd.HH.mm"); + } + + public Comment() { + + } + + public void setPost(Post post) { + this.post = post; + } + + public String getBody() { + return body; + } + + public void setBody(String body) { + this.body = body; + } + + public String getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(String createdAt) { + this.createdAt = createdAt; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + +} diff --git a/src/main/java/com/example/init/models/Courses.java b/src/main/java/com/example/init/models/Courses.java new file mode 100644 index 0000000..b682759 --- /dev/null +++ b/src/main/java/com/example/init/models/Courses.java @@ -0,0 +1,95 @@ +package com.example.init.models; + +import javax.persistence.*; +import com.google.gson.Gson; +import com.google.gson.reflect.TypeToken; + +import java.io.BufferedReader; +import java.io.FileReader; +import java.util.ArrayList; + +// +@Entity +public class Courses { + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "id", nullable = false) + private Long id; + // public int course_id; + public String title; + public String course_level; + public String description; + public String image; + + public Courses() throws Exception { + + } + + public Courses(String title, String course_level, String description, String image) throws Exception { + this.title = title; + this.course_level = course_level; + this.description = description; + this.image = image; + + } + + // this is reader json file -------------------------- + public static ArrayList readJsonFile(FileReader jsonFile) { + // create Gson instance + Gson gson = new Gson(); + + // create a reader + BufferedReader reader = new BufferedReader(jsonFile); + + // convert JSON array to list of users + ArrayList courses = gson.fromJson(reader, new TypeToken>() { + }.getType()); + + System.out.println(courses); + return courses; + } + + // ------------------------------------ this is the End + + public Long getId() { + return id; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getCourse_level() { + return course_level; + } + + public void setCourse_level(String course_level) { + this.course_level = course_level; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getImage() { + return image; + } + + public void setImage(String image) { + this.image = image; + } + + @Override + public String toString() { + return "Courses{" + "title='" + title + '\'' + ", description='" + description + '\'' + ", image='" + image + + '\'' + '}'; + } +} diff --git a/src/main/java/com/example/init/models/Post.java b/src/main/java/com/example/init/models/Post.java new file mode 100644 index 0000000..e4baff2 --- /dev/null +++ b/src/main/java/com/example/init/models/Post.java @@ -0,0 +1,79 @@ +package com.example.init.models; + +import javax.persistence.*; + +import java.sql.Timestamp; +import java.text.SimpleDateFormat; +import java.util.List; + +@Entity +public class Post { + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "id", nullable = false) + private Long id; + + @ManyToOne + @JoinColumn(name = "application_user_id") + private Coders applicationUser; + + private String body; + + private String createdAt; + + @OneToMany(mappedBy = "post", fetch = FetchType.EAGER) + private List comments; + + public Post() { + } + + public Post(Coders applicationUser, String body) { + this.applicationUser = applicationUser; + SimpleDateFormat sdf = new SimpleDateFormat("yyyy.MM.dd.HH.mm"); + this.createdAt = sdf.format(new Timestamp(System.currentTimeMillis()).getTime()); + + this.body = body; + + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Coders getApplicationUser() { + return applicationUser; + } + + public void setApplicationUser(Coders applicationUser) { + this.applicationUser = applicationUser; + } + + public String getBody() { + return body; + } + + public void setBody(String body) { + this.body = body; + } + + public String getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(String createdAt) { + this.createdAt = createdAt; + } + + public List getComments() { + return comments; + } + + public void setComments(List comments) { + this.comments = comments; + } + +} diff --git a/src/main/java/com/example/init/models/Quiz.java b/src/main/java/com/example/init/models/Quiz.java new file mode 100644 index 0000000..ba5055f --- /dev/null +++ b/src/main/java/com/example/init/models/Quiz.java @@ -0,0 +1,62 @@ +package com.example.init.models; + +import java.util.List; + +public class Quiz { + + public int id; + public String question; + public Object description; + public Answers answers; + public String multiple_correct_answers; + public CorrectAnswers correct_answers; + public String correct_answer; + public Object explanation; + public Object tip; + public List tags; + public String category; + public String difficulty; + + public Quiz() { + } + + public Quiz(int id, String question, Object description, Answers answers, String multiple_correct_answers, + CorrectAnswers correct_answers, String correct_answer, Object explanation, Object tip, List tags, + String category, String difficulty) { + this.id = id; + this.question = question; + this.description = description; + this.answers = answers; + this.multiple_correct_answers = multiple_correct_answers; + this.correct_answers = correct_answers; + this.correct_answer = correct_answer; + this.explanation = explanation; + this.tip = tip; + this.tags = tags; + this.category = category; + this.difficulty = difficulty; + } + + private static class Answers { + public String answer_a; + public String answer_b; + public String answer_c; + public String answer_d; + public Object answer_e; + public Object answer_f; + } + + private static class CorrectAnswers { + public String answer_a_correct; + public String answer_b_correct; + public String answer_c_correct; + public String answer_d_correct; + public String answer_e_correct; + public String answer_f_correct; + } + + private static class Tag { + public String name; + } + +} \ No newline at end of file diff --git a/src/main/java/com/example/init/models/QuizDTO.java b/src/main/java/com/example/init/models/QuizDTO.java new file mode 100644 index 0000000..041cbcb --- /dev/null +++ b/src/main/java/com/example/init/models/QuizDTO.java @@ -0,0 +1,70 @@ +package com.example.init.models; + +public class QuizDTO { + private String answer_a; + private String answer_b; + private String answer_c; + private String answer_d; + private String answer_e; + private String answer_f; + + public QuizDTO() { + } + + public QuizDTO(String answer_a, String answer_b, String answer_c, String answer_d, String answer_e, String answer_f) { + this.answer_a = answer_a; + this.answer_b = answer_b; + this.answer_c = answer_c; + this.answer_d = answer_d; + this.answer_e = answer_e; + this.answer_f = answer_f; + } + + public String getAnswer_a() { + return answer_a; + } + + public void setAnswer_a(String answer_a) { + this.answer_a = answer_a; + } + + public String getAnswer_b() { + return answer_b; + } + + public void setAnswer_b(String answer_b) { + this.answer_b = answer_b; + } + + public String getAnswer_c() { + return answer_c; + } + + public void setAnswer_c(String answer_c) { + this.answer_c = answer_c; + } + + public String getAnswer_d() { + return answer_d; + } + + public void setAnswer_d(String answer_d) { + this.answer_d = answer_d; + } + + public String getAnswer_e() { + return answer_e; + } + + public void setAnswer_e(String answer_e) { + this.answer_e = answer_e; + } + + public String getAnswer_f() { + return answer_f; + } + + public void setAnswer_f(String answer_f) { + this.answer_f = answer_f; + } +} diff --git a/src/main/java/com/example/init/models/ResultsQuiz.java b/src/main/java/com/example/init/models/ResultsQuiz.java new file mode 100644 index 0000000..2129bf1 --- /dev/null +++ b/src/main/java/com/example/init/models/ResultsQuiz.java @@ -0,0 +1,52 @@ +package com.example.init.models; + +import javax.persistence.*; + +@Entity +@Table(name = "results") +public class ResultsQuiz { + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + // @Column(name = "id", nullable = false) + private int id; + @ManyToOne + @JoinColumn(name = "username_id") + public Coders username; + public int totalCorrect; + + public ResultsQuiz() { + } + + public ResultsQuiz(int id, Coders username, int totalCorrect) { + this.id = id; + this.username = username; + this.totalCorrect = totalCorrect; + } + + public int getId() { + return id; + } + + public Coders getUsername() { + return username; + } + + public void setUsername(Coders username) { + this.username = username; + } + + public int getTotalCorrect() { + return totalCorrect; + } + + public void setTotalCorrect(int totalCorrect) { + this.totalCorrect = totalCorrect; + } + // public Long getId() { + // return id; + // } + // + // public void setId(Long id) { + // this.id = id; + // } +} diff --git a/src/main/java/com/example/init/repositories/CodersRepository.java b/src/main/java/com/example/init/repositories/CodersRepository.java new file mode 100644 index 0000000..6673df8 --- /dev/null +++ b/src/main/java/com/example/init/repositories/CodersRepository.java @@ -0,0 +1,12 @@ +package com.example.init.repositories; + +import com.example.init.models.Coders; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.stereotype.Repository; + +@Repository +public interface CodersRepository extends JpaRepository { + public Coders findByUsername(String username); + + public Coders findUserById(Long id); +} \ No newline at end of file diff --git a/src/main/java/com/example/init/repositories/CommentRepository.java b/src/main/java/com/example/init/repositories/CommentRepository.java new file mode 100644 index 0000000..8d83884 --- /dev/null +++ b/src/main/java/com/example/init/repositories/CommentRepository.java @@ -0,0 +1,9 @@ +package com.example.init.repositories; + +import com.example.init.models.Comment; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.stereotype.Repository; + +@Repository +public interface CommentRepository extends JpaRepository { +} \ No newline at end of file diff --git a/src/main/java/com/example/init/repositories/ContentRepository.java b/src/main/java/com/example/init/repositories/ContentRepository.java new file mode 100644 index 0000000..5ea295f --- /dev/null +++ b/src/main/java/com/example/init/repositories/ContentRepository.java @@ -0,0 +1,13 @@ +package com.example.init.repositories; + +import com.example.init.models.Post; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.stereotype.Repository; + +@Repository +public interface ContentRepository extends JpaRepository { + public Post findPostById(Long id); + + // void deletePostByAppUser_UsernameAndId(String username, Long id); + +} diff --git a/src/main/java/com/example/init/repositories/CourseRepository.java b/src/main/java/com/example/init/repositories/CourseRepository.java new file mode 100644 index 0000000..338f5b1 --- /dev/null +++ b/src/main/java/com/example/init/repositories/CourseRepository.java @@ -0,0 +1,9 @@ +package com.example.init.repositories; + +import com.example.init.models.Courses; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.stereotype.Repository; + +@Repository +public interface CourseRepository extends JpaRepository { +} diff --git a/src/main/java/com/example/init/repositories/ResultsRepo.java b/src/main/java/com/example/init/repositories/ResultsRepo.java new file mode 100644 index 0000000..a9b61c4 --- /dev/null +++ b/src/main/java/com/example/init/repositories/ResultsRepo.java @@ -0,0 +1,9 @@ +package com.example.init.repositories; + +import com.example.init.models.ResultsQuiz; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.stereotype.Repository; + +@Repository +public interface ResultsRepo extends JpaRepository { +} diff --git a/src/main/java/com/example/init/security/UserDetailsServiceImpl.java b/src/main/java/com/example/init/security/UserDetailsServiceImpl.java new file mode 100644 index 0000000..9c2216e --- /dev/null +++ b/src/main/java/com/example/init/security/UserDetailsServiceImpl.java @@ -0,0 +1,25 @@ +package com.example.init.security; + +import com.example.init.models.Coders; +import com.example.init.repositories.CodersRepository; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.core.userdetails.UserDetails; +import org.springframework.security.core.userdetails.UserDetailsService; +import org.springframework.security.core.userdetails.UsernameNotFoundException; +import org.springframework.stereotype.Service; + +@Service +public class UserDetailsServiceImpl implements UserDetailsService { + + @Autowired + CodersRepository codersRepository; + + @Override + public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException { + Coders coders = codersRepository.findByUsername(username); + if (coders == null) { + throw new UsernameNotFoundException((username + " not found!")); + } + return coders; + } +} diff --git a/src/main/java/com/example/init/security/WebSecurityConfig.java b/src/main/java/com/example/init/security/WebSecurityConfig.java new file mode 100644 index 0000000..64e3320 --- /dev/null +++ b/src/main/java/com/example/init/security/WebSecurityConfig.java @@ -0,0 +1,36 @@ +package com.example.init.security; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; +import org.springframework.security.config.annotation.web.builders.HttpSecurity; +import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; +import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; +import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; + +@Configuration +@EnableWebSecurity +public class WebSecurityConfig extends WebSecurityConfigurerAdapter { + @Autowired + UserDetailsServiceImpl userDetailsService; + + @Bean + public BCryptPasswordEncoder passwordEncoder() { + return new BCryptPasswordEncoder(); + } + + @Override + protected void configure(AuthenticationManagerBuilder auth) throws Exception { + auth.userDetailsService(userDetailsService).passwordEncoder(passwordEncoder()); + } + + @Override + protected void configure(HttpSecurity http) throws Exception { + http.cors().disable().csrf().disable().authorizeRequests() + .antMatchers("/login", "/signup", "/", "/quiz", "/courses", "/users", "/posts").permitAll() + .antMatchers("/adminpanel").hasAuthority("ROLE_ADMIN").anyRequest().authenticated().and().formLogin() + .loginPage("/login").usernameParameter("email").permitAll().loginProcessingUrl("/perform_login") + .defaultSuccessUrl("/", true).failureUrl("/error").and().logout().logoutUrl("/perform_logout"); + } +} diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index f03a366..e25bd09 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1,7 +1,7 @@ spring.sql.init.platform=postgres spring.datasource.url=jdbc:postgresql://localhost:5432/coders -spring.datasource.username=abdelqader -spring.datasource.password=0000 +spring.datasource.username=mohammad +spring.datasource.password=1234 spring.jpa.database=postgresql spring.jpa.generate-ddl=true spring.jpa.hibernate.ddl-auto=update diff --git a/src/main/resources/templates/Init.png b/src/main/resources/templates/Init.png new file mode 100644 index 0000000..0da98fb Binary files /dev/null and b/src/main/resources/templates/Init.png differ diff --git a/src/main/resources/templates/admin.html b/src/main/resources/templates/admin.html new file mode 100644 index 0000000..3bf03e9 --- /dev/null +++ b/src/main/resources/templates/admin.html @@ -0,0 +1,132 @@ + + + + + + + + Admin Panel + + +
+
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+ +
+ +
+
+ + + + + + + + + + + + + + + + + + +
IdFirst NameLast NameHandle
+ + 🖍 +
+
+ + diff --git a/src/main/resources/templates/courses.html b/src/main/resources/templates/courses.html new file mode 100644 index 0000000..76fcf91 --- /dev/null +++ b/src/main/resources/templates/courses.html @@ -0,0 +1,33 @@ + + + + + Courses Page + + Admin Panel + + +
+ + + + + + + +
+ +
+ +
+ + image +
+ + + diff --git a/src/main/resources/templates/designFirstSection.png b/src/main/resources/templates/designFirstSection.png new file mode 100644 index 0000000..032afa8 Binary files /dev/null and b/src/main/resources/templates/designFirstSection.png differ diff --git a/src/main/resources/templates/feed.html b/src/main/resources/templates/feed.html new file mode 100644 index 0000000..2f9bb95 --- /dev/null +++ b/src/main/resources/templates/feed.html @@ -0,0 +1,42 @@ + + + + + Feed page + + Admin Panel + + +
+ +
+

Feed Posts

+
+
+
+
Username:
+

+

+
+
Posts:
+
    +
  • +
+
+
+
+ + diff --git a/src/main/resources/templates/home.html b/src/main/resources/templates/home.html index 033f5e1..3ce61b5 100644 --- a/src/main/resources/templates/home.html +++ b/src/main/resources/templates/home.html @@ -1,12 +1,453 @@ - + + - Hello + Init home + + + + + + + -

Hello World

+ + +
+ + + + Login + + +
+ + + +
+ + + +
+ + +
+

+ Find your community and enjoy the process of learning <coding/> +

+
+ + +
+
+ + +
+ designFirstSection +
+ +
+
+
+

Why Init?

+

Init will initialize you to get involved with the coding community.

+

also it will provide you with everything you need to start.

+
+
+ + +
+
+
+
+ +
+
+
+
+ +
+
+
+
+ + + + +
+
+

Interactive

+

Init will help you to collaborate, share ideas, and get the help from other programmers.

+
+ +
+ hands +
+ +
+ +
+ +
+ logo +
+ +
+

Quizes

+

Your coding and thinking skills will get better everyday, as we provide quizes for you to solve it and practice.

+

each quiz you solve you will git extra points, that you can use for buying courses from our website.

+ +
+ + + + +
+ + + + +
+ + + + + - + \ No newline at end of file diff --git a/src/main/resources/templates/login.html b/src/main/resources/templates/login.html new file mode 100644 index 0000000..08989a4 --- /dev/null +++ b/src/main/resources/templates/login.html @@ -0,0 +1,35 @@ + + + + + login + + + +
+
Invalid username and password.
+
You have been logged out.
+ +
+ + +
+
+ + +
+ +
+ + diff --git a/src/main/resources/templates/nav.html b/src/main/resources/templates/nav.html new file mode 100644 index 0000000..c762fff --- /dev/null +++ b/src/main/resources/templates/nav.html @@ -0,0 +1,40 @@ + diff --git a/src/main/resources/templates/navbar.html b/src/main/resources/templates/navbar.html new file mode 100644 index 0000000..80dca76 --- /dev/null +++ b/src/main/resources/templates/navbar.html @@ -0,0 +1,29 @@ + diff --git a/src/main/resources/templates/post.html b/src/main/resources/templates/post.html new file mode 100644 index 0000000..92093f4 --- /dev/null +++ b/src/main/resources/templates/post.html @@ -0,0 +1,41 @@ + + + + + + + + diff --git a/src/main/resources/templates/posts.html b/src/main/resources/templates/posts.html new file mode 100644 index 0000000..2803942 --- /dev/null +++ b/src/main/resources/templates/posts.html @@ -0,0 +1,11 @@ + + +
+ +
+ \ No newline at end of file diff --git a/src/main/resources/templates/profile.html b/src/main/resources/templates/profile.html new file mode 100644 index 0000000..72250ce --- /dev/null +++ b/src/main/resources/templates/profile.html @@ -0,0 +1,83 @@ + + + + + user profile + + + + +
+ +
+
+ ProfilePicture +
+ +

+

+

+

+
+ +
+
+ +
+
+
+ + +
+ +
+
+
+ +
+
+ +Posts + +
+
+ + + + + + + + + +
+
+

+

+ Delete + Edit +
+
+ + +
+
+

+ + + + +
+
+
+
+

+

+
+
+
+ + + + + \ No newline at end of file diff --git a/src/main/resources/templates/putForm.html b/src/main/resources/templates/putForm.html new file mode 100644 index 0000000..f325b48 --- /dev/null +++ b/src/main/resources/templates/putForm.html @@ -0,0 +1,108 @@ + + + + + Update Form + + + +
+ +
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+ +
+ + diff --git a/src/main/resources/templates/quiz.html b/src/main/resources/templates/quiz.html new file mode 100644 index 0000000..f05bffe --- /dev/null +++ b/src/main/resources/templates/quiz.html @@ -0,0 +1,88 @@ + + + + + + + + Quiz Page + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + +
+

Only Select The Correct Answers

+ +
+
+ + +
+ +

+
+ +
+ +

+
+ +
+ +

+
+ + + + + + + + + + + + + + + + +
+ + + + + +
+ + + + + + + + \ No newline at end of file diff --git a/src/main/resources/templates/result.html b/src/main/resources/templates/result.html new file mode 100644 index 0000000..c4305ba --- /dev/null +++ b/src/main/resources/templates/result.html @@ -0,0 +1,49 @@ + + + + + Result Page + + +
+
+

Your Score

+ +
+

+
+ +
+

Total correct answer:  

+

+
+ +
+

Total false answer:  

+

+
+ +
+ + +
+
+
+ + diff --git a/src/main/resources/templates/signup.html b/src/main/resources/templates/signup.html new file mode 100644 index 0000000..fabf8b3 --- /dev/null +++ b/src/main/resources/templates/signup.html @@ -0,0 +1,52 @@ + + + + + signup + + + +
+ Sign up +
+
+ + +
+
+ + +
+ +
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+ +
+
+ + diff --git a/src/main/resources/templates/updateForm.html b/src/main/resources/templates/updateForm.html new file mode 100644 index 0000000..6631d73 --- /dev/null +++ b/src/main/resources/templates/updateForm.html @@ -0,0 +1,21 @@ + + + + + Update Form + + +
+ +
+ + + +
+ + diff --git a/src/main/resources/templates/user.html b/src/main/resources/templates/user.html new file mode 100644 index 0000000..0b0e30e --- /dev/null +++ b/src/main/resources/templates/user.html @@ -0,0 +1,44 @@ + + + + + user profile + + + +
+ +
+ ProfilePicture +
+ +

+

+

+

+
+ +
+
+ + Posts + +
+
+
+

+

+
+
+
+ + diff --git a/src/main/resources/templates/users.html b/src/main/resources/templates/users.html new file mode 100644 index 0000000..4093215 --- /dev/null +++ b/src/main/resources/templates/users.html @@ -0,0 +1,49 @@ + + + + + + Suggest Friends + + +
+ + +
+

People You May Know

+
+
    + +
  • +
  • +
  • +
    + + +
    +
+
+ +