|
1 | | -# SolidStart |
| 1 | +# SolidStart Template |
2 | 2 |
|
3 | | -Everything you need to build a Solid project, powered by [`solid-start`](https://start.solidjs.com); |
| 3 | +The **with-auth** example demonstrates native, context-based authentication featuring OAuth and email-password login. |
4 | 4 |
|
5 | | -## Creating a project |
| 5 | +## Installation |
6 | 6 |
|
7 | | -```bash |
8 | | -# create a new project in the current directory |
9 | | -npm init solid@latest |
| 7 | +Generate the **with-auth** template using your preferred package manager |
10 | 8 |
|
11 | | -# create a new project in my-app |
12 | | -npm init solid@latest my-app |
| 9 | +```bash |
| 10 | +# using npm |
| 11 | +npm create solid@latest -- -s -t with-auth |
13 | 12 | ``` |
14 | 13 |
|
15 | | -## Developing |
16 | | - |
17 | | -Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server: |
18 | | - |
19 | 14 | ```bash |
20 | | -npm run dev |
21 | | - |
22 | | -# or start the server and open the app in a new browser tab |
23 | | -npm run dev -- --open |
| 15 | +# using pnpm |
| 16 | +pnpm create solid@latest -s -t with-auth |
24 | 17 | ``` |
25 | 18 |
|
26 | | -## Env Vars |
27 | | - |
28 | | -Rename the example file and add your Discord OAuth credentials: |
29 | | - |
30 | 19 | ```bash |
31 | | -# rename example environment file |
32 | | -cp .env.example .env |
| 20 | +# using bun |
| 21 | +bun create solid@latest --s --t with-auth |
33 | 22 | ``` |
34 | 23 |
|
35 | | -Edit `.env` with your values: |
| 24 | +## Configuration |
36 | 25 |
|
37 | | -```dotenv |
38 | | -DISCORD_ID=your-discord-client-id |
39 | | -DISCORD_SECRET=your-discord-client-secret |
40 | | -``` |
| 26 | +1. Rename `.env.example` to `.env` |
41 | 27 |
|
42 | | -1. Create an application at [https://discord.com/developers/applications](https://discord.com/developers/applications) to obtain your client ID and secret. |
43 | | -2. In the app's **OAuth2 → Redirects** settings, add: |
| 28 | +2. For Discord OAuth2 to work, update `.env` with your credentials: |
44 | 29 |
|
45 | | - ```text |
46 | | - http://localhost:3000/api/oauth/discord |
| 30 | + ```dotenv |
| 31 | + DISCORD_ID=your-discord-client-id |
| 32 | + DISCORD_SECRET=your-discord-client-secret |
47 | 33 | ``` |
48 | 34 |
|
49 | | -For more details on the [start-oauth](https://github.com/thomasbuilds/start-oauth) integration, see the repository. |
50 | | - |
51 | | -## Building |
52 | | - |
53 | | -Solid apps are built with _presets_, which optimise your project for deployment to different environments. |
| 35 | + - Create a Discord application at [discord.com/developers/applications](https://discord.com/developers/applications) to get your Client ID and Secret. |
| 36 | + - In the app's **OAuth2 → URL Generator** or **Redirects** section, add the following redirect URI: |
| 37 | + ``` |
| 38 | + http://localhost:3000/api/oauth/discord |
| 39 | + ``` |
54 | 40 |
|
55 | | -By default, `npm run build` will generate a Node app that you can run with `npm start`. To use a different preset, add it to the `devDependencies` in `package.json` and specify in your `app.config.js`. |
| 41 | +3. To configure additional providers, refer to the [start-oauth](https://github.com/thomasbuilds/start-oauth#README) documentation |
0 commit comments