A modern e-commerce web application built with Flask for the Algerian market.
- 🛍️ Product catalog with categories
- 📱 Responsive design for mobile and desktop
- 🛒 Order management system
- 📋 Product request functionality
- 👤 Admin authentication and dashboard
- 🏪 Multi-category product organization
- 📸 Multiple product images support
- 📊 Order tracking and management
- 🗃️ SQLite database for easy deployment
- Backend: Python Flask
- Database: SQLite
- Frontend: HTML, CSS, JavaScript
- Authentication: Werkzeug Security
- File Handling: Secure file uploads
- Python 3.8 or higher
- pip (Python package installer)
- Clone the repository:
git clone https://github.com/yourusername/luxora-dz.git
cd luxora-dz- Create a virtual environment:
python -m venv .venv- Activate the virtual environment:
# Windows
.venv\Scripts\activate
# Linux/Mac
source .venv/bin/activate- Install dependencies:
pip install -r requirements.txt- Set up environment variables:
# Copy .env.example to .env and configure your settings
cp .env.example .env
# IMPORTANT: Edit .env and set your own secure values:
# - SECRET_KEY: Use a long, random string
# - ADMIN_USERNAME: Your admin username
# - ADMIN_PASSWORD: A strong password- Initialize the database:
python app.pyThe application uses environment variables for configuration. Key settings in .env:
SECRET_KEY: Flask secret key for sessionsDATABASE_URL: Database connection stringADMIN_USERNAME: Admin panel usernameADMIN_PASSWORD: Admin panel passwordFLASK_ENV: Environment mode (development/production)
python app.pyThe application will be available at http://localhost:5000
Access the admin panel at /admin with the credentials configured in your environment variables.
luxora-dz/
├── app.py # Main application file
├── models.py # Database models
├── requirements.txt # Python dependencies
├── .env # Environment variables
├── templates/ # HTML templates
│ ├── index.html # Homepage
│ ├── product.html # Product details
│ ├── customer_info.html # Order form
│ └── ...
├── static/ # Static assets
│ ├── css/ # Stylesheets
│ ├── js/ # JavaScript files
│ ├── images/ # Images
│ └── uploads/ # Uploaded product images
├── instance/ # Instance-specific files
└── database.db # SQLite database
GET /- Homepage with product listingsGET /product/<id>- Product details pagePOST /order/<id>- Place an orderPOST /api/product-request- Submit product request
GET /admin- Admin dashboardPOST /admin/login- Admin authenticationGET /admin/products- Manage productsGET /admin/orders- View ordersGET /admin/product-requests- Manage product requests
The application uses SQLite with the following main tables:
- products: Product information and pricing
- categories: Product categories
- product_images: Multiple images per product
- orders: Customer orders
- product_requests: Customer inquiries
- admins: Admin user accounts
Run the test suite:
python -m pytest test_*.pyTest files included:
test_database.py- Database functionality teststest_users.py- User authentication teststest_product_requests_api.py- API endpoint teststest_images.py- Image handling tests
The application can be run locally using the included batch file:
./start_app.batFor production deployment, consider:
- Using a production WSGI server (Gunicorn, uWSGI)
- Setting up a reverse proxy (Nginx)
- Using a production database (PostgreSQL, MySQL)
- Configuring proper environment variables
- Setting up SSL/HTTPS
-
Environment Variables: Never commit
.envfiles to version control. Always use.env.exampleas a template. -
Admin Credentials: Change the default admin username and password in your
.envfile before deployment. -
Secret Key: Use a long, random string for
SECRET_KEYin production. You can generate one using:import secrets print(secrets.token_hex(32))
-
Database: The SQLite database file (
database.db) is excluded from version control for security. -
Production: Never run with
FLASK_DEBUG=Truein production.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
For support and questions, please open an issue on GitHub or contact the development team.
See CHANGELOG.md for a detailed list of changes and version history.
Luxora DZ - Modern e-commerce solution for Algeria 🇩🇿