Coder Social home page Coder Social logo

builde7b0b / builderapi Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 329 KB

a user authentication and authorization system that integrates with your existing applications. Users can sign up, log in, and access protected resources based on their roles and permissions.

Java 100.00%

builderapi's Introduction

BuilderAPI

This is a mini-project to build a user authentication and authorization system using Spring Boot and PostgreSQL. The project is designed to demonstrate how to build a monolithic backend using Spring Boot and its modules in order to create a web API using a monolithic approach.

Table of Contents

  • Project Overview
  • Technologies Used
  • Usage
  • ERD Diagram
  • MVC Diagram
  • Relationships
  • Project Approach
  • User Stories
  • Contributing
  • Credits

Demo

GIF

Project Overview

This mini-project aims to build a user authentication and authorization system that integrates with existing applications. Users can sign up, log in, and access protected resources based on their roles and permissions. The PostgreSQL database will consist of three models: User, Role, and Permission. The application will be developed using Spring Boot and will be running on the Tomcat server.

Technologies Used

  • Java
  • Spring Bot
  • PostgreSQL
  • Maven

Usage

Once the application is running, you can use a tool like Postman to interact with the API. You can sign up for a new account, log in to an existing account, and access protected resources based on your user roles and permissions.

MVC Diagram

MVC diagram

ERD Diagram

ERD diagram

Relationships

  • The User entity is connected to the UserRole entity with a one-to-many relationship
  • The Role entity is connected to the UserRole entity with a one-to-many relationship
  • The Role entity is connected to the RolePermission entity with a one-to-many relationship
  • The Permission entity is connected to the RolePermission entity with a many-to-one relationship,

Project Approach

Development Methodology: Agile

As a solo developer, Agile is a great development methodology to use because it emphasizes flexibility, collaboration, and delivering working software in short iterations. For this mini-project, I'll be using Agile as my development methodology, which means that I'll be breaking down the work into small, manageable chunks and iterating on the software over time.

Technology Stack: Spring Boot and PostgreSQL

For this mini-project, I'll be using Spring Boot as my framework for building the API and PostgreSQL as my database. Spring Boot is a popular framework for building enterprise-level Java applications, and it provides a powerful set of tools and modules for building REST APIs. PostgreSQL is a powerful and reliable open-source relational database that's well-suited for enterprise applications.

Project Management Tool: Github Projects

Github Projects is a great tool for solo developers because it allows me to create and manage a Kanban board that tracks the progress of the project. This will help me stay organized, prioritize tasks, and collaborate effectively with myself.

Link to Kanban Board

Overall, my approach to this mini-project will be to use Agile as my development methodology, Spring Boot and PostgreSQL as my technology stack, and Github Projects as my project management tool. By breaking down the work into small, manageable chunks and iterating on the software over time, I can ensure that I'm building a high-quality, well-documented API that meets the needs of my users

User Stories

  • As a user, I want to be able to create a new account, so that I can access protected resources
  • As a user, I want to be able to log in to my account, so that I can access my personal Information and protected resources.
  • As a user, I want to be able to update my account information, so that my profile is accurate and up-to-date.

Contributing

Contributions to this project are welcome. If you find a bug or have an idea for a new feature, feel free to open an issue or submit a pull request. Before contributing, please read the Contributing Guidelines.

Credits

This project was created by [Eugene]. Special thanks to [Suresh & Drubo] for their guidance and support.

builderapi's People

Contributors

builde7b0b avatar

Stargazers

 avatar

Watchers

 avatar

builderapi's Issues

Project Setup - Initial

  • Create a new project using Spring Boot Initializr.
  • Add necessary dependencies to the project.
  • Set up the project structure according to the package layout.
  • Configure the application.properties file for PostgreSQL connection.
  • Set up Spring Profiles for different environments.

Review & Test

  • Write tests for documentation.
  • Remove unused code and dependencies.
  • Adhere to KISS and DRY principles.
  • Write tests for code quality.
  • Document code and give credit.

Project Setup - Last

  • - Write tests for the database connection.
  • - Configure security filters and providers.
  • - Generate JWT tokens upon successful authentication.
  • - Define API endpoints for CRUD operations on User entities.
  • - Define additional API endpoints for other entities.

Syntax Error: User

Caused by: org.postgresql.util.PSQLException: ERROR: syntax error at or near "user"

API Endpoints

  • x Define a UserController class to handle API endpoints for user-related functionality.
  • Write tests and implement methods in UserController for creating, reading, updating, and deleting users.
  • Define additional controllers for other entities.
  • Write tests and implement additional API endpoints for CRUD operations on other entities.
  • Add documentation for REST API endpoints and their functionality.

Security and Auth

  • Add Spring Security dependency to the project.

  • Write tests for security configuration.

  • Define a SecurityController class to handle authentication and authorization.

  • Write tests and implement methods in SecurityController for logging in and out.

  • Define a RolePermission entity class to represent the relationship between a Role and a Permission.

  • Write tests and implement the RolePermission entity class.

  • Write tests and implement methods in SecurityController for generating and validating JWT tokens.

  • Add necessary configuration for CORS handling.

  • Write tests and implement exception handling in SecurityController.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.