Skip to content
khaledalamPublic

About

A full-stack application (Laravel/React) that integrates with the Rebrickable API to allow users to search, manage, and customize LEGO sets by adding or modifying parts within their personal set lists.

Resources

Stars

2 stars

Watchers

2 watching

Forks

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

LEGO Set Manager 🏗️🔧

A full-stack application that integrates with the Rebrickable API to allow users to search, manage, and customize LEGO sets by adding or modifying parts within their personal set lists.


📺 Demo Video

🔗 Watch the Demo


📂 Core Main Files

These are the key files that handle the core logic of the application:

📌 Backend (Laravel)

  • lego-backend/.env → Environment configuration (API keys, database, etc.)
  • lego-backend/app/Providers/AppServiceProvider.php → Ensure the env values are valid in boot()
  • lego-backend/routes/api.php → API route definitions
  • lego-backend/app/Http/Controllers/LegoController.php → Main controller handling API requests

📌 Frontend (React)

  • lego-frontend/src/api/legoApi.js → API calls and request handling
  • lego-frontend/src/App.js → Main React component for UI and logic

🚀 Features Implemented

✅ Basic User Authentication (to generate user token)
✅ Fetch User's Set Lists and cache results for performance
✅ Create a New User Set List (if none exist)
✅ Fetch Sets in Selected User Lists
✅ CRUD Operations on Sets in User Lists
✅ Search & Add Global LEGO Sets
✅ Fetch & Search Parts of LEGO Sets


⏳ Upcoming Features

  • CRUD for User’s Set Lists
  • CRUD for Parts within User’s Sets
  • Pagination for Improved Performance
  • Search by LEGO Part Names
  • Double Confirmation Dialogs Before Actions
  • Refactor UI into Modular Components
  • Serialize Backend 3rd-Party API Responses into Models
  • Dockerize the Setup for Easy Deployment

🛠️ Setup Guide

Backend Setup (Laravel)

  1. Clone the Repository

    git clone git@github.com:khaledalam/lego.git
  2. Navigate to the Backend Directory

    cd lego-backend
  3. Create & Configure .env File

    cp .env.example .env

    Update the following API keys inside .env:

    REBRICKABLE_API_KEY=ee1aa3371d56d497ae073aa4b7aec8e0
    REBRICKABLE_API_URL=https://rebrickable.com/api/v3
  4. Install Dependencies

    composer install
    
  5. Generate Application Key

    php artisan key:generate
    
  6. Start the Backend Server

    php artisan serve

Frontend Setup (React)

  1. Navigate to the Frontend Directory

    cd lego-frontend
  2. Install Dependencies

    npm install
  3. Start the Frontend Server

    npm run start

🧪 Testing Credentials

📌 Username: khaledalam
📌 Password: test123456

📌 Testing API Key:

REBRICKABLE_API_KEY=ee1aa3371d56d497ae073aa4b7aec8e0
REBRICKABLE_API_URL=https://rebrickable.com/api/v3

📜 API Endpoints Overview

The backend is built with Laravel and exposes the following API endpoints:

🔑 Authentication

  • POST /api/users/user-token → Generate user token

📋 User Set Lists

  • POST /api/users/user-setlists → Get all user set lists
  • POST /api/users/user-setlist/create → Create a new set list

🧱 Sets Management

  • GET /api/lego/sets → Search for LEGO sets globally
  • GET /api/lego/sets/{set_num}/parts → Fetch parts of a LEGO set
  • POST /api/lego/sets/add-part → Add a part to a LEGO set
  • DELETE /api/lego/remove-set-from-list → Remove a set from the list

🛠️ Customization

  • GET /api/lego/set/{user_token}/{list_id}/{set_num} → Fetch details of a set in a user’s list
  • PUT /api/lego/set/update → Update set details
  • POST /api/lego/set/save → Save custom modifications

🛠️ Future Enhancements

  • Better Error Handling & UX Improvements
  • Unit & Integration Testing
  • Deploy Backend & Frontend on a Cloud Platform
  • Optimize API Calls & Reduce Unnecessary Fetching

👨‍💻 Author

🚀 Developed by Khaled Alam
📩 Contact: khaledalam.net@gmail.com

📜 License

This project is licensed under the MIT License.

About

A full-stack application (Laravel/React) that integrates with the Rebrickable API to allow users to search, manage, and customize LEGO sets by adding or modifying parts within their personal set lists.

Resources

Stars

2 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages