Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade v1 #87

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 51 additions & 36 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
## Refactoried and upgraded to the latest version:

- Spring Boot : version '3.1.5'

- "@ant-design/icons": "^5.2.6",

    "antd": "^5.11.4",

    "react": "^18.2.0",

    "react-dom": "^18.2.0",

    "react-router-dom": "^6.20.0",

## Building a Full Stack Polls app similar to twitter polls with Spring Boot, Spring Security, JWT, React and Ant Design

![App Screenshot](screenshot.png)
Expand All @@ -17,50 +31,51 @@ I've written a complete tutorial series for this application on The CalliCoder B
## Steps to Setup the Spring Boot Back end app (polling-app-server)

1. **Clone the application**

```bash
git clone https://github.com/callicoder/spring-security-react-ant-design-polls-app.git
cd polling-app-server
```
```bash
git clone https://github.com/callicoder/spring-security-react-ant-design-polls-app.git
cd polling-app-server
```

2. **Create MySQL database**

```bash
create database polling_app
```
```bash
create database polling_app
```

3. **Change MySQL username and password as per your MySQL installation**

+ open `src/main/resources/application.properties` file.

+ change `spring.datasource.username` and `spring.datasource.password` properties as per your mysql installation
+ open `src/main/resources/application.properties` file.
+ change `spring.datasource.username` and `spring.datasource.password` properties as per your mysql installation

4. **Run the app**

You can run the spring boot app by typing the following command -

```bash
mvn spring-boot:run
```

The server will start on port 8080.

You can also package the application in the form of a `jar` file and then run it like so -

```bash
mvn package
java -jar target/polls-0.0.1-SNAPSHOT.jar
```

You can run the spring boot app by typing the following command -

```bash
mvn spring-boot:run
```

The server will start on port 8080.

You can also package the application in the form of a `jar` file and then run it like so -

```bash
mvn package
java -jar target/polls-0.0.1-SNAPSHOT.jar
```
5. **Default Roles**
The spring boot app uses role based authorization powered by spring security. To add the default roles in the database, I have added the following sql queries in `src/main/resources/data.sql` file. Spring boot will automatically execute this script on startup -

```sql
INSERT IGNORE INTO roles(name) VALUES('ROLE_USER');
INSERT IGNORE INTO roles(name) VALUES('ROLE_ADMIN');
```

Any new user who signs up to the app is assigned the `ROLE_USER` by default.
The spring boot app uses role based authorization powered by spring security. To add the default roles in the database, I have added the following sql queries in `src/main/resources/data.sql` file. Spring boot will automatically execute this script on startup -
```sql
INSERT IGNORE INTO roles(name) VALUES('ROLE_USER');
INSERT IGNORE INTO roles(name) VALUES('ROLE_ADMIN');
```
Any new user who signs up to the app is assigned the `ROLE_USER` by default.

## Steps to Setup the React Front end app (polling-app-client)

Expand Down
2,413 changes: 13 additions & 2,400 deletions polling-app-client/README.md

Large diffs are not rendered by default.

15 changes: 0 additions & 15 deletions polling-app-client/config-overrides.js

This file was deleted.

Loading