Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
User Management System
A full-featured user management application built with Ruby on Rails 7.1.6, featuring admin dashboard, user import functionality, and real-time progress tracking.
🚀 Features
Admin Features
User Features
Visitor Features
🛠️ Tech Stack
📋 Prerequisites
libpq-devon Debian/Ubuntu,postgresql-devon Alpine)Note: The
pggem will be installed automatically viabundle install. Make sure PostgreSQL development libraries are installed on your system.🔧 Installation
Local Development Setup
Clone the repository
Run setup script (recommended)
This will automatically:
Or set up manually
Start the development server
The application will be available at
http://localhost:3000Docker Setup
Build and start containers
Set up the database (first time only)
docker-compose exec app rails db:create db:migrate db:seedThe application will be available at
http://localhost:3000🧪 Testing
Run all tests
Run specific test files
Test coverage
The project uses SimpleCov for test coverage reporting. After running tests, view the coverage report:
The project aims for 90%+ test coverage. Coverage reports include:
📝 Database
Default Credentials (Development)
admin@example.com/password123user@example.com/password123Database Configuration
The application uses PostgreSQL. Configuration is in
config/database.yml:user_test_developmentuser_test_testuser_test_productionDatabase Tasks
📤 User Import
CSV/Excel Format
The import feature supports CSV and Excel (.xls, .xlsx) files with the following format:
useroradminuserExample CSV
Import Process
🏗️ Project Structure
🔐 Authentication & Authorization
Authentication
Authorization
🎨 Frontend
CSS Framework
JavaScript
🔄 Background Jobs
The application uses ActiveJob for asynchronous processing:
Jobs are processed using the default queue adapter (async in development, configurable in production).
📊 Code Quality
Linters
The project uses Rubocop for code quality:
Test Coverage
Test coverage is tracked with SimpleCov. View reports in
coverage/index.htmlafter running tests.🐳 Docker
Docker Compose Services
Docker Commands
🌐 Browser Support
The application is tested and supports:
🔧 Configuration
Environment Variables
Create a
.envfile in the root directory for local development:ActionCable (Realtime)
ActionCable is configured but currently commented out in
config/application.rb. To enable:require "action_cable/engine"inconfig/application.rbconfig/cable.yml🚢 Deployment
Production Considerations
RAILS_ENV=productionSECRET_KEY_BASEDocker Production Build
docker build -t user-test:latest . docker run -p 3000:3000 \ -e RAILS_ENV=production \ -e DATABASE_URL=postgres://user:pass@host:5432/dbname \ -e SECRET_KEY_BASE=your_secret_key_base \ user-test:latest📚 API Documentation
Routes
Admin Routes (requires admin role)
GET /admin/dashboard- Admin dashboardGET /admin/users- List all usersPOST /admin/users- Create userGET /admin/users/:id- Show userPATCH /admin/users/:id- Update userDELETE /admin/users/:id- Delete userPATCH /admin/users/:id/toggle_role- Toggle user rolePOST /admin/users/import- Import users from fileGET /admin/imports/new- New import formPOST /admin/imports- Create importGET /admin/imports/:id- Show import statusUser Routes (authenticated)
GET /profile- Show own profileGET /profile/edit- Edit profile formPATCH /profile- Update profileDELETE /profile- Delete own accountPublic Routes
GET /- Home pageGET /users/sign_in- LoginPOST /users/sign_in- LoginGET /users/sign_up- RegistrationPOST /users/sign_up- Registration🐛 Troubleshooting
Database Connection Issues
Asset Compilation Issues
Test Failures
📄 License
This project is part of a technical assessment.
👥 Author
Developed as part of a Fullstack Developer technical test.
Note: This application was built following best practices including: