A modern, scalable web application for discovering luxury brands around the world. Built with Next.js, React, TypeScript, and Tailwind CSS, following SOLID principles and KISS methodology.
- π’ Brand Discovery: Browse a curated collection of luxury brands
- π Interactive Maps: View brand headquarters on interactive maps powered by Leaflet
- π± Responsive Design: Beautiful UI that works on all devices
- π¨ Modern Design: Clean, professional interface with Tailwind CSS
- β‘ Fast Performance: Built with Next.js for optimal performance
- π Type Safety: Full TypeScript support throughout
Want to make this app accessible via URL? We've got you covered!
| Platform | Difficulty | Time | Cost | Guide |
|---|---|---|---|---|
| Vercel β | Easy | 5 min | Free | Quick Guide |
| Docker π³ | Medium | 10 min | $6/mo | Quick Guide |
| Railway π | Easy | 8 min | $5/mo | Full Guide |
π Full Documentation: DEPLOYMENT.md | QUICK_DEPLOY.md | CI_CD.md
The project is organized into three main folders following separation of concerns:
test_mcp/
βββ frontend/ # Next.js React application (port 3001)
βββ backend/ # Next.js API server (port 3000)
βββ database/ # Fake JSON database for testing
βββ README.md # This file
The client-side application built with Next.js, React, and Tailwind CSS. Provides a beautiful, responsive UI for browsing luxury brands.
- Technology: Next.js 15, React 19, TypeScript, Tailwind CSS
- Port: 3001
- Features: Brand listing, brand details, interactive maps
The API server built with Next.js API routes and PostgreSQL database. Provides RESTful endpoints for accessing brand and agent data.
- Technology: Next.js 15, TypeScript, PostgreSQL, Prisma ORM
- Port: 3000
- Endpoints:
/api/brands,/api/brands/:id,/api/agents - Database: PostgreSQL with Prisma ORM
PostgreSQL database with Prisma ORM for managing brands, agents, and their relationships.
- Technology: PostgreSQL, Prisma ORM
- Models: Brand, Agent, AgentBrand (many-to-many relationship)
- Data: 8 luxury brands, sample agents with brand associations
- Features: Type-safe queries, migrations, seeding
- Node.js 18 or higher
- npm or yarn package manager
- PostgreSQL 12 or higher
- Clone the repository
git clone https://github.com/RLNunes/test_mcp.git
cd test_mcp- Set up PostgreSQL database
# Create database (using psql or your preferred tool)
createdb luxury_brands- Install backend dependencies and set up database
cd backend
npm install
cp .env.example .env
# Edit .env with your PostgreSQL credentials
npm run db:migrate # Run migrations
npm run db:seed # Seed with initial data- Install frontend dependencies
cd ../frontend
npm install- Start all services:
./start-all.shThis will automatically:
- Install dependencies if needed
- Start backend on port 3000
- Start frontend on port 3001
- Show service URLs and PIDs
- Stop all services:
./stop-all.sh- Access the app: http://localhost:3001
If you prefer to run services manually:
- Start the backend API server (Terminal 1):
cd backend
npm install
npm run devThe API will be available at http://localhost:3000
- Start the frontend application (Terminal 2):
cd frontend
npm install
npm run devThe app will be available at http://localhost:3001
- Open your browser and navigate to http://localhost:3001
This project follows industry best practices:
-
SOLID Principles
- Single Responsibility: Each class/component has one purpose
- Open/Closed: Open for extension, closed for modification
- Liskov Substitution: Components can be substituted with their subtypes
- Interface Segregation: Clean, focused interfaces
- Dependency Inversion: Depend on abstractions, not implementations
-
KISS (Keep It Simple, Stupid)
- Clear, readable code
- Minimal complexity
- Easy to understand and maintain
-
Separation of Concerns
- Frontend, Backend, and Database are completely separated
- Each layer has a specific responsibility
- Easy to scale and modify independently
Frontend:
- Next.js 15 (App Router)
- React 19
- TypeScript
- Tailwind CSS
- Leaflet (Maps)
- React Icons
Backend:
- Next.js 15 (API Routes)
- TypeScript
- PostgreSQL (Database)
- Prisma ORM (Database toolkit)
Development:
- ESLint
- TypeScript strict mode
- npm package manager
- Prisma Studio (Database GUI)
Retrieves all luxury brands.
Response:
{
"success": true,
"data": [
{
"id": "1",
"name": "Louis Vuitton",
"description": "...",
"category": "Fashion & Leather Goods",
"founded": 1854,
"headquarters": "Paris, France",
"location": {
"lat": 48.8566,
"lng": 2.3522,
"address": "..."
},
"image": "https://..."
}
]
}Retrieves a specific brand by ID.
Response:
{
"success": true,
"data": {
"id": "1",
"name": "Louis Vuitton",
"...": "..."
}
}Retrieves all agents with their associated brands.
Response:
{
"success": true,
"data": [
{
"id": "...",
"name": "Sarah Johnson",
"email": "sarah.johnson@luxury.com",
"phone": "+1-555-0101",
"expertise": "Fashion & Leather Goods",
"active": true,
"brands": [
{
"id": "1",
"name": "Louis Vuitton",
"category": "Fashion & Leather Goods"
}
]
}
]
}- TypeScript for type safety
- ESLint for code linting
- Component-based architecture
- Service layer pattern
- Clean, documented code
Manage the database using these commands:
cd backend
npm run db:generate # Generate Prisma Client
npm run db:migrate # Run database migrations
npm run db:seed # Seed database with initial data
npm run db:studio # Open Prisma Studio (database GUI)Build the backend:
cd backend
npm run build
npm startBuild the frontend:
cd frontend
npm run build
npm startReady to make your app accessible to anyone via URL?
Check out our comprehensive Deployment Guide for step-by-step instructions on deploying to:
- Vercel (Recommended - easiest for Next.js apps)
- Docker (Deploy anywhere with containers)
- Railway, Heroku, Render, and more
The guide includes:
- β Database setup (PostgreSQL hosting options)
- β Environment variable configuration
- β Deployment steps for multiple platforms
- β Troubleshooting tips
- β Security and performance best practices
π Read the Deployment Guide β
When contributing to this project:
- Follow the existing code style
- Maintain SOLID principles
- Keep it simple (KISS)
- Write clear, self-documenting code
- Update documentation as needed
This project is licensed under the MIT License - see the LICENSE file for details.
- Add search and filtering
- Implement user authentication
- Add admin panel for managing brands and agents
-
Connect to a real database (PostgreSQL) -
Support for agents and brand relationships - Add customer management features
- Add unit and integration tests
- Implement CI/CD pipeline
-
Add Docker support -
Deploy to production
For issues, questions, or contributions, please open an issue on GitHub.
Built with β€οΈ using Next.js, React, and TypeScript