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

docs: add "first steps" page and reduce h3 spacing #703

Merged
merged 17 commits into from
Nov 8, 2022
Merged
Show file tree
Hide file tree
Changes from 14 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
1 change: 1 addition & 0 deletions www/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ export const SIDEBAR: Sidebar = {
{ text: "Other Recommendations", link: "en/other-recs" },
],
Usage: [
{ text: "First Steps", link: "en/usage/first-steps" },
{ text: "Next.js", link: "en/usage/next-js" },
{ text: "TypeScript", link: "en/usage/typescript" },
{ text: "tRPC", link: "en/usage/trpc" },
Expand Down
32 changes: 32 additions & 0 deletions www/src/pages/en/usage/first-steps.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
title: First Steps
description: Getting started with your new T3 App
layout: ../../../layouts/docs.astro
---

You just scaffolded a new T3 App and are ready to go. Here is the bare minimum to get your app working.

## Database

If your app includes Prisma, make sure to run `npx prisma db push` from the root directory of your app. This command will sync your Prisma schema with your database and will generate the TypeScript types for the Prisma Client based on your schema. Note that you need to restart the TypeScript server after doing this so that it can detect the generated types.

## Authentication

If your app includes NextAuth, we get you started with the `DiscordProvider`. This is one of the simplest providers that NextAuth.js offers, but it still requires a bit of initial setup on your part.
juliusmarminge marked this conversation as resolved.
Show resolved Hide resolved

Of course, if you prefer to use a different auth provider, you can also use one of the [many providers](https://next-auth.js.org/providers/) that NextAuth.js offers.

1. You will need a Discord account, so register one if you haven't already.
2. Navigate to https://discord.com/developers/applications and click "New Application" in the top right corner. Give your application a name and agree to the Terms of Service.
3. Once your application has been created, navigate to "Settings → OAuth2 → General".
4. Copy the "Client ID" and add it to your `.env` as `DISCORD_CLIENT_ID`.
5. Click "Reset Secret", copy the new secret, and add it to your `.env` as `DISCORD_CLIENT_SECRET`.
6. Click "Add Redirect" and type in `https://localhost:3000/api/auth/callback/discord`.
nexxeln marked this conversation as resolved.
Show resolved Hide resolved
- For production deployment, follow the previous steps to create another Discord Application, but this time replace `https://localhost:3000` with the URL that you are deploying to.
7. Save Changes. You should now be able to log in.

## Next Steps

- If your app includes tRPC, check out `src/pages/index.tsx` and `src/server/trpc/router/example.ts` to see how tRPC queries work.
- Have a look around the `create-t3-app` docs, as well as the docs of the packages that your app includes.
- Join the [Discord](https://t3.gg/discord) and give us a star on [GitHub](https://github.com/t3-oss/create-t3-app)! :)
juliusmarminge marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 1 addition & 1 deletion www/src/styles/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
@apply mt-8 mb-4 text-2xl font-semibold;
}
.markdown h3 {
@apply mt-8 mb-0 text-xl font-semibold;
@apply mt-4 mb-0 text-xl font-semibold;
}
.markdown li {
@apply list-disc break-all lg:break-normal;
Expand Down