Skip to content

plazen/mise

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mise - Restaurant Management SaaS

An all-in-one restaurant management system with an admin interface for managing menu items, including pricing, availability, categories, images, descriptions, and allergens.

Features

  • Product Management: Create, edit, and delete menu items with full details
  • Category Management: Organize products into categories
  • Image Upload: Upload and manage product images
  • Availability Control: Toggle product availability in real-time
  • Search & Filter: Find products by name, description, or category
  • JWT Authentication: Secure admin access with token-based authentication
  • Responsive Design: Modern UI built with React and Tailwind CSS

Technology Stack

Backend

  • Go 1.21+ - High-performance backend API
  • MongoDB 7.0 - NoSQL database for flexible data storage
  • Gorilla Mux - HTTP routing
  • JWT - Authentication and authorization
  • Bcrypt - Secure password hashing

Frontend

  • React 18 - Modern UI library
  • Vite - Fast build tool and dev server
  • React Router - Client-side routing
  • Tailwind CSS - Utility-first CSS framework
  • Axios - HTTP client

Deployment

  • Docker & Docker Compose - Containerized deployment
  • Nginx - Reverse proxy and static file serving

Project Structure

mise/
├── backend/                 # Go backend application
│   ├── cmd/server/         # Application entry point
│   ├── internal/           # Private application code
│   │   ├── config/        # Configuration management
│   │   ├── models/        # Data models
│   │   ├── repository/    # Database layer
│   │   ├── service/       # Business logic
│   │   ├── handler/       # HTTP handlers
│   │   ├── middleware/    # HTTP middleware
│   │   ├── dto/           # Data transfer objects
│   │   └── utils/         # Utility functions
│   ├── pkg/database/      # MongoDB connection
│   └── uploads/           # Image storage
├── frontend/               # React frontend application
│   └── src/
│       ├── components/    # Reusable components
│       ├── pages/         # Page components
│       ├── services/      # API services
│       └── context/       # React Context
├── docker/                # Docker configuration files
└── docker-compose.yml     # Service orchestration

Getting Started

Prerequisites

  • Docker and Docker Compose installed
  • Git

Quick Start with Docker

  1. Clone the repository

     git clone https://github.com/plazen/mise.git
     cd mise
  2. Create environment file

    cp .env.example .env

    Edit .env and set secure values:

    MONGO_PASSWORD=your_secure_mongo_password
    JWT_SECRET=your_long_random_jwt_secret_at_least_32_characters
  3. Build and start all services

    docker-compose up --build
  4. Access the application

  5. Login with default credentials

    • Email: admin@mise.com
    • Password: admin123

    Important: Change the default password in production!

Development Setup (Without Docker)

Backend Development

  1. Install Go 1.21+

  2. Set up environment variables

    cd backend
    cp .env.example .env

    Edit backend/.env:

    SERVER_PORT=8080
    MONGODB_URI=mongodb://localhost:27017/mise
    JWT_SECRET=your-secret-key
    JWT_EXPIRATION_HOURS=24
    UPLOAD_MAX_SIZE=5242880
    UPLOAD_PATH=./uploads
    ENVIRONMENT=development
  3. Install MongoDB locally or use MongoDB Atlas

  4. Install dependencies

    go mod download
  5. Run the backend

    go run cmd/server/main.go

    The API will be available at http://localhost:8080

Frontend Development

  1. Install Node.js 18+

  2. Set up environment variables

    cd frontend
    cp .env.example .env

    Edit frontend/.env:

    VITE_API_BASE_URL=http://localhost:8080/api/v1
  3. Install dependencies

    npm install
  4. Run the development server

    npm run dev

    The app will be available at http://localhost:3000

API Documentation

Authentication

Login

POST /api/v1/auth/login
Content-Type: application/json

{
  "email": "admin@mise.com",
  "password": "admin123"
}

Response:
{
  "token": "eyJhbGc...",
  "user": {
    "id": "...",
    "email": "admin@mise.com",
    "firstName": "Admin",
    "lastName": "User",
    "role": "admin"
  }
}

Get Current User

GET /api/v1/auth/me
Authorization: Bearer <token>

Products

All product endpoints require authentication except GET requests.

GET    /api/v1/products              # List products (with pagination and filters)
GET    /api/v1/products/:id          # Get single product
POST   /api/v1/products              # Create product (requires auth)
PUT    /api/v1/products/:id          # Update product (requires auth)
PATCH  /api/v1/products/:id/availability  # Toggle availability (requires auth)
DELETE /api/v1/products/:id          # Delete product (requires auth)

Categories

GET    /api/v1/categories            # List all categories
GET    /api/v1/categories/:id        # Get single category
POST   /api/v1/categories            # Create category (requires auth)
PUT    /api/v1/categories/:id        # Update category (requires auth)
DELETE /api/v1/categories/:id        # Delete category (requires auth)

Upload

POST /api/v1/upload/image            # Upload image (requires auth)
Content-Type: multipart/form-data

Docker Commands

# Start all services
docker-compose up

# Start in detached mode
docker-compose up -d

# Rebuild and start
docker-compose up --build

# View logs
docker-compose logs -f

# View logs for specific service
docker-compose logs -f backend

# Stop all services
docker-compose down

# Stop and remove volumes (deletes data!)
docker-compose down -v

# Check service status
docker-compose ps

Database Schema

Users Collection

{
  "_id": ObjectId,
  "email": String (unique),
  "password": String (bcrypt hashed),
  "firstName": String,
  "lastName": String,
  "role": "admin" | "manager",
  "isActive": Boolean,
  "createdAt": ISODate,
  "updatedAt": ISODate
}

Products Collection

{
  "_id": ObjectId,
  "name": String,
  "description": String,
  "price": Number,
  "availability": Boolean,
  "categoryIds": [ObjectId],
  "images": [{
    "url": String,
    "alt": String,
    "isPrimary": Boolean,
    "order": Number
  }],
  "allergens": [String],
  "isDeleted": Boolean,
  "createdAt": ISODate,
  "updatedAt": ISODate
}

Categories Collection

{
  "_id": ObjectId,
  "name": String (unique),
  "description": String,
  "slug": String (unique),
  "icon": String,
  "displayOrder": Number,
  "parentId": ObjectId (optional),
  "isActive": Boolean,
  "createdAt": ISODate,
  "updatedAt": ISODate
}

Security Considerations

Production Deployment

  1. Change Default Credentials: Update the default admin password immediately
  2. Use Strong JWT Secret: Generate a long, random string for JWT_SECRET
  3. Use Strong MongoDB Password: Set a secure password for MongoDB
  4. Enable HTTPS: Use a reverse proxy (like Nginx) with SSL/TLS certificates
  5. Configure CORS: Update CORS middleware to allow only your frontend domain
  6. Rate Limiting: Consider adding rate limiting for production
  7. Regular Updates: Keep dependencies up to date

Environment Variables

Never commit .env files to version control. The .env.example files are templates only.

Troubleshooting

MongoDB Connection Issues

  • Ensure MongoDB container is running: docker-compose ps
  • Check MongoDB logs: docker-compose logs mongodb
  • Verify connection string in .env file

Backend Not Starting

  • Check backend logs: docker-compose logs backend
  • Verify Go module dependencies: cd backend && go mod tidy
  • Ensure MongoDB is accessible

Frontend Not Loading

  • Check frontend logs: docker-compose logs frontend
  • Verify API base URL in frontend .env file
  • Check browser console for errors

Image Upload Issues

  • Verify upload directory exists: backend/uploads
  • Check file size limits in configuration
  • Ensure correct file permissions on upload directory

Future Enhancements

  • User management (add/edit/delete admin users)
  • Multi-tenancy support (multiple restaurants)
  • Order management system
  • Customer-facing menu website
  • Inventory tracking
  • Analytics and reporting
  • Mobile apps (React Native or Flutter)
  • Advanced search with Elasticsearch
  • Cloud storage for images (S3, CloudFlare)
  • Email notifications
  • Backup and restore functionality

Contributing

This is a private project, but contributions are welcome! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is proprietary software. All rights reserved.

Support

For issues, questions, or support:

  • Create an issue in the repository
  • Contact the development team

Built with by Plazen

About

A first Free and Open Source Software for businesses

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages