Get Started — Ship Fast ⚡️
Hey it's Marc 👋
At the end of this tutorial, you will have a fully functional app, able to login/logout users, accept payments, make API calls, send emails, and more.
If there's anything, you can reach out on Twitter. Let's build that startup, FAST ⚡️
Project structure
It's a typical NextJS project:
- /pages for your pages (1 file = 1 page)
- /pages/api for API calls (1 file = 1 API endpoint)
- /components for React compoents you reuse accross pages
- /libs for external libraries functions, like mongoDB, Stripe, Mailgun
- /models where your mongoose models live
- /hooks custom React hooks to simplify your life
The config.js file
It is where you configure your app. Each key is documented to know how and why it's used.
Have a thorough look at it: it is the backbone of the app.
The .env file
Copy the file .env.example and rename it to .env.local for development and .env in production. Please note that you should not commit those to GitHub.
File content should look like this.
NEXTAUTH_URL= NEXTAUTH_SECRET= GOOGLE_ID= GOOGLE_SECRET= EMAIL_SERVER= MAILGUN_API_KEY= MONGODB_URI= STRIPE_PUBLIC_KEY= STRIPE_SECRET_KEY= STRIPE_WEBHOOK_SECRET=
Now go ahead and follow the tutorials one-by-one.
Ship it! 🚀