The Event Management System is a robust backend application built with Hono, Prisma, and PostgreSQL. It provides comprehensive functionalities for user authentication, event management, and booking systems, while enforcing a structured repository pattern and pre-commit hooks with Husky.
✅ User Authentication (Prisma & PostgreSQL)
✅ Role-Based Access Control (USER
, ADMIN
, ORGANIZER
)
✅ Event Creation & Management
✅ Event Booking System
✅ Automated Code Quality Checks (Husky)
- Framework: Hono (Fast web framework for Edge & Serverless)
- Database: PostgreSQL
- ORM: Prisma
- Linting & Formatting: ESLint, Prettier
- Pre-commit Hooks: Husky
Ensure you have the following installed:
- Node.js (
>=16.x
) - PostgreSQL (Running instance)
- Prisma CLI:
npm install -g prisma
git clone https://github.com/yourusername/event-management.git
cd event-management
npm install
cp .env.example .env
Edit .env
and update the database URL:
DATABASE_URL="postgresql://user:password@localhost:5432/eventdb"
npx prisma migrate dev --name init
npx prisma generate
npm run dev
📂 event-management/
├── prisma/ # Prisma schema & migrations
├── src/
│ ├── lib/ # Business logic for handling requests
│ ├── routes/ # API route definitions
│ ├── schema/ # Database interactions using Prisma
│ ├── util/ #Helper Functions
│ ├── index.ts/ # Hono server entry point
│
├── .husky/ # Pre-commit hooks configuration
├── .env # Environment variables
├── package.json # Dependencies & scripts
└── README.md # Documentation
POST /auth/register
– Register a new userPOST /auth/login
– Authenticate and receive a JWT
GET /User
- Checks for the user and returns user specific details
POST /events
– Create a new eventGET /events
– List all eventsGET /events/:id
– Get event detailsDELETE /events/:id
– Delete an event
POST /bookings
– Book an eventGET /bookings
– List user bookings
This project uses Husky to enforce code quality before committing.
✅ Runs ESLint and Prettier checks.
❌ Prevents commits with linting errors.
npx husky install
npm test
- Fork the repository.
- Create a feature branch:
git checkout -b feature-name
- Commit your changes:
git commit -m "Add new feature"
- Push to the branch:
git push origin feature-name
- Open a Pull Request 🚀
This project is licensed under the MIT License.
📜 Feel free to modify and distribute.