Welcome to Padel Club, a Next.js 15 project designed to manage a padel club platform. This project includes server actions, user authentication, a customizable dashboard, and reusable UI components, built with a modular and scalable architecture.
-
🔐 Authentication System:
- Login and Registration with secure password hashing (using bcrypt).
- Session management through NextAuth.js.
-
🖥️ Dashboard:
- Modular design for user-specific features.
- Extensible structure to support future enhancements.
-
🎨 Reusable UI Components:
- Buttons, forms, alerts, and inputs built with accessibility in mind.
- Easily customizable for scaling.
-
⚙️ Backend Integration:
- Prisma as the ORM for database interactions.
- Structured repositories for clean and maintainable database queries.
-
🛠️ Scalable Architecture:
- Clear separation of concerns with actions, repositories, services, and hooks.
padel-club/
├── actions/ # Server actions for handling requests
│ ├── login-action.ts
│ ├── register-action.ts
├── app/ # Next.js app directory for pages and layouts
│ ├── auth/
│ │ ├── login/
│ │ └── register/
│ ├── dashboard/
│ ├── fonts/ # Custom fonts
│ └── layout.tsx # Global layout
├── components/ # Reusable UI and feature components
│ ├── auth/ # Authentication-specific components
│ ├── home/ # Components for the homepage
│ └── ui/ # Core UI components
├── hooks/ # Custom React hooks
│ └── use-action-response.ts
├── lib/ # Shared logic and utilities
│ ├── repositories/ # Database interaction logic
│ ├── services/ # Business logic (e.g., auth services)
│ └── utils/ # General utilities (e.g., Prisma config)
├── prisma/ # Prisma schema and migrations
│ ├── schema.prisma # Database schema
│ ├── seed.ts # Seed data for the database
│ └── seed-utils.ts # Utilities for database seeding
├── public/ # Public assets (e.g., images, fonts)
├── schemas/ # Validation schemas (Zod)
│ ├── login-schema.ts
│ └── register-schema.ts
├── types/ # Type definitions
│ ├── action-response.ts
│ ├── repository.ts
│ ├── user.ts
│ └── next-auth.d.ts
├── .env.example # Example environment variables
├── README.md # Project documentation
└── tsconfig.json # TypeScript configuration
git clone https://github.com/your-username/padel-club.git
cd padel-club
npm install
- Create a
.env
file in the root directory. - Use
.env.example
as a template and fill in your credentials.
Ensure Prisma is set up correctly:
npx prisma migrate dev
To populate the database with test data:
npx ts-node prisma/seed.ts
npm run dev
Visit http://localhost:3000 to view the app.
- Frontend: Next.js, React, TailwindCSS
- Backend: Prisma ORM, Server Actions (Next.js 15)
- Database: MySQL/PostgreSQL (configurable)
- Authentication: Auth.js
- Validation: Zod
Script | Description |
---|---|
npm run dev |
Runs the development server |
npm run build |
Builds the production-ready application |
npm run start |
Starts the application in production mode |
npx prisma studio |
Opens Prisma Studio to manage the database |
Contributions are welcome! Please follow these steps to contribute:
- Fork the repository.
- Create a new branch:
git checkout -b feature/your-feature-name
. - Make your changes and commit them:
git commit -m 'Add some feature'
. - Push to your branch:
git push origin feature/your-feature-name
. - Open a pull request.
This project is licensed under the MIT License.
For questions or feedback, feel free to open an issue.