Skip to content

An API built with Express and Sequelize to manage the reservation of sports courts, supporting features like player registration, court availability, and scheduling matches with multiple players.

License

Notifications You must be signed in to change notification settings

rafaelmm899/court-reservation-api

Repository files navigation

Court Reservation API

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.

📚 Technologies

  • Node.js (v18+ recommended)
  • Express
  • Sequelize (with SQLite for development)
  • PostgreSQL (optional, for production)
  • dotenv
  • nodemon (for development)

🛠️ Setup Instructions

1. Clone the repository

git clone https://github.com/your-username/court-reservation-api.git
cd court-reservation-api

2. Install dependencies

npm install

3. Configure environment

Create a .env file. For development with SQLite:

PORT=3000
DB_DIALECT=sqlite
NODE_ENV=development
JWT_SECRET_KEY=secret

To use PostgreSQL instead:

DB_DIALECT=postgres
DB_HOST=localhost
DB_PORT=5432
DB_NAME=court_reservation
DB_USER=youruser
DB_PASS=yourpassword

4. Run migrations & seed data (optional)

npm run migrations:run
npm run seeders:run 

If you run the seeders, you can use admin credentials:

5. Start the server

npm run dev

🧱 API Structure

Entities & Relationships

  • 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.

📌 License

MIT


🧪 Notes

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! 🚀

About

An API built with Express and Sequelize to manage the reservation of sports courts, supporting features like player registration, court availability, and scheduling matches with multiple players.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published