An API to help Granblue Fantasy players create and share teams and strategies.
* Add mini_magick and rufus-scheduler * Expose attributes and add sigs to AwsService * Get Party ready for preview state * Added new fields for preview state and generated_at timestamp * Add preview state enum to model * Add preview_relevant_changes? after_commit hook * Add jobs for generating and cleaning up party previews * Add new endpoints to PartiesController * `preview` shows the preview and queues it up for generation if it doesn't exist yet * `regenerate_preview` allows the party owner to force regeneration of previews * Schedule jobs * Stalled jobs are checked every 5 minutes * Failed jobs are retried every hour * Old preview jobs are cleaned up daily * Add the preview service This is where the bulk of the work is. This service renders out the preview images bit by bit. Currently we render the party name, creator, job icon, and weapon grid. This includes signatures and some fonts. |
||
|---|---|---|
| .github | ||
| app | ||
| bin | ||
| config | ||
| db | ||
| lib | ||
| log | ||
| public | ||
| sig | ||
| spec | ||
| storage | ||
| test | ||
| tmp | ||
| vendor | ||
| .env | ||
| .gitignore | ||
| .ruby-gemset | ||
| .ruby-version | ||
| .solargraph.yml | ||
| config.ru | ||
| ENDPOINTS.md | ||
| Gemfile | ||
| Gemfile.lock | ||
| LICENSE | ||
| Rakefile | ||
| README.md | ||
Hensei API
Project Overview
Hensei is a Ruby on Rails API for managing Granblue Fantasy party configurations, providing comprehensive tools for team building, character management, and game data tracking.
Prerequisites
- Ruby 3.3.7
- Rails 8.0.1
- PostgreSQL
- AWS S3 Account (for image storage)
System Dependencies
- Ruby version manager (rbenv or RVM recommended)
- Bundler
- PostgreSQL
- Redis (for background jobs)
- ImageMagick (for image processing)
Initial Setup
1. Clone the Repository
git clone https://github.com/your-organization/hensei-api.git
cd hensei-api
2. Install Ruby
Ensure you have Ruby 3.3.7 installed. If using rbenv:
rbenv install 3.3.7
rbenv local 3.3.7
3. Install Dependencies
gem install bundler
bundle install
4. Database Configuration
- Ensure PostgreSQL is running
- Create the database configuration:
rails db:create
rails db:migrate
5. AWS S3 Configuration
Hensei requires an AWS S3 bucket for storing images. Configure your credentials:
EDITOR=vim rails credentials:edit
Add the following structure to your credentials:
aws:
s3:
bucket: your-bucket-name
access_key_id: your-access-key
secret_access_key: your-secret-key
region: your-aws-region
6. Run Initial Data Import (Optional)
rails data:import
7. Start the Server
rails server
Environment Variables
While most configurations use Rails credentials, you may need to set:
DATABASE_URLRAILS_MASTER_KEYREDIS_URL
Performance Considerations
- Use Redis for caching
- Background jobs managed by Sidekiq
- Ensure PostgreSQL is optimized for full-text search
Security
- Always use
rails credentials:editfor sensitive information - Keep your
master.keysecure and out of version control - Regularly update dependencies
Deployment
Recommended platforms:
- Railway.app (We use this)i98-i
- Heroku
- DigitalOcean App Platform
Deployment steps:
- Precompile assets:
rails assets:precompile - Run migrations:
rails db:migrate - Start the server with a production-ready web server like Puma
Troubleshooting
- Ensure all credentials are correctly set
- Check PostgreSQL and Redis connections
- Verify AWS S3 bucket permissions
License
This project is licensed under the GNU General Public License v3.0 (GPL-3.0-only) with additional non-commercial restrictions.
Key points:
- You are free to use and modify the software for non-commercial purposes
- Any modifications must be shared under the same license
- You must provide attribution to the original authors
- No warranty is provided
See the LICENSE file for full details.
Contact
For support, please open an issue on the GitHub repository.