{"id":14978667,"url":"https://github.com/basemax/bookingapits","last_synced_at":"2025-10-28T11:31:51.024Z","repository":{"id":174816675,"uuid":"651192006","full_name":"BaseMax/BookingAPITS","owner":"BaseMax","description":"This is a RESTful API built using NestJS and TypeScript that enables users to reserve appointments, services, or resources through a booking system. The API provides functionality for managing availability, user authentication, and notifications for booking confirmations or reminders.","archived":false,"fork":false,"pushed_at":"2024-09-30T16:54:19.000Z","size":402,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-10-11T18:21:09.545Z","etag":null,"topics":["api","javascript","js","nest-js","nestjs","nestjs-api","restful","ts","typescript","web-service","webservice"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BaseMax.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-06-08T17:50:03.000Z","updated_at":"2024-09-30T16:54:16.000Z","dependencies_parsed_at":"2024-03-29T12:25:38.018Z","dependency_job_id":"f85106fa-73ea-4d0d-aef7-ca9ae7c0460a","html_url":"https://github.com/BaseMax/BookingAPITS","commit_stats":{"total_commits":16,"total_committers":3,"mean_commits":5.333333333333333,"dds":0.3125,"last_synced_commit":"90ca50332cd4415076187485cda5d3a539874037"},"previous_names":["basemax/bookingapits"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaseMax%2FBookingAPITS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaseMax%2FBookingAPITS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaseMax%2FBookingAPITS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaseMax%2FBookingAPITS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BaseMax","download_url":"https://codeload.github.com/BaseMax/BookingAPITS/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219859639,"owners_count":16556035,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","javascript","js","nest-js","nestjs","nestjs-api","restful","ts","typescript","web-service","webservice"],"created_at":"2024-09-24T13:58:09.966Z","updated_at":"2025-10-28T11:31:45.651Z","avatar_url":"https://github.com/BaseMax.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Booking System TypeScript API\n\nThis is a RESTful API built using NestJS and TypeScript that enables users to reserve appointments through a booking system. The API provides functionality for managing availability, user authentication, and notifications for booking confirmations or reminders.\n\n## Features\n\n- **Availability Management:** The API allows administrators to manage the availability of appointments, services, or resources. This includes defining working hours.\n\n- **User Authentication:** Users can sign up, log in, and manage their bookings through authenticated routes. Authentication ensures that only authorized users can access protected endpoints.\n\n- **Booking Reservations:** Users can reserve appointments, services, or resources by specifying the desired date, time slot, and any additional details. The API handles the validation of available slots and creates bookings accordingly.\n\n- **Notifications:** Users receive notifications for booking confirmations and reminders. This feature helps users stay informed about their upcoming reservations and reduces the risk of missed appointments.\n\n## Installation\n\n- Clone the repository: `git clone https://github.com/BaseMax/BookingGraphQLTS.git`\n- Navigate to the project directory: `cd BookingGraphQLTS`\n- Install the dependencies: `yarn install`\n\n## Configuration\n\n- Open the `.env` file and modify the configuration variables according to your needs. This may include database connection settings, authentication secrets, and email notification settings.\n\n## Database Setup\n\n- Create a database for the application.\n- Update the `DATABASE_URL` variable in the `.env` file with your database connection string.\n\n## Firebase Setup\n-create a firebase project in fire store and import configuration into firebase-adminsdk in root of the project in json format\n\n## Running the Application\n\nTo start the API server, run the following command:\n\n```\nnpm run start\n```\n\nThe server will start running on http://localhost:3000 by default. You can modify the port in the .env file.\n\n## API Documentation\n\nThe API documentation can be found at http://localhost:3000/api/swagger when the server is running. It provides detailed information about the available endpoints, request/response formats, and authentication requirements.\n\n## Testing\n\nTo run the tests for the API, use the following command:\n\n```\nnpm run test\n```\n\nThe test suite includes unit tests, integration tests, and end-to-end tests to ensure the functionality of the API.\n\n## API Routes\n\n| Route |\tMethod |\tDescription |\n| ----- | ------ | ------------ |\n| `/api/auth/signup` |\tPOST |\tRegister a new user account |\n| `/api/auth/login` |\tPOST |\tAuthenticate and log in a user |\n| `/api/auth/logout` |\tPOST |\tLog out the currently authenticated user |\n| `/api/bookings` |\tGET |\tGet all bookings (admin only) |\n| `/api/bookings` |\tPOST |\tCreate a new booking |\n| `/api/bookings/:id` |\tGET | |\tGet a specific booking by ID |\n| `/api/bookings/:id` |\tPUT |\tUpdate a specific booking by ID |\n| `/api/bookings/:id` |\tDELETE |\tDelete a specific booking by ID |\n| `/api/availability` |\tGET |\tGet availability for a specific date |\n| `/api/availability` |\tPOST | Add availability for a specific date |\n| `/api/availability/:id` |\tGET |\tGet availability by ID |\n| `/api/availability/:id` |\tPUT |\tUpdate availability by ID |\n| `/api/availability/:id` |\tDELETE |\tDelete availability by ID |\n| `/api/users` |\tGET |\tGet all users (admin only) |\n| `/api/users/:id` |\tGET |\tGet a specific user by ID |\n| `/api/users/:id` |\tPUT |\tUpdate a specific user by ID |\n| `/api/users/:id` |\tDELETE |\tDelete a specific user by ID |\n| `/api/resource` |\tPOST |\tCreating a new resource for any organization or services |\n| `/api/resource` |\tGET |\tGetting all resources available on the system |\n| `/api/resource/:id` |\tPUT |\tModifying the resource |\n| `/api/resource/:id` |\tDELETE |\tDelete a specific resource by ID |\n| `/api/notification/:id` |\tPOST |\tsending a notification to a specific user by id and title and body provided |\nThis table provides an overview of the routes available in the Booking System API, along with their associated HTTP methods and descriptions. Please note that this is just a sample and you may have additional routes or modify the existing ones based on your specific project requirements.\n\n## Models\n\n### User Model\n\n```typescript\ninterface User {\n  id: number;\n  name: string;\n  email: string;\n  password: string;\n  isAdmin: boolean;\n  bookings : Booking[];\n  notifications : Notifications[];\n  createdAt: Date;\n  updatedAt: Date;\n}\n```\n\n### Booking Model\n\n```typescript\ninterface Booking {\n  id: number;\n  userId: number;\n  resourceId: number;\n  startDate: Date;\n  endDate: Date;\n  notes: string;\n  createdAt: Date;\n  updatedAt: Date;\n}\n```\n\n### Resource Model\n\n```typescript\ninterface Resource {\n  id: number;\n  name: string;\n  description: string;\n  booking: Booking[];\n  Availability Availability[];\n  createdAt: Date;\n  updatedAt: Date;\n}\n```\n\n### Availability Model\n\n```typescript\ninterface Availability {\n  id: number;\n  resourceId: number;\n  date: Date;\n  slots: AvailabilitySlot[];\n  createdAt: Date;\n  updatedAt: Date;\n}\n\ninterface AvailabilitySlot {\n  startTime: Date;\n  endTime: Date;\n  availabilityId : number;\n}\n\ninterface Notificaiton {\n  id : number;\n  device_type:  string;\n  notification_token : string;\n  userId : number;\n  title : string;\n  body : string;\n}\n```\n\nThese models represent the entities used in the Booking System API. The User model represents a user account, the Booking model represents a booking made by a user, the Resource model represents a resource that can be booked, and the Availability model represents the availability of a resource on a specific date, divided into slots.\n\n## API JSON Examples\n\n### Sign Up Request Example\n\n```json\n{\n  \"name\": \"John Doe\",\n  \"email\": \"johndoe@example.com\",\n  \"password\": \"secretpassword\"\n}\n```\n\n### Sign Up Response Example\n\n```json\n{\n  \"user\": {\n    \"id\": 1,\n    \"name\": \"John Doe\",\n    \"email\": \"johndoe@example.com\",\n    \"isAdmin\": false,\n    \"createdAt\": \"2023-06-08T12:00:00Z\",\n    \"updatedAt\": \"2023-06-08T12:00:00Z\"\n  },\n  \"token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...\"\n}\n```\n\n### Log In Request Example\n\n```json\n{\n  \"email\": \"johndoe@example.com\",\n  \"password\": \"secretpassword\"\n}\n```\n\n### Log In Response Example\n\n```json\n{\n  \"user\": {\n    \"id\": 1,\n    \"name\": \"John Doe\",\n    \"email\": \"johndoe@example.com\",\n    \"isAdmin\": false,\n    \"createdAt\": \"2023-06-08T12:00:00Z\",\n    \"updatedAt\": \"2023-06-08T12:00:00Z\"\n  },\n  \"token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...\"\n}\n```\n\n### Create Booking Request Example\n\n```json\n{\n  \"resourceId\": 1,\n  \"startDate\": \"2023-06-10T09:00:00Z\",\n  \"endDate\": \"2023-06-10T10:00:00Z\",\n  \"notes\": \"Need a consultation\"\n}\n```\n\n### Create Booking Response Example\n\n```json\n{\n  \"booking\": {\n    \"id\": 1,\n    \"userId\": 1,\n    \"resourceId\": 1,\n    \"startDate\": \"2023-06-10T09:00:00Z\",\n    \"endDate\": \"2023-06-10T10:00:00Z\",\n    \"notes\": \"Need a consultation\",\n    \"createdAt\": \"2023-06-08T12:00:00Z\",\n    \"updatedAt\": \"2023-06-08T12:00:00Z\"\n  }\n}\n```\n\nPlease note that these examples demonstrate the structure of JSON objects, and the actual values will depend on the data you provide in your requests and receive in your responses.\n\n## API Structure Examples\n\nHere's an example of the request and response bodies for the routes in the Booking System API:\n\n### Sign Up (POST /api/auth/signup)\n\n**Request Body**\n\n```typescript\ninterface SignUpRequest {\n  name: string;\n  email: string;\n  password: string;\n}\n```\n\n**Response Body**\n\n```typescript\ninterface SignUpResponse {\n  user: User;\n  token: string;\n}\n```\n\n### Log In (POST /api/auth/login)\n\n**Request Body**\n\n```typescript\ninterface LoginRequest {\n  email: string;\n  password: string;\n}\n```\n\n**Response Body**\n\n```typescript\ninterface LoginResponse {\n  user: User;\n  token: string;\n}\n```\n\n### Log Out (POST /api/auth/logout)\n\n**No Request Body**\n\n**No Response Body**\n\n### Get All Bookings (GET /api/bookings)\n\n**No Request Body**\n\n**Response Body**\n\n```typescript\ninterface GetAllBookingsResponse {\n  bookings: Booking[];\n}\n```\n\n### Create Booking (POST /api/bookings)\n\n**Request Body**\n\n```typescript\ninterface CreateBookingRequest {\n  resourceId: number;\n  startDate: Date;\n  endDate: Date;\n  notes: string;\n}\n```\n\n**Response Body**\n\n```typescript\ninterface CreateBookingResponse {\n  booking: Booking;\n}\n```\n\n### Get Booking by ID (GET /api/bookings/:id)\n\n**No Request Body**\n\n**Response Body**\n\n```typescript\ninterface GetBookingResponse {\n  booking: Booking;\n}\n```\n\n### Update Booking by ID (PUT /api/bookings/:id)\n\n**Request Body**\n\n```typescript\ninterface UpdateBookingRequest {\n  startDate?: Date;\n  endDate?: Date;\n  notes?: string;\n}\n```\n\n**Response Body**\n\n```typescript\ninterface UpdateBookingResponse {\n  booking: Booking;\n}\n```\n\n### Delete Booking by ID (DELETE /api/bookings/:id)\n\n**No Request Body**\n\n**No Response Body**\n\n### Get Availability for Date (GET /api/availability)\n\n**Request Body**\n\n```typescript\ninterface GetAvailabilityRequest {\n  date: Date;\n}\n```\n\n**Response Body**\n\n```typescript\ninterface GetAvailabilityResponse {\n  availability: Availability[];\n}\n```\n\n### Add Availability for Date (POST /api/availability)\n\n**Request Body**\n\n```typescript\ninterface AddAvailabilityRequest {\n  resourceId: number;\n  date: Date;\n  slots: AvailabilitySlot[];\n}\n```\n\n**Response Body**\n\n```typescript\ninterface AddAvailabilityResponse {\n  availability: Availability;\n}\n```\n\n### Get Availability by ID (GET /api/availability/:id)\n\n**No Request Body**\n\n**Response Body**\n\n```typescript\ninterface GetAvailabilityResponse {\n  availability: Availability;\n}\n```\n\n### Update Availability by ID (PUT /api/availability/:id)\n\n**Request Body**\n\n```typescript\ninterface UpdateAvailabilityRequest {\n  slots?: AvailabilitySlot[];\n}\n```\n\n**Response Body**\n\n```typescript\ninterface UpdateAvailabilityResponse {\n  availability: Availability;\n}\n```\n\n### Delete Availability by ID (DELETE /api/availability/:id)\n\n**No Request Body**\n\n**No Response Body**\n\n### Get All Users (GET /api/users)\n\nNo Request Body\n\nResponse Body\n\n```typescript\ninterface GetAllUsersResponse {\n  users: User[];\n}\n```\n\n### Get User by ID (GET /api/users/:id)\n\n**No Request Body**\n\n**Response Body**\n\n```typescript\ninterface GetUserResponse {\n  user: User;\n}\n```\n\n### Update User by ID (PUT /api/users/:id)\n\n**Request Body**\n\n```typescript\ninterface UpdateUserRequest {\n  name?: string;\n  email?: string;\n  password?: string;\n}\n```\n\n**Response Body**\n\n```typescript\ninterface UpdateUserResponse {\n  user: User;\n}\n```\n\n### Delete User by ID (DELETE /api/users/:id)\n\n**No Request Body**\n\n**No Response Body**\n\nPlease note that these are just examples, and the actual request and response bodies may vary based on your specific project requirements. You can customize the request and response bodies by adding or removing fields as needed.\n\n## Contributing\n\nContributions are welcome! If you find any bugs or want to suggest new features, please open an issue or submit a pull request to the repository.\n\n## License\n\nThis project is licensed under the GPL-3.0 License.\n\nCopyright 2023, Max Base\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbasemax%2Fbookingapits","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbasemax%2Fbookingapits","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbasemax%2Fbookingapits/lists"}