A Ruby on Rails application that manages freight logistics and automated email communications between carriers and shippers.
- Automated email parsing and processing
- Quote management system
- Carrier profile management
- Shipment tracking
- Real-time notifications
- User authentication and authorization
- API integrations for logistics
graph TD
A[Email Receiver] -->|Parse| B[Email Parser]
B --> C{Message Type}
C -->|Quote Request| D[Quote Processor]
C -->|Status Update| E[Status Handler]
C -->|Document| F[Document Handler]
D --> G[Carrier Matching]
G --> H[Quote Distribution]
H --> I[Response Collection]
E --> J[Shipment Tracker]
F --> K[Document Storage]
erDiagram
User ||--o{ Shipment : manages
Carrier ||--o{ CarrierQuote : provides
Carrier ||--|| CarrierProfile : has
Shipment ||--o{ QuoteResponse : receives
CarrierQuote ||--|| QuoteResponse : generates
User {
string email
string encrypted_password
string role
datetime timestamps
}
Carrier {
string name
string email
string status
datetime timestamps
}
Shipment {
string status
string origin
string destination
float weight
datetime pickup_date
datetime delivery_date
}
CarrierQuote {
float price
string terms
string status
datetime expiry
}
sequenceDiagram
participant E as External Email
participant S as System
participant P as Parser
participant D as Database
participant C as Carrier
E->>S: Send Email
S->>P: Parse Content
P->>D: Store Data
alt is quote request
D->>C: Send to Matched Carriers
C->>S: Submit Quote
S->>D: Store Quote
else is status update
P->>D: Update Shipment Status
end
- Ruby 3.1.2
- Rails 7.2.2
- PostgreSQL
- Node.js & Yarn
- Redis (for background jobs)
- Clone the repository:
git clone [repository-url]- Install dependencies:
bundle install
yarn install- Setup database:
rails db:create db:migrate- Set up environment variables:
cp .env.example .env
# Edit .env with your credentials- Start the servers:
./bin/devThe application requires several environment variables to be set:
DATABASE_URL: PostgreSQL connection stringREDIS_URL: Redis connection stringMAILGUN_API_KEY: For email processingAWS_ACCESS_KEY_ID: For document storageAWS_SECRET_ACCESS_KEY: For document storageAWS_REGION: For AWS services
The application uses RSpec for testing. Run the test suite with:
bundle exec rspecThe application is configured for deployment on Heroku:
- Create a new Heroku application
- Set up required buildpacks
- Configure environment variables
- Deploy using Git
git push heroku maingraph LR
A[Application] --> B[Logging]
A --> C[Error Tracking]
A --> D[Performance Monitoring]
B --> E[Log Aggregation]
C --> F[Exception Notification]
D --> G[APM Dashboard]
- Framework: Ruby on Rails 7.2.2
- Database: PostgreSQL
- Background Jobs: Sidekiq
- Frontend: Hotwire (Turbo + Stimulus)
- Styling: Tailwind CSS
- Testing: RSpec
- Email Processing: Mailgun
- Storage: AWS S3
- Caching: Redis
- Deployment: Heroku
- Authentication using Devise
- Authorization using Pundit
- CSRF protection
- SQL injection prevention
- XSS protection
- Rate limiting
- Input sanitization
- Enhanced carrier matching algorithm
- Real-time tracking integration
- Machine learning for price optimization
- Mobile application
- Blockchain integration for document verification
This project is licensed under the MIT License - see the LICENSE.md file for details.
Please read CONTRIBUTING.md for details on our code of conduct and the process for submitting pull requests.