This service is composed of three main parts:
- Web Server: Manages the main interface and API endpoints.
- Ticket CLI: Provides command-line functionalities for managing appointments.
- Shared Module: Contains utilities and functions that are commonly used across the Web Server and Ticket CLI.
Web server - service that managing appointments and invitations! This server provides a set of endpoints to manage appointments, generate QR invitations, and validate them.
- Rust and Cargo installed
- PostgreSQL Database
- Docker installed
- Proper configuration setup for email and QR services
- Clone the repository:
git clone [REPOSITORY_URL]
cd web-server
- Setup the PostgreSQL database:
docker-compose up
- Update the configuration:
export APP_ENVIRONMENT = development | production | local
- Build & Run:
cargo build && cargo run
email_client:
base_url: "https://api.postmarkapp.com"
sender_email: "[email protected]"
authorization_token: "{POSTMARK_API_KEY}"
timeout_milliseconds: 10000
qr_client:
api_url: "https://api.apilayer.com/short_url/hash"
api_key: "{APILAYER_API_KEY}"
base_url: "{WEB_SERVER_BASE_URL}/api/validations"
base_image_path: "{PATH_TO_QR_CODES_STORE}"
timeout_milliseconds: 10000
console_cli:
web_url: "http://127.0.0.1:8000" Url responsible for http communication between server and client
Don't forget that all configuration can be overwritten via ENV variables:
- prefix APP
- prefix_separator "_"
- separator("__")
For example
APP_CONSOLE_CLI__WEB_URL = "new domain"
Once the server is up and running, you can use various endpoints to manage appointments, generate QR invitations, and validate them.
Create: POST /api/appointment
Get by ID: GET /api/appointment/{id}
Delete by ID: DELETE /api/appointment/{id}
Add Invitation: POST /api/appointment/{id}/invitation`
Get by ID: GET /api/invitation/{id}
Get QR Code: GET /api/invitation/{id}/qr
Validate by ID GET /api/validations/{id}
tickets_cli
is a command-line utility designed for managing appointments. It provides a range of functionalities including appointment creation, deletion, generation of QR invitations, and sending out email invitations. With a focus on appointments, it's the go-to solution for scheduling and organization.
- User Authentication: A command specifically dedicated to handle user authentication.
- Appointment Management: Execute a range of appointment related tasks directly from your terminal.
- Create new appointments
- Delete existing appointments
- Generate QR codes for specific appointments
- Send email invitations containing QR codes
tickets_cli [OPTIONS] <SUBCOMMAND>
--auth-token
: Optional authentication token to authorize certain operations.
-
auth
: Handles user authentication. -
appointment
: Manages appointment interactions.create
: Creates a new appointment.delete
: Deletes a specified appointment. Provide the IDs of the appointments to delete using the--uuids
flag.generate
: Generates QR codes for a specified appointment. Use the--appt_id
flag to specify the appointment and--count
to indicate the number of QR codes.send
: Sends emails containing QR codes for a specific appointment. Use the--appt_id
flag to specify the appointment and--email
to list the email addresses.
- Create new
Appointment
command for appointment-related operations:
tickets_cli appointment Create
- Generate new
Invitation
command for appointment-related operations:
tickets_cli appointment generate --appt_id xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
tickets_cli appointment generate --appt_id xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx --count N
As a result, you'll get path's to genetated QR images
- To generate and send new
Invitation
by emails you can use:
tickets_cli appointment send --appt_id xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
- To remove
Appointment
you can use:
tickets_cli appointment delete
or
tickets_cli appointment delete --uuids xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx --uuids xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
tickets_cli
aims to simplify the process of appointment management. With its intuitive CLI commands, managing appointments has never been easier!