A full-stack product information management system built with Flask (backend) and Next.js (frontend).
- Product Management: Create, read, update, and soft delete products
- Search Functionality: Search products by name
- Responsive Design: Modern UI built with Tailwind CSS
- MongoDB Integration: Persistent data storage
- RESTful API: Clean API endpoints for all operations
campomaq-product-information-manager/
├── apps/
│ ├── backend/ # Flask API server
│ │ ├── app.py # Main Flask application
│ │ ├── requirements.txt
│ │ └── .env.example
│ └── frontend/ # Next.js React application
│ ├── src/
│ │ └── app/ # App router pages
│ ├── package.json
│ ├── postcss.config.js
│ └── .env.local.example
└── README.md
- Python 3.8+
- Node.js 18+
- MongoDB Atlas account (or local MongoDB)
-
Navigate to the backend directory:
cd apps/backend -
Create a virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Create environment file:
cp .env.example .env
-
Update
.envwith your MongoDB connection string:MONGO_URI=mongodb+srv://username:password@cluster.mongodb.net/?retryWrites=true&w=majority DB_NAME=products_db COLLECTION_NAME=catalog FLASK_ENV=development PORT=5000 -
Run the Flask server:
python app.py
The backend will be available at http://localhost:5000
-
Navigate to the frontend directory:
cd apps/frontend -
Install dependencies:
npm install
-
Create environment file:
cp .env.local.example .env.local
-
Update
.env.localif needed:NEXT_PUBLIC_API_URL=http://localhost:5000 NODE_ENV=development -
Run the development server:
npm run dev
The frontend will be available at http://localhost:3000
GET /products- Get all products (with optional search)GET /products/<id>- Get a single productPOST /products- Create a new productPUT /products/<id>- Update a productDELETE /products/<id>- Soft delete a product (set show_in_app=false)
GET /health- Health check endpoint
{
"product_id": 1,
"product_name": "Sample Product",
"category_name": "Electronics",
"brand_name": "Sample Brand",
"price_cash": 99.99,
"description": "Product description",
"show_in_app": true,
"created_at": "2024-01-01T00:00:00Z",
"updated_at": "2024-01-01T00:00:00Z"
}- Update
.envwith production MongoDB URI - Set
FLASK_ENV=production - Deploy to Azure Web App
- Update
.env.localwith production API URL - Build the application:
npm run build - Deploy to Azure Static Web App
- Backend changes go in
apps/backend/app.py - Frontend pages go in
apps/frontend/src/app/ - Styles are configured with Tailwind CSS v4+ (no config file needed)
The application uses MongoDB with the following collections:
catalog- Stores product information
Products are soft-deleted by setting show_in_app: false rather than being removed from the database.
- Flask - Web framework
- pymongo - MongoDB driver
- python-dotenv - Environment variable management
- flask-cors - CORS handling
- Next.js 15 - React framework with App Router
- React 19 - UI library
- TypeScript - Type safety
- Tailwind CSS v4+ - Modern utility-first CSS framework
This project is licensed under the MIT License.