Skip to content

Hanzest/Hermes

Repository files navigation

Hermes Monorepo Setup Guide

📁 Project Structure

COS20031_Hermes/
├── client/              # React + Vite frontend
│   ├── package.json
│   └── ...
├── server/              # Bun + Hono backend
│   ├── package.json
│   ├── index.ts
│   └── tsconfig.json
└── package.json         # Root package for orchestration

🚀 Quick Start

1. Install All Dependencies

bun install:all

This will install dependencies for root, client, and server.

2. Run Both Client and Server

bun start:all

This single command will start:

  • Server on http://localhost:3000 (Bun + Fastify API)
  • Client on http://localhost:5173 (Vite React App)

📦 Available Scripts

Root Level

  • bun install:all - Install all dependencies (root, client, server)
  • bun start:all - Run both client and server concurrently
  • bun dev:client - Run only the client
  • bun dev:server - Run only the server
  • bun build - Build the client for production
  • bun lint - Lint the client code

Client (cd client)

  • bun dev - Start Vite dev server (port 5173)
  • bun build - Build for production
  • bun lint - Run ESLint

Server (cd server)

  • bun dev - Start server with hot reload (port 3000)
  • bun start - Start server without hot reload

🔧 Adding Packages

Add Client Dependencies

cd client
bun add package-name

Add Server Dependencies

cd server
bun add package-name

🌐 Ports

  • Client (Frontend): http://localhost:5173
  • Server (Backend API): http://localhost:3000

📝 Server API Endpoints

  • GET / - API welcome message

🛠️ Tech Stack

Client

  • React 19
  • Vite 7
  • TypeScript
  • Tailwind CSS 4
  • React Router 7
  • ShadCN UI Components

Server

  • Bun Runtime
  • Fastify Web Framework
  • TypeScript
  • @fastify/cors
  • PostgreSQL (Database)

🗄️ Database Setup

The server uses PostgreSQL as the database. You need to configure the database connection in the server's .env file. Suggested Download PGAdmin at: https://www.postgresql.org/download/

Create .env File in Server Directory

Create a file at server/.env with the following configuration:

# Database Configuration
DB_HOST="localhost"
DB_PORT=5432
DB_USER="your_postgres_username"
DB_PASSWORD="your_postgres_password"
DB_NAME="hermes_db"

# Server Configuration
PORT=3000
NODE_ENV="development"

Database Configuration Notes

  • DB_HOST: PostgreSQL server host (default: localhost)
  • DB_PORT: PostgreSQL port (default: 5432)
  • DB_USER: Your PostgreSQL username
  • DB_PASSWORD: Your PostgreSQL password
  • DB_NAME: Database name for the Hermes application
  • PORT: Server port (default: 3000)
  • NODE_ENV: Environment mode (development or production)

Make sure PostgreSQL is installed and running on your machine before starting the server.

💡 Tips

  1. Always use bun start:all to run both servers simultaneously
  2. The output is color-coded (blue for server, green for client)
  3. Each directory has its own package.json for isolated dependencies
  4. Hot reload is enabled for both client and server during development

About

This project is an illustration of some main use cases of Database Design Project Unit. This Website is designed for Vietnam Delivery Service Provider, allowing users to book delivering any items at ease with auto calculating price depend on types of service, deliver distance, and the physical characteristics of the items.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors