Next.js Projekt Einrichtung
Erstellen Sie eine moderne Webanwendung mit Next.js 14+.
Setup Steps
1. Create a new Next.js project:
npx create-next-app@latest project-name2. Options during setup:
- TypeScript: Yes
- ESLint: Yes
- Tailwind CSS: Yes
- src/ directory: Yes
- App Router: Yes
- Import alias: @/*
3. Navigate to the project directory:
cd project-name4. Start the development server:
npm run dev5. Open http://localhost:3000 in your browser
6. Create a page (App Router):
mkdir -p src/app/aboutCreate page file: src/app/about/page.tsx
7. Create an API Route:
mkdir -p src/app/api/helloRoute file: src/app/api/hello/route.ts
8. Production build:
npm run build
npm start9. Environment variables (.env.local):
DATABASE_URL="..."
NEXT_PUBLIC_API_URL="..."Related Guides
Linux VPS Server Einrichtung (Ubuntu)
Konfigurieren Sie Ihren Ubuntu-basierten VPS-Server von Grund auf.
Apache Webserver Einrichtung
Installieren Sie den Apache HTTP-Server und konfigurieren Sie virtuelle Hosts.
Nginx Webserver Einrichtung
Installieren Sie den Nginx-Webserver und konfigurieren Sie ihn als Reverse Proxy.
Let's Encrypt SSL-Zertifikat
Holen Sie sich ein kostenloses SSL/TLS-Zertifikat mit Certbot.