ββ ββββββ ββββββ ββββ ββββββ ββ ββ ββββββ ββ ββ ββββββ ββ ββ ββββββ ββ ββββββ ββββββ
ββββ ββ ββ ββ ββ ββ ββ ββ βββ ββ ββ βββ βββ ββ βββ ββ ββ ββββ ββ ββ ββ
ββ ββ ββββββ ββββββ ββ ββ ββ ββ β ββ ββ ββ β ββ ββββ ββ β ββ ββ ββββββ ββ ββ ββββββ ββ
ββββββ ββ ββ ββ ββ ββ ββ βββ ββ ββ ββ ββ ββ βββ ββ ββββββ ββ ββ
ββ ββ ββ ββ ββββ ββββββ ββ ββ ββ ββ ββ ββββββ ββ ββ ββ ββ ββ ββ ββββββ
Built with the tools and technologies:
Table of Contents
The Appointment API is a comprehensive REST API service built with Go and Gin framework, designed to manage appointments, users, and services in a multi-tenant environment. This system provides a robust backend for scheduling applications, supporting features like user authentication, appointment management, service categorization, and payment processing. It's built with scalability and security in mind, using modern Go practices and a clean architecture approach.
- π Multi-tenant Architecture: Support for multiple business entities with isolated data
- π₯ User Management: Complete user authentication and authorization system
- π Appointment Scheduling: Flexible appointment booking and management
- πΌ Service Management: Categorization and management of services
- π³ Payment Processing: Integrated payment handling system
- π± Device Management: Support for multiple devices and notifications
- βοΈ Settings Management: Customizable system settings per tenant
- π Reporting: Built-in reporting capabilities
- π CORS Support: Cross-Origin Resource Sharing enabled
- π Logging: Comprehensive logging system
- π Security: JWT-based authentication and middleware protection
βββ appointment-api/
βββ README.md
βββ admin-endpoints.md
βββ adminedit.md
βββ appointment-api
βββ cmd
β βββ server
βββ config.env
βββ endpoints.md
βββ go.mod
βββ go.sum
βββ internal
β βββ api
β βββ config
β βββ middleware
β βββ models
β βββ repository
β βββ services
βββ migrations
β βββ 001_public_schema.sql
β βββ 005_complete_tenant_schema.sql
βββ tests
βββ README.md
βββ test_runner.goAPPOINTMENT-API/
__root__
β¦Ώ __root__
File Name Summary go.sum Go module dependency checksums appointment-api Main executable binary file go.mod Go module definition and dependency management
cmd
β¦Ώ cmdserver
β¦Ώ cmd.server
File Name Summary main.go Application entry point and server initialization
migrations
β¦Ώ migrations
File Name Summary 001_public_schema.sql Initial database schema setup 005_complete_tenant_schema.sql Multi-tenant schema implementation
internal
β¦Ώ internalapi
β¦Ώ internal.api
File Name Summary auth_handler.go Authentication and authorization request handlers handlers.go Common API request handlers and utilities admin_handler.go Administrative endpoints and operations public_handler.go Public API endpoints and handlers config
β¦Ώ internal.config
File Name Summary config.go Code>β― REPLACE-ME repository
β¦Ώ internal.repository
File Name Summary payment_repository.go Code>β― REPLACE-ME contact_repository.go Code>β― REPLACE-ME device_repository.go Code>β― REPLACE-ME user_repository.go Code>β― REPLACE-ME repository.go Code>β― REPLACE-ME category_repository.go Code>β― REPLACE-ME settings_repository.go Code>β― REPLACE-ME service_repository.go Code>β― REPLACE-ME appointment_repository.go Code>β― REPLACE-ME specialist_repository.go Code>β― REPLACE-ME middleware
β¦Ώ internal.middleware
File Name Summary auth.go Authentication middleware for request validation tenant.go Multi-tenant request processing middleware logging.go Request logging and monitoring middleware cors.go Cross-Origin Resource Sharing configuration services
β¦Ώ internal.services
File Name Summary tenant_service.go Code>β― REPLACE-ME contact_service.go Code>β― REPLACE-ME category_service.go Code>β― REPLACE-ME specialist_service.go Code>β― REPLACE-ME payment_service.go Code>β― REPLACE-ME device_service.go Code>β― REPLACE-ME tenant_cache.go Code>β― REPLACE-ME user_service.go Code>β― REPLACE-ME service_service.go Code>β― REPLACE-ME upload_service.go Code>β― REPLACE-ME appointment_service.go Code>β― REPLACE-ME services.go Code>β― REPLACE-ME settings_service.go Code>β― REPLACE-ME auth_service.go Code>β― REPLACE-ME models
β¦Ώ internal.models
File Name Summary settings.go Code>β― REPLACE-ME payment.go Code>β― REPLACE-ME device.go Code>β― REPLACE-ME category.go Code>β― REPLACE-ME user.go Code>β― REPLACE-ME report.go Code>β― REPLACE-ME contact.go Code>β― REPLACE-ME tenant.go Code>β― REPLACE-ME appointment.go Code>β― REPLACE-ME
This project requires the following dependencies:
- Programming Language: Go
- Package Manager: Go modules
Build appointment-api from the source and intsall dependencies:
-
Clone the repository:
β― git clone https://github.com/cevrimxe/appointment-api
-
Navigate to the project directory:
β― cd appointment-api -
Install the dependencies:
β― go mod download
-
Build the project:
β― go build ./cmd/server
-
Configure your environment: Create a
config.envfile in the root directory with your configuration settings. Here's an example:# Database Configuration DB_HOST=localhost DB_PORT=5432 DB_USER=postgres DB_PASSWORD=your_password DB_NAME=appointment_db DB_SSLMODE=disable # Server Configuration SERVER_PORT=8080 # JWT Configuration JWT_SECRET=your-secret-key # App Configuration APP_ENV=development APP_DEBUG=true # Cloudinary Configuration (Optional - for file uploads) CLOUDINARY_CLOUD_NAME=your_cloud_name CLOUDINARY_API_KEY=your_api_key CLOUDINARY_API_SECRET=your_api_secret
-
Start the server:
β― ./appointment-api
Or run directly with Go:
β― go run ./cmd/server
-
Access the API: The API will be available at
http://localhost:8080by default (or the port specified in your config)
Appointment-api uses Go's built-in testing package with testify assertions for enhanced testing capabilities. Run the test suite with:
Using go modules:
go test ./...-
v1.0.0:Core API implementation with basic appointment and user management -
v1.1.0: Advanced scheduling features with recurring appointments -
v1.2.0: Enhanced reporting and analytics -
v1.3.0: Mobile app integration with push notifications -
v2.0.0: Real-time scheduling and instant notifications
- π¬ Join the Discussions: Share your insights, provide feedback, or ask questions.
- π Report Issues: Submit bugs found or log feature requests for the
appointment-apiproject. - π‘ Submit Pull Requests: Review open PRs, and submit your own PRs.
Contributing Guidelines
- Fork the Repository: Start by forking the project repository to your github account.
- Clone Locally: Clone the forked repository to your local machine using a git client.
git clone https://github.com/cevrimxe/appointment-api
- Create a New Branch: Always work on a new branch, giving it a descriptive name.
git checkout -b new-feature-x
- Make Your Changes: Develop and test your changes locally.
- Commit Your Changes: Commit with a clear message describing your updates.
git commit -m 'Implemented new feature x.' - Push to github: Push the changes to your forked repository.
git push origin new-feature-x
- Submit a Pull Request: Create a PR against the original project repository. Clearly describe the changes and their motivations.
- Review: Once your PR is reviewed and approved, it will be merged into the main branch. Congratulations on your contribution!
Appointment-api is protected under the LICENSE License. For more details, refer to the LICENSE file.
- Thanks to the Go community for excellent documentation and support
- Gin Web Framework for providing a robust foundation
- JWT-Go for secure authentication
- All contributors who have helped shape and improve this project
- Special thanks to the open source community for inspiration and shared knowledge