Cosmoslevel
CosmosLevel is a multilingual SaaS (Software as a Service) platform designed to cater to professionals who operate on an appointment basis. The two main types of users are professionals who offer appointments and clients who book those appointments. Although primarily aimed at professionals, they too can book appointments with other professionals within the app, essentially making them clients as well.
While CosmosLevel currently offers a robust set of features, there are plans to add more functionality in the future, such as dynamic pricing, coupons and vouchers, gift certificates, group appointment options, subscription services, and client management tools. These upcoming features aim to further enhance the flexibility, marketing potential, and overall user experience of the app.
Here are the main features of CosmosLevel:
-
Appointment Offers: Professionals can create offers for appointments. These offers can be customized with a variety of fields, including language, location (online via Google Meet or Zoom, or in-person), custom questions for clients, descriptions, cover photos, products related to the appointment, and default product options.
-
Multilingual Support: Users can create offers, products, and public profiles in multiple languages, enhancing accessibility for a global client base.
-
Integrated Conferencing Tools: The app supports integration with popular web conferencing tools like Google Meet and Zoom, making it easier for professionals to conduct online appointments.
-
Availability Management: Professionals can specify their availability through a calendar, which is connected to their appointment offers. Availability can be defined with time slots increment, date ranges, and an option to check for conflicts with existing appointments.
-
Connected Calendars: The app allows professionals to connect their Google Calendar to efficiently manage and view appointments.
-
Customization Options: Professionals can add custom URLs for their offers, decide whether to show their profiles on the booking page, and set minimum notice periods for bookings.
-
Marketing Potential: Public profiles and reviews are incorporated into the platform, increasing the visibility of professionals and offering a way to build trust with prospective clients.
-
Email Reminders: To reduce no-shows, the app can send email reminders to clients about their upcoming appointments.
-
Products Selection: Offers can include a selection of products, which clients can choose from when booking an appointment. Professionals can also set a default product for an offer.
-
Client and Professional Interaction: The platform includes a review system where clients can leave feedback for professionals. Professionals have public profiles that can showcase their services and offers.
-
Account Settings and Customization: Professionals can personalize their accounts, manage their services, and adjust settings to their preferences.
-
Privacy and Policy Compliance: CosmosLevel's terms of service outline the usage of the platform, available at the dedicated link provided by the app.
Technologies used:
- Angular 16+: A powerful framework for building highly interactive and scalable web applications.
- WebSockets: Enables real-time communication between the client and server, facilitating instant updates and seamless user experiences.
- Tailwind CSS: A utility-first CSS framework for rapid and efficient styling, promoting design consistency.
- Angular Material: A UI component library that offers pre-built, well-designed components, streamlining frontend development.
- NestJS: A framework built on top of Node.js and TypeScript, providing a robust structure for building server-side applications.
- Prisma ORM: An object-relational mapper (ORM) that simplifies database interaction, making database operations more efficient and maintainable.
- MySQL InnoDB Cluster: A highly available and scalable database system, providing robust data storage and retrieval capabilities.
- Redis with Sentinels: A high-performance in-memory data store with a built-in failover mechanism (sentinels), enhancing reliability and resilience.
- Sentry: A comprehensive error tracking platform that provides detailed insights into application errors, helping to quickly identify and resolve issues.
- Prometheus: A time-series monitoring system for collecting and storing metrics, enabling real-time performance analysis.
- Grafana: A data visualization and dashboarding tool that allows for easy interpretation of data collected by Prometheus.
- OpenReplay: A session replay tool for debugging user interactions, helping to understand user behavior and pinpoint issues within the application.
- GitHub Actions: A continuous integration and continuous delivery (CI/CD) platform that automates the deployment process, ensuring smooth and frequent updates.
- Nginx Reverse Proxy: A high-performance web server that acts as a gateway, distributing requests across multiple servers and providing load balancing capabilities.
- Horizontal Scalability: The application's backend is designed to scale horizontally, adding additional servers to handle increasing workloads and ensure high availability.
- Multi-Location Servers: Servers are strategically deployed in multiple locations to ensure redundancy and minimize the impact of regional outages.
- Tailscale VPN: A secure and reliable VPN service that allows for secure direct connections between servers, facilitating communication and data exchange.
- AI Translations: Leveraging AI models for translation services, enhancing user experience and global reach.
- NATS.io: A messaging system that enables decentralized communication between microservices, facilitating loose coupling and independent development.
- WebSockets through Redis: Enables efficient and scalable real-time communication across microservices, using Redis as a central message broker.
- Zoom, Google Calendar, Google Contacts, Google Id Provider, Stripe Checkout, Amazon S3 Storage: Pre-built integrations with popular third-party services, streamlining user workflows and enriching functionalities.
- Playwright: We switched from Cypress to Playwright for its amazing features (see here the advantages), such as the ability to open multiple windows and test full app functionality, including payments. Using Playwright for user journeys offers confidence when we implement new features. We also used Playwright to test the security and integrity of the API.
- Jest: A widely used JavaScript testing framework employed for unit testing both frontend and backend code, ensuring code quality and stability.
- Separate Private NPM Packages: A dedicated collection of reusable components and functionalities, promoting code reusability and maintainability across the application.
Benefits of the app:
Easy scheduling
Easily reschedule or cancel appointments
Receive automatic confirmations and reminders
Premium experience
Flexible payment options
Multilingual Support
Challanges that we faced:
1
Connecting the infrastructure across multiple cloud providers
We run scheduled jobs horizontally on all or specific instances of the backend: One of the issues that we faced was that we wanted the main thread of the app to not be busy with doing the cron jobs, like sending emails, synchronizing calendars, processing appointments, and cleaning images. We used BullMQ for NestJS and it worked like a charm. Now, regardless of how many instances of the backend there are, the specific instances that we wanted to run specific jobs were picked up in a distributed balanced way. This not only improved the performance by being able to scale horizontally but also brought advanced job scheduling, repeatable jobs, and improved concurrency control.
2
Monitoring performance
Because of the performance issues of our cloud provider, we learned how to monitor and detect issues before they became serious. This included:
- Monitoring the uptime of the infrastructure
- Monitoring the steal and load time of each virtual machine
- Monitoring the status of Redis and MySQL InnoDB servers
- Monitoring the application queues status and errors
- Monitoring the status of cron jobs
- Monitoring of the backend and frontend errors and logs
3
Cloud provider outages
We were lucky enough to experience issues in our development process with our cloud provider, so we learned how to deal with outages and still keep the app running. The solution included:
- MySQL InnoDB cluster
- Redis sentinels
- NATS
- Nginx Reverse proxy balancing multiple backend services
- WebSockets that keep the connections in Redis so it can be scaled on multiple backend services
4
Knowing exactly how users are using the app, so we can improve it constantly.
OpenReplay saved us and brought a world full of clarity where we could actually replay the whole user session as if we were there with the user. This was immensely helpful. For a more simple app, Sentry's replay feature can also be used.
5
Feature Flags
We integrated feature flags with OpenReplay, enabling us to quickly enable or disable features without deploying new code. This integration allows for streamlined experimentation and rapid iteration without the need for constant code deployments.
7
Multilingual Support
Implementing a system for managing multiple languages across the app interface, offers, and communication, ensuring accurate translations and localization.
8
Real-time Synchronization
Keeping calendars, availability, and appointment data synchronized across multiple users and devices in real-time. This requires robust backend infrastructure and careful handling of data updates.
9
Integration with Third-Party Services
Seamlessly integrating with external services like Google Meet, Zoom, and payment gateways while maintaining data security and user privacy. This involves API management, authentication protocols, and error handling.