What’s Next?
Now that you have created your TNT-Powered project, you can start building your application. Here are some resources to help you get started:
Database
MySQL, PostgreSQL, or SQLite
If you have chosen to use a database with your project, you need to populate the
DATABASE_URL
environment variable in your .env
file.
# The connection string should look something like this:
DATABASE_URL="mysql://user:password@localhost:3306/database"
You can choose to run your database locally, using a service like Docker↗, or use a cloud service like Neon↗. Alternatively, you can use SQLite for local development. SQLite is the default database for TNT-Powered projects, and no additional setup is required to get started.
Prisma
We recommend using Prisma↗ to interact with your database. Prisma is a modern database toolkit that makes it easy to interact with your database using TypeScript. If you chose to include Prisma ensure you run the following commands to push your schema to your database and generate your Prisma client.
npm db:push
npm postinstall
Drizzle
Drizzle is not yet available in TNT-Powered projects.
Drizzle will be available in the future to help you manage your database schema and migrations. Drizzle cannot be used at the same time as Prisma, so you will need to choose one or the other.
Authentication
NextAuth.js
When using NextAuth.js, we have included the DiscordProvider
by default. It is
one of the simplest ways to add authentication to your application. However, you
it still needs some initial setup.
If you wish to use another provider, you can find a list of all the NextAuth.js providers here↗.
- Of course, you need a Discord account, so register one if you don’t already have one.
- Navigate to the Discord Developer Portal↗ and create a new application, by clicking on the “New Application” button.
- Give your application a name and click
Create
. - Head to the
OAuth2
section and copy theClient ID
to your.env
file. - Next click
Reset Secret
, then copy theClient Secret
to your.env
file. - Next, click
Add Redirect
and type the URL of you application followed by/api/auth/callback/discord
.- In development, this will be
http://localhost:3000/api/auth/callback/discord
. - In production, this will be
https://yourdomain.com/api/auth/callback/discord
.
- In development, this will be
- Finally, save you changes.
Now you should be able to sign in with Discord.
Extensions
We recommend using the following extensions for an optimal development experience.
Start Building
- Take a look around the project structure and familiarize yourself with the codebase.
- Read the docs to learn more details about the project and how to use it.
- Start building your application!