Skip to content

anabxathag/Mini_Food_Delivery

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Mini Food Delivery — Go (Gin) + React (Vite) — Full Scaffold

A compact, production-minded full-stack project you can finish fast. Backend in Go (Gin) and Frontend in React (Vite). Includes in-memory data, clear endpoints, simple UI, and run/deploy instructions.

Features

  • Restaurants list
  • Menu per restaurant
  • Cart (frontend only)
  • Place order (creates order with status)
  • Check order status
  • Simple admin view endpoint to list orders

Tech

  • Backend: Go + Gin (single binary)
  • Frontend: React (Vite)
  • Data: in-memory (easy to swap with DB)
  • Optional: Dockerfile for both

Project structure

mini-food-delivery/
├─ backend/
│ ├─ go.mod
│ ├─ main.go
│ ├─ handlers.go
│ ├─ models.go
│ ├─ data.go
│ └─ Dockerfile
├─ frontend/
│ ├─ package.json
│ ├─ index.html
│ ├─ src/
│ │ ├─ main.jsx
│ │ ├─ App.jsx
│ │ ├─ api.js
│ │ ├─ components/
│ │ │ ├─ RestaurantCard.jsx
│ │ │ └─ MenuItem.jsx
│ │ └─ styles.css
│ └─ vite.config.js
└─ README.md

How to Run

Prerequisites

  • Go 1.20+
  • Node.js & npm

Backend

  1. Navigate to backend directory:
    cd backend
  2. Install dependencies:
    go mod tidy
  3. Run the server:
    go run main.go
    The server will start on http://localhost:8080.

Frontend

  1. Navigate to frontend directory:
    cd frontend
  2. Install dependencies:
    npm install
  3. Run the development server:
    npm run dev
    The application will be available at http://localhost:5173 (or similar). The application will be available at http://localhost:5173 (or similar).

Running Tests

We use Cypress for End-to-End (E2E) testing.

Prerequisites

  • Ensure the app is running (both backend and frontend).

Running Tests

  1. Open a new terminal in the frontend directory.
  2. Run the tests in headless mode:
    npm run test:e2e
  3. To open the interactive Test Runner:
    npx cypress open

What is Tested?

The test suite (cypress/e2e/spec.cy.js) covers the full user journey:

  • Homepage: Verifies restaurants load.
  • Menu: Checks if menu items and images appear.
  • Cart: Adds items, checks details (name, price, image), and removes items.
  • Order: Places an order and checks for success message.

Test Verification

Test Verification

Future Plan

To evolve this project into a professional, real-world application, we plan to implement the following:

1. Ecosystem Expansion

  • Rider App: A dedicated mobile app for delivery riders to accept jobs, view routes (Google Maps integration), and update delivery status.
  • Restaurant Portal: A web dashboard for restaurant owners to manage menus, view incoming orders, and track earnings.
  • Integration: Use WebSockets for real-time order matching between Customers, Restaurants, and Riders.

2. Professional DevOps & Cloud

  • Cloud Deployment: Deploy backend to AWS/GCP (using Docker/Kubernetes) and frontend to Vercel/Netlify.
  • CI/CD: Set up GitHub Actions for automated testing (Cypress/Go test) and deployment pipelines.
  • Monitoring: Integrate tools like Prometheus/Grafana for server health and Sentry for error tracking.

3. Advanced Features

  • AI Recommendations: Use machine learning to suggest food based on user history and preferences.
  • Real-time Tracking: Live GPS tracking of the rider on a map.
  • Payment Gateway: Integrate Stripe or Omise for secure credit card/QR payments.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published