Persogen is a Rails-based API designed to help developers create realistic mock profiles for testing and development. It’s secure, straightforward, and tailored to make your workflow smoother.
- Purpose: Quickly generate single or bulk person profiles for your projects
- Built With: Rails 7.1.3, Ruby 3.3.4, PostgreSQL
- Security: Robust JWT authentication, powered by Devise
- Generate up to 100 realistic profiles with personal, professional, and financial details.
- Secure JWT authentication and account management with Devise.
- RESTful API with consistent structure and comprehensive test coverage.
Before you start, make sure you have:
- Ruby 3.3.4 or newer
- PostgreSQL 9.5 or higher
- Bundler gem
-
Clone the Repository
git clone https://github.com/yourusername/persogen.git cd persogen -
Install Dependencies
bundle install
-
Set Up the Database
rails db:create rails db:migrate
-
Start the Server
rails server
-
Verify Installation
Visit
http://localhost:3000to confirm the API is up and running.
Sign up to get started.
POST /signup
Content-Type: application/json
{
"user": {
"email": "user@example.com",
"password": "SecurePass123!",
"password_confirmation": "SecurePass123!"
}
}POST /login
Content-Type: application/json
{
"user": {
"email": "user@example.com",
"password": "SecurePass123!"
}
}The token will be in the response headers under Authorization. You’ll need this token for all API requests.
GET /api/v1/person
Authorization: Bearer your_jwt_token_here Example Response:
{
"data": [{
"name": "Richard Stamm",
"email": "edison.stiedemann@kutch.example",
"address": {
"street": "993 Earlene Radial",
"city": "Pourosville",
"state": "Mississippi",
"country": "Guyana",
"zip_code": "59029-1260"
},
"phone": "132-694-1497",
"job": "Legacy Farming Technician",
"company": {
"name": "Kulas LLC",
"industry": "Shipbuilding"
},
"social_media": {
"twitter": "man_borerman_borer",
"linkedin": "keneth.marvin"
},
"date_of_birth": "1966-06-10",
"credit_card": {
"number": "58194442128665567",
"expiry_date": "2027-12-31"
}
}]
}GET /api/v1/people?count=10
Authorization: Bearer your_jwt_token_here 💡 Tip: Keep your token secure and always include it in the Authorization header for API requests.
We’ve included RSpec tests for reliability:
bundle exec rspec Tested Areas:
- User authentication
- Profile generation endpoints
- Error scenarios
Coverage & CI:
- SimpleCov for test coverage tracking
- CircleCI for continuous integration
- Docker support
- Customizable profile fields
- Export profiles to JSON/CSV
- Swagger-based API documentation
- Rate limiting to handle heavy traffic
- Caching for faster responses
This project is available under the MIT License.