A simple RESTful API built with Node.js, Express, and Sequelize to manage reservations for sports courts. It allows player registration, court availability management, and scheduling matches involving multiple players.
- Node.js (v18+ recommended)
- Express
- Sequelize (with SQLite for development)
- PostgreSQL (optional, for production)
- dotenv
- nodemon (for development)
git clone https://github.com/your-username/court-reservation-api.git
cd court-reservation-apinpm installCreate a .env file. For development with SQLite:
PORT=3000
DB_DIALECT=sqlite
NODE_ENV=development
JWT_SECRET_KEY=secretTo use PostgreSQL instead:
DB_DIALECT=postgres
DB_HOST=localhost
DB_PORT=5432
DB_NAME=court_reservation
DB_USER=youruser
DB_PASS=yourpasswordnpm run migrations:run
npm run seeders:run If you run the seeders, you can use admin credentials:
- Email:
[email protected] - Password:
admin123
npm run dev- User: Represents a person who participates in matches.
- Court: Represents a sports court that can host matches.
- Reservation: Represents a match scheduled for a specific date and time.
MIT
This project is ideal for practicing:
- Sequelize model creation and associations
- Many-to-many relationship handling
- Validations and constraints
- RESTful API design
- Environment configuration
- Testing with Postman or Insomnia
Happy coding! 🚀