Start Building
Follow these steps to quickly set up your development environment and start building your application.
If you're using the Next.js + Prisma + PostgreSQL Template
-
Install PostgreSQL locally or use a hosted database like neon.tech (opens in a new tab) or ElephantSQL (opens in a new tab).
-
Create a new database and copy the connection URL
-
Open
.env
and setDATABASE_URL
andDIRECT_URL
-
Run the following commands to create the database schema and seed data:
npx prisma migrate dev
npx prisma db seed
- Start the development server:
npm run dev
# or if using yarn
yarn dev
- Open http://localhost:3000 (opens in a new tab) with your browser to see the result.
1. If you're using the MongoDB + Mongoose Template. Pick an Option to Set Up MongoDB
Option 1: Local MongoDB
- Install MongoDB locally.
- Create a local MongoDB database.
- Copy the connection URL.
- Open
.env.local
and setMONGODB_URI
to your local MongoDB connection URL.
Option 2: MongoDB Atlas
- Create an account on MongoDB Atlas (opens in a new tab).
- Set up a new free tier cluster (opens in a new tab) using the Atlas UI.
- Create a new database and user with read and write access to the database.
- Allow access from anywhere (for development purpose) or add your IP address to the IP access list.
- Copy the connection string (opens in a new tab)
- Open
.env.local
and setMONGODB_URI
to your MongoDB Atlas connection string.
2. Send email with Resend.com
- Create a FREE account on Resend.com (opens in a new tab).
- Obtain your API key from the Resend.com dashboard.
- Open
.env.local
and setRESEND_API_KEY
to your Resend.com API key. - Visit the Authentication documentation for detailed instructions on setting up email magic link authentication.
3. Become an Admin
- Access your MongoDB database using a MongoDB client such as MongoDB Compass (opens in a new tab) or Robo 3T (opens in a new tab).
- Navigate to the "users" collection.
- Add "admin" to the array of roles for your user. Now your user should have 2 roles (["user", "admin"]).
- Refresh the app, and the "Admin" option should now appear in the navbar.
4. Start Building
With your database and authentication set up, you're ready to start building your app. Focus on your application logic and features.
Additional Configurations (Optional)
- Stripe: Add Stripe integration by following the documentation.
- OAuth Support: Integrate OAuth for Google, Github, and Facebook as needed. Refer to the respective documentation pages for each service.
Congratulations! You've successfully set up your development environment. If you have any questions or need further assistance, refer to the documentation or our community support.
Happy Coding!