Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kpidiba/spring_security
IMPLEMENTATION OF SPRING SECURITY WITH ANGULAR
https://github.com/kpidiba/spring_security
angular java spring spring-boot spring-security springjdbc typescript
Last synced: 2 days ago
JSON representation
IMPLEMENTATION OF SPRING SECURITY WITH ANGULAR
- Host: GitHub
- URL: https://github.com/kpidiba/spring_security
- Owner: kpidiba
- Created: 2023-06-01T13:45:26.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-04-10T18:22:19.000Z (7 months ago)
- Last Synced: 2024-04-10T21:52:56.982Z (7 months ago)
- Topics: angular, java, spring, spring-boot, spring-security, springjdbc, typescript
- Language: TypeScript
- Homepage: https://spring-security.vercel.app
- Size: 654 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Security: security/.gitignore
Awesome Lists containing this project
README
# Java Spring Boot and Angular Project - APIs with Spring Security and JWT
## Introduction
This repository contains a Java Spring Boot and Angular project that implements simple signup and login APIs with Spring Security and JWT (JSON Web Tokens). The project aims to demonstrate how to build a secure authentication system using Spring Boot for the backend and Angular for the frontend.The backend is developed with Java Spring Boot, which provides robust security features through Spring Security, and the
frontend is built with Angular, providing a user-friendly interface to interact with the signup and login APIs.DEMO
### WHAT IT DOES
## Cutting-edge Tech Arsenal 🚀
- **Spring Boot:** Powering Java-based applications with finesse
- **Spring Security:** Fortifying your system with top-tier authentication and access control
- **Gradle:** Automating your builds for seamless deployment
- **Java:** The backbone of our backend development, ensuring robust functionality
- **Angular:** Crafting sleek, dynamic views for an unparalleled user experience
- **TypeScript:** Elevating our frontend with type-checked precision## Features
- User signup with email and password
- User login with email and password
- JWT-based authentication for secure API access
- Token-based session management## Requirements
Before running the project, ensure you have the following prerequisites:
- Java Development Kit (JDK) 17 or higher
- Node.js and npm (Node Package Manager)
- Angular CLI (Command Line Interface)## Setup Instructions
1. **Clone the repository:** Start by cloning this repository to your local machine using Git.
```shell
git clone https://github.com/kpidiba/spring_security
cd spring-boot-angular-auth
```- **Backend Setup:**
- Open the backend project in your preferred Java IDE (Eclipse, IntelliJ, etc.).
- Configure your database settings in `src/main/resources/application.properties`.
- maven install all dependencies
- Run the Spring Boot application to start the backend server.
```bash
mvn install
```
- Create database **security** or **custom database**- **Frontend Setup:**
- Navigate to the `Client` folder.
- Install the required dependencies by running:
```shell
npm install
```- Update the API base URL in `src/environments/environment.ts` to match your backend server URL.
- **Running the Application:**
- To start the Angular development server, run:
```shell
ng serve
```
2. Visit `http://localhost:4200` in your web browser to access the application.## Usage
1. **Signup:**
- Open the application in your web browser and click on the "Sign Up" button.
- Enter your email address and password, then click "Register."
- Upon successful registration, you will be redirected to the login page.2. **Login:**
- On the login page, enter your registered email address and password.
- Click on the "Login" button.
- If the provided credentials are correct, you will be redirected to the dashboard.3. **Dashboard:**
- The dashboard displays a welcome message and other user-specific information.
- The dashboard makes authenticated API requests to the backend using JWT.**USE TOKEN IN REQUEST INSOMNIA**
- go to header ,first input Authorization ,second section "Bearer $token"
### DEPENDENCIES
```xml
4.0.0
org.springframework.boot
spring-boot-starter-parent
3.1.0
com.security
test
0.0.1-SNAPSHOT
test
Demo project for Spring Boot
17
org.springframework.boot
spring-boot-starter-data-jpa
org.springframework.boot
spring-boot-starter-security
org.springframework.boot
spring-boot-starter-web
com.mysql
mysql-connector-j
runtime
org.springframework.boot
spring-boot-starter-test
test
org.springframework.security
spring-security-test
test
io.jsonwebtoken
jjwt-jackson
0.11.5
runtime
io.jsonwebtoken
jjwt-impl
0.11.5
runtime
io.jsonwebtoken
jjwt-api
0.11.5
org.projectlombok
lombok
annotationProcessor
org.springframework.boot
spring-boot-maven-plugin
```
## Contributing
Contributions to this project are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request.
When contributing, please follow the existing code style, and provide detailed information about your changes or additions.