This repository represents the Rails backend for a delivery application, including a data management interface for users with admin and developer roles.
🔗 Related Repositories
- 🛒 Consumy Application - Consumer application
- 👨💼 Seller Application - Seller application
- 💲 Paymenty API - Payment API
🔍 Click to expand the details of the Gems and Concepts
-
Background Processing: Utilization of Sidekiq for asynchronous task processing. Redis is used as a storage queue for these tasks.
-
Pagination: Implementation of pagination for resource listing using the Kaminari gem.
-
Testing with RSpec and Shoulda Matchers: Utilization of RSpec to write unit, integration, and functional tests.
-
Test Coverage with SimpleCov: Integration with the SimpleCov gem for code coverage analysis.
-
Soft Delete with Discard: Implementation of soft delete using the Discard gem.
-
Bullet for N+1 Queries Detection: The Bullet gem is used to detect and prevent performance issues such as N+1 queries.
-
Data Anonymization: Application of techniques to anonymize sensitive data, ensuring compliance with privacy and security regulations, such as the LGPD.
-
RESTful API: Development of a RESTful API that follows software architecture principles to allow efficient communication between the backend and frontend.
-
Swagger: Automatic documentation of the API using the Rswag gem (based on Swagger).
-
Docker: Containerization option using Docker to facilitate development, testing, and deployment.
-
Image Manipulation: Utilization of the ImageProcessing gem for image manipulation, such as resizing and compression.
-
WebSockets and SSE: Implementation of real-time communication using WebSockets.
-
Distance Calculation: Utilization of the Geocoder gem to implement distance calculation between the customer and the commercial establishment.
-
Threads: Use of threads to improve concurrency and performance of the application in parallel operations.
-
Session Management and Authentication: Implementation of user authentication with Devise and authentication via JWT.
-
CORS Control: Utilization of the rack-cors gem to manage CORS permissions.
-
State Machines with State Machines: Utilization of the state_machines-activerecord gem to implement state machines in ActiveRecord models.
-
Faraday for Consuming External APIs: Integration with external services using the Faraday gem.
-
Task Automation and DevOps: DevOps structure is supported by tools like Sidekiq and Docker.
🛠️ With Docker
- Make sure you have Docker and Docker Compose installed on your machine.
- Docker
- Docker Compose
-
Clone the related repositories:
git clone https://github.com/SamuelRocha91/consumy.git git clone https://github.com/SamuelRocha91/seller_application.git git clone https://github.com/SamuelRocha91/paymenty.git git clone https://github.com/SamuelRocha91/delivery_back.git
-
Download the
docker-compose.yml
file: -
In the root of the project, run the following command:
docker-compose up --build
-
Click on "RUN PENDING MIGRATES" in the backend application.
-
Enter the backend container and run the seeds:
docker exec -it backendContainerName /bin/sh rails db:seed
-
Configure the environment variables:
JWT_SECRET_KEY=xxxxxxxxxxxxxxxxxxxxx
-
Restart the containers for the variables to be loaded.
🛠️ Without Docker
-
Make sure you have Redis and Sidekiq configured and running locally.
-
Install the R dependencies:
install.packages("FactoMineR") install.packages("ggplot2") install.packages("reshape2")
bundle install
Create the database and run migrations:
rails db:create
rails db:migrate
rails server
bundle exec rspec
redis-server
bundle exec sidekiq
📝 Other Projects
- 📏 React Precision Application - Registration interface for gas and water measurements
- 🤖 Node API - API for measuring and registering consumption