Skip to content

Commit e5cd222

Browse files
author
Eric S
authored
readme (#20)
* readme * codeblock * Update README.md image
1 parent dfac17a commit e5cd222

1 file changed

Lines changed: 43 additions & 30 deletions

File tree

README.md

Lines changed: 43 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,72 @@
1-
# Flask + Descope Authentication (and a little bit of React)
1+
![react-flask](https://github.com/descope-sample-apps/flask-react-sample-app/assets/59460685/d38a6e4c-56ff-49f5-a0f1-fdf86bd4109d)
22

3-
Using the Python framework Flask + React.js + Descope Python SDK to add and manage basic authentication and roles. The project will feature multiple pages, protected routes, and logout functionality.
3+
# Flask-React Sample app with Descope Auth
44

5-
<br>
5+
Add Descope's Python SDK to add authentication to a Flask + React.js app. The project will feature multiple pages, protected routes, and logout functionality.
66

7-
## Installing Dependencies 🛠️
7+
## ⚙️ Setup
88

9-
In the root directory of the project, run the following to install all dependencies: ```npm run setup```
9+
1. Clone the repository:
1010

11-
### Client Setup
11+
```
12+
git clone https://github.com/descope-sample-apps/flask-react-sample-app.git
13+
```
1214

13-
1. Create a ```.env``` file in the root directory of the `client` folder and add your Descope [Project ID](https://app.descope.com/settings/project) in the file: ```REACT_APP_PROJECT_ID=YOUR_DESCOPE_PROJECT_ID```
15+
2. Install dependencies:
1416

15-
> **NOTE**: If you're running your flask server on a different port than 5000, change the ```"proxy":"http://127.0.0.1:5000/"``` value to wherever your server is hosted. You can edit the proxy value in your client package.json file.
17+
```
18+
npm run setup
19+
```
1620

17-
<br>
21+
3. Client Setup
1822

19-
### Server Setup
23+
Create a ```.env``` file in the root directory of the `client` folder and add your Descope [Project ID](https://app.descope.com/settings/project) in the file:
24+
25+
```
26+
REACT_APP_PROJECT_ID="YOUR_DESCOPE_PROJECT_ID"
27+
```
28+
29+
> **NOTE**: If you're running your flask server on a different port than 5000, change the ```"proxy":"http://127.0.0.1:5000/"``` value to wherever your server is hosted. You can edit the proxy value in your client package.json file.
30+
31+
4. Server Setup
2032

2133
Since this app also showcases roles, it will require you to set them up in the Descope Console.
2234

23-
1. Create two different [roles]((https://app.descope.com/authorization)) called "teacher" and "student" <br>
24-
2. Create a ```.env``` file in the server folder and add your project id in the file:
25-
```
26-
PROJECT_ID="YOUR_DESCOPE_PROJECT_ID"
27-
```
35+
- Create two different [roles]((https://app.descope.com/authorization)) called "teacher" and "student" <br>
36+
- Create a ```.env``` file in the server folder and add your project id in the file:
37+
```
38+
PROJECT_ID="YOUR_DESCOPE_PROJECT_ID"
39+
```
2840

29-
<br>
41+
## 🔮 Running the Application
3042

31-
## Running the Application 💡
43+
To run the server:
3244

33-
Have at least 2 different terminals open, one command for each terminal. Run the following commands in the project root directory.
34-
- To run the server: ```npm run server```
35-
- To run the client: ```npm run client```
45+
```
46+
npm run server
47+
```
3648

37-
<br>
49+
To run the client:
3850

39-
## Folder Structure 📁
51+
```
52+
npm run client
53+
```
54+
55+
## 📁 Folder Structure
4056

4157
- Server: the server folder contains the flask app and server that will handle session validation
4258
- `app.py`: our main flask app
4359
- `requirements.txt`: a txt file with a list of our dependencies
4460
- Client: our react app
4561

46-
<br>
62+
## ⚠️ Issue Reporting
63+
64+
For any issues or suggestions, feel free to open an issue in the GitHub repository.
4765

48-
## What is going on? 🤔
66+
## 📜 License
4967

50-
### How do I get started with Descope?
51-
If you don't have a Descope project or unsure what a project ID is, check out the [docs](https://docs.descope.com/build/guides/gettingstarted/)
68+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
5269

53-
### What is Flask?
54-
Flask is a light-weight framework written in Python. It's super simple to get your web app started and running using Flask with just a couple of lines. To learn the basics of Flask, check out the official [documentation](https://flask.palletsprojects.com/en/2.3.x/quickstart/)<br>
5570

56-
### What is React?
57-
React is a JavaScript web framework used to create beautiful user interfaces. To learn the basics of React check out the official [documentation](https://react.dev/learn)
5871

5972

0 commit comments

Comments
 (0)