EiSimp / Book-Archive

BookPals
https://book-archive-production.up.railway.app/homepage
0 stars 0 forks source link

Connected to Database #6

Closed EiSimp closed 4 months ago

EiSimp commented 4 months ago

1.Added a models folder. 2.Added a new User.java file inside the models folder, containing data regarding users. This includes the Users class, the constructors, and the getters/setters. The User class currently contains 3 attributes. ID, username, and password. ID is not within the constructors due to it being auto incremented by the database itself. 3.Added a repositories folder. 4.Added a new UserRepository.java file inside the repositories folder. 5.Added the postgresql dependency to the pom.xml file and commented out the spring-boot-starter-jdbc dependency. 6.Added code to application.property to ensure connection to the database. 7.Added a UserController.java file into the controllers consisting of creation, updating, and deletion of users.

  1. Created a login.html in the templates.archives folder with a button leading to the signup.html page.
  2. Edited the homepage.html. Added a button that leads to the login.html page. 10.Created a signup page. After signup, if signup is successful, then user will be added to database. 11.Changed archiveController to include getmappings to signup page, homepage, and login page. 12.Added A bio column to the table for testing. it worked.

Just some extra information. If you want to add a column to the table all you need to do is within the user file add @Column() with what you want to add underneath. Then add it to the constructor and create the getters and setters.