Skip to content

Commit 2d5a89b

Browse files
author
Ming Chi
committed
Add client README with Discord OAuth instructions
1 parent 1345d9a commit 2d5a89b

4 files changed

Lines changed: 118 additions & 1 deletion

File tree

client/README.md

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
# Getting Started with Create React App
2+
3+
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
4+
5+
## Available Scripts
6+
7+
In the project directory, you can run:
8+
9+
### `npm start`
10+
11+
Runs the app in the development mode.\
12+
Open [http://localhost:3000](http://localhost:3000) to view it in your browser.
13+
14+
The page will reload when you make changes.\
15+
You may also see any lint errors in the console.
16+
17+
### `npm test`
18+
19+
Launches the test runner in the interactive watch mode.\
20+
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
21+
22+
### `npm run build`
23+
24+
Builds the app for production to the `build` folder.\
25+
It correctly bundles React in production mode and optimizes the build for the best performance.
26+
27+
The build is minified and the filenames include the hashes.\
28+
Your app is ready to be deployed!
29+
30+
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
31+
32+
### `npm run eject`
33+
34+
**Note: this is a one-way operation. Once you `eject`, you can't go back!**
35+
36+
If you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
37+
38+
Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.
39+
40+
You don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.
41+
42+
## Learn More
43+
44+
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
45+
46+
To learn React, check out the [React documentation](https://reactjs.org/).
47+
48+
### Code Splitting
49+
50+
This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)
51+
52+
### Analyzing the Bundle Size
53+
54+
This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)
55+
56+
### Making a Progressive Web App
57+
58+
This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)
59+
60+
### Advanced Configuration
61+
62+
This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)
63+
64+
### Deployment
65+
66+
This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)
67+
68+
### `npm run build` fails to minify
69+
70+
This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)
71+
72+
To run the app locally with Discord authentication, you'll need your own Discord OAuth credentials. Follow the steps below to create a Discord app and configure it for local development. **You do not need to message an admin for a client secret.**
73+
74+
Test: Discord setup instructions in progress
75+
76+
### 1. Create a New Discord Application
77+
78+
- Visit the [Discord Developer Portal](https://discord.com/developers/applications).
79+
- Click **"New Application"**.
80+
- Name your application (e.g., `Together Local`) and click **"Create"**.
81+
82+
![Create new Discord app](./docs/images/discord-new-app.png)
83+
84+
### 2. Configure OAuth2
85+
86+
- In your newly created app, go to the **OAuth2** tab.
87+
- Scroll down to **Redirects** and add this URL:
88+
89+
- Click **Save Changes**.
90+
91+
![Set redirect URI](./docs/images/discord-redirect-uri.png)
92+
93+
### 3. Retrieve Your Credentials
94+
95+
- Go to the **General Information** tab.
96+
- Copy your **Client ID** and **Client Secret**.
97+
98+
![Client ID and Secret](./docs/images/discord-client-credentials.png)
99+
100+
### 4. Update Your `.env` File
101+
102+
Create or update your `.env` file (in the root or `server/` folder):
103+
104+
DISCORD_CLIENT_ID=your_client_id_here
105+
DISCORD_CLIENT_SECRET=your_client_secret_here
106+
107+
108+
109+
> 💡 Make sure `.env` is listed in `.gitignore`.
110+
111+
### 5. Run the App
112+
113+
```bash
114+
npm run dev-concurrent
115+
116+
Visit http://localhost:3000 to test Discord login locally!
117+
349 KB
Loading

docs/images/discord-new-app.png

237 KB
Loading

server/.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ DISCORD_CLIENT_ID=1039303417199345684
77
DISCORD_CLIENT_SECRET=DISCORD_CLIENT_SECRET
88
OAUTH_REDIRECT_URL=http://localhost:3000/
99
MOCK_USER=true
10-
NODE_ENV=development
10+
NODE_ENV=testuser#1234

0 commit comments

Comments
 (0)