Introduction to the Next.js 14 App
This article introduces the Next.js 14 app, a project designed to highlight the impressive capabilities of the Next.js 14 framework. The app aims to provide a comprehensive demonstration of Next.js 14 features, while continuously being developed and improved. You can explore a live demo at nextjs14-showcase.vercel.app.
Warning This app is still under development, and users might encounter some instability.
Key Features
The Next.js 14 app is packed with features that showcase the latest in web development technology. Here's an overview:
- Next.js 14 Framework: The app is built using the latest release of Next.js, taking full advantage of its new capabilities.
- New
/app
Directory: It incorporates the structural changes introduced in this new version. - Advanced Routing: Includes routing, layouts, nested layouts, and layout groups for seamless navigation.
- Data Management: Demonstrates data fetching, caching, and mutation capabilities.
- React 18 Components: Utilizes both client and server components from React 18, enhancing interactivity and performance.
- API Routes: Integrates API routes for efficient data handling.
- Social Media Features: Provides a live social media feed equipped with likes, comments, and a profanity filter, offering a vibrant user experience.
- OpenAI API Integration: Enhances social media posts using the OpenAI API with the GPT-3.5-Turbo model, bringing advanced text generation functionality.
- OAuth 2.0 Authentication: Implements secure authentication via Google, GitHub, and Discord, powered by NextAuth.js.
- Prisma ORM: Utilizes Prisma as an Object-Relational Mapping tool for database interactions.
- Supabase PostgreSQL Database: Leverages the capabilities of Supabase for database management.
- NextUI and Tailwind CSS: UI components are crafted using NextUI v2.0 for stylish interface design, and Tailwind CSS provides extensive styling options.
- Dark Mode: Offers a dark mode theme option, supported by next-themes.
- Stripe Payments: Incorporates Stripe for handling secure payments.
- TypeScript Foundation: Built using TypeScript for static type-checking, enhancing code quality and maintainability.
Running Locally
To run the Next.js 14 app locally, follow these steps:
-
Install Dependencies
First, ensure you have all necessary dependencies by running the following command:npm install
-
Environment Setup
Copy the environment example file and update it with your local settings:cp .env.example .env.local
-
Start Development Server
Launch the development server with the command:npm run dev
Then open http://localhost:3000 in your browser to view the app.
Database Configuration
-
Database Setup
Set up a PostgreSQL database. Supabase is recommended due to its excellent free tier and ease of setup. -
Environment Configuration
Input your database URL into the.env.local
file under theDATABASE_URL
key. -
Initialize Schema
Run the following Prisma command to apply database migrations:npm run migrate:dev
Licensing
The project is distributed under the GNU Affero General Public License v3.0, ensuring openness and user freedom.
This introduction should provide a clear understanding of what the Next.js 14 app offers, its development journey, and how to get started with it locally. Enjoy exploring the advanced web capabilities it demonstrates!