A modern, robust authentication system built with Next.js 15 (App Router) and Oracle Database. This project features a stunning, high-performance UI with secure server-side session management.
- Secure Authentication: Password hashing using
bcrypt. - Persistent Sessions: HTTP-only cookie-based session management.
- Oracle DB Integration: Direct connection using the
oracledbdriver. - PL/SQL Stored Procedures: Optimized user creation using database-side logic.
- Premium UI/UX:
- Glassmorphism design system.
- Smooth transitions with
framer-motion. - Dynamic tab switching between Login and Registration.
- Real-time form validation with
react-hook-formandzod.
- Smart Logic:
- Automatically detects existing users during signup and switches to login without losing data.
- Server-side redirects for protected routes.
- Comprehensive SEO: Custom SEO component with JSON-LD structured data and OpenGraph support.
- Framework: Next.js 15
- Language: TypeScript
- Database: Oracle Database (XE/Enterprise)
- Styling: Tailwind CSS
- Animations: Framer Motion
- Form Handling: React Hook Form + Zod
- Security: Bcrypt + HTTP-only Cookies
├── app/
│ ├── api/
│ │ ├── signin/route.ts # Login logic & cookie creation
│ │ └── signup/route.ts # Registration & duplicate checks
│ ├── welcome/ # Protected welcome page
│ ├── layout.tsx # Root layout with SEO
│ └── page.tsx # Home page with Login/Register form
├── components/
│ ├── LoginForm.tsx # Main interactive auth component
│ └── SEO.tsx # Advanced metadata manager
├── libs/
│ └── db.ts # Oracle DB connection config
├── sql/ # Database scripts
│ ├── tables.sql # User table definition
│ └── procedures.sql # Stored procedures for user management
└── public/ # Static assets
Ensure you have an Oracle Database instance running. Run the scripts in the sql/ folder in the following order:
tables.sql(Creates theuserstable)procedures.sql(Creates theinsert_userprocedure)
Update the libs/db.ts file with your Oracle DB credentials:
export const dbConfig = {
user: "YOUR_USERNAME",
password: "YOUR_PASSWORD",
connectString: "localhost:1521/XE", // Or your TNS connection string
}Install the dependencies using pnpm (recommended) or npm:
pnpm installStart the development server:
pnpm dev- HTTP-Only Cookies: Prevents XSS attacks from stole session tokens.
- Password Salting: Uses 10 rounds of salt with Bcrypt.
- Input Validation: Strict Zod schemas for both client and server-side validation.
- Server-Side Protection: Route guarding using Next.js Middleware/Server Components.
Built with ❤️ by RixelDev.