EATS Backend v1
A Ruby on Rails backend for EATS, a food discovery web application developed as a phase 5 project for Flatiron School. This version provides API endpoints and database management for the EATS frontend.
About This Project
A Ruby on Rails backend for EATS, a food discovery web application developed as a phase 5 project for Flatiron School. This version provides API endpoints and database management for the EATS frontend.
KEY HIGHLIGHTS
- Modern web application built with Next.js
- Full-stack development with API integration
- User-centric design and experience
- Scalable architecture and performance
CORE FEATURES
- Personalized recommendations
- Secure authentication system
- Real-time data integration
- Responsive design
PROJECT STATS
TECH STACK
System Architecture
Scalable & Performance-Focused
Frontend Architecture
Built with modern React patterns using Next.js 14+ for optimal performance and SEO. Implemented component-based architecture with reusable UI patterns.
Backend Infrastructure
Leveraged serverless architecture with API routes and database integration. Implemented efficient data caching and real-time capabilities.
Key Technical Decisions
Engineering Choices & Rationale
Database Strategy
Chose PostgreSQL with Supabase for real-time capabilities, ACID compliance, and built-in authentication. Optimized queries with proper indexing.
Performance Optimization
Implemented ISR, image optimization, and efficient caching strategies. Achieved 95+ Lighthouse scores across all metrics.
Code Quality
TypeScript for type safety, ESLint/Prettier for consistency, and comprehensive error handling with user-friendly fallbacks.
Agile Development Methodology
User-Centered & Iterative Approach
User Research
Conducted user interviews and competitive analysis to identify pain points and opportunities.
Iterative Development
Built MVP first, then enhanced features based on user feedback and performance metrics.
Data-Driven Decisions
Used analytics and user behavior data to guide feature prioritization and improvements.
Discovery & Planning
Defined project scope, technical requirements, and user stories. Created wireframes and established development timeline with clear milestones.
Core Development
Built the foundational features with focus on clean code architecture, performance optimization, and scalable patterns.
Testing & Optimization
Comprehensive testing across devices and browsers, performance optimization, and accessibility improvements for production readiness.
Deployment & Monitoring
Production deployment with CI/CD pipeline, monitoring setup, and post-launch performance tracking and user feedback collection.
DETAILS
LINKS
TECH STACK
TAGS
EATS Backend v1
Project Overview
EATS Backend v1 was developed as part of the phase 5 project for Flatiron School in Houston, Texas. This Ruby on Rails application serves as the backend for the EATS food discovery platform, providing API endpoints and database management.
Note: This project is no longer in active development. For the latest version, please see EATS 2024.
Key Features
- RESTful API: Provides endpoints for food and restaurant data retrieval.
- Database Management: Handles data persistence for user profiles and restaurant information.
- Authentication: Implements user authentication and authorization.
- Environment Configuration: Utilizes environment variables for secure configuration management.
Technologies Used
- Framework: Ruby on Rails
- Database: PostgreSQL
- API Design: RESTful principles
- Authentication: JWT, Devise
Setup and Installation
To set up the EATS Backend v1 locally:
- Clone the repository:
git clone https://github.com/sir-udenna/rails-eats-2.git - Navigate to the project directory:
cd rails-eats-2 - Install dependencies:
bundle install - Set up environment variables:
- Create a
.envfile in the root directory (use.envEXAMPLEas a template) - Configure necessary environment variables (see Environment Variables section)
- Create a
- Set up the database:
rails db:create db:migrate - Start the server:
rails server
Important: Ensure the backend server is running before starting the frontend application for full functionality.
Available Scripts
bundle install: Installs the project's Ruby dependencies.rails server: Starts the backend server.rails db:create db:migrate: Sets up the database.rails db:seed: Populates the database with sample data (if available).
Environment Variables
Configure the following in your .env file:
DATABASE_URL: URL for your database connection.SECRET_KEY_BASE: Secret key for securing your application.
API Endpoints
(List and briefly describe the main API endpoints, e.g.:)
GET /api/restaurants: Retrieves a list of restaurants.POST /api/users: Creates a new user account.GET /api/users/:id: Retrieves user profile information.
Key Challenges & Solutions
Complex Restaurant Data Relationships
Challenge: Modeling the relationships between users, restaurants, reviews, cuisines, and location data while maintaining query performance as the dataset grew. Solution: Designed a normalized database schema with proper indexing on frequently queried fields. Implemented ActiveRecord associations with careful attention to N+1 query prevention using includes() and joins().
JWT Authentication in Rails API Mode
Challenge: Implementing secure, stateless authentication for a React frontend while learning JWT best practices and Rails API-only configuration. Solution: Built custom JWT authentication middleware with proper token expiration and refresh logic. Implemented secure password hashing with bcrypt and added role-based authorization for different user types.
API Response Time Optimization
Challenge: Restaurant search queries were taking 2-3 seconds with complex filtering and sorting, making the user experience sluggish. Solution: Added database indexes on search fields, implemented Redis caching for popular searches, and optimized SQL queries using Rails query optimization techniques. Reduced average response time to under 500ms.
Environment Configuration Management
Challenge: Managing different configurations for development, testing, and production environments while keeping sensitive data secure. Solution: Implemented comprehensive environment variable management with Rails credentials system. Created separate database configurations and API keys for each environment, with proper fallbacks and validation.
Conclusion
EATS Backend v1 demonstrates my proficiency in building robust backend systems using Ruby on Rails. This project showcases my skills in API development, database design, and backend architecture. While no longer in active development, it served as a crucial component of the EATS ecosystem and laid the groundwork for future iterations of the project.