Skip to content

N0Vee/react-elysia-starter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ React + Elysia Starter Template

A modern, blazing-fast full-stack starter template combining the power of React, Vite, Elysia, and Bun.

✨ Features

Frontend

  • React 19 - Latest version with cutting-edge features
  • Vite - Lightning-fast development experience with HMR
  • Tailwind CSS 4 - Utility-first CSS framework for rapid UI development
  • Framer Motion - Production-ready motion library for React

Backend

  • Elysia - Fast and elegant web framework for Bun
  • Bun - All-in-one JavaScript runtime & toolkit (faster than Node.js)

πŸ“¦ Project Structure

react-elysia-starter/
β”œβ”€β”€ client/                 # Frontend React application
β”‚   β”œβ”€β”€ public/            # Static assets
β”‚   β”‚   β”œβ”€β”€ react.svg
β”‚   β”‚   β”œβ”€β”€ vite.svg
β”‚   β”‚   └── elysia.svg
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ App.tsx        # Main app component
β”‚   β”‚   β”œβ”€β”€ main.tsx       # React entry point
β”‚   β”‚   └── index.css      # Global styles (Tailwind)
β”‚   β”œβ”€β”€ package.json
β”‚   └── vite.config.ts     # Vite configuration
β”‚
└── server/                # Backend Elysia application
    β”œβ”€β”€ index.ts           # Main server file
    β”œβ”€β”€ package.json
    └── tsconfig.json

πŸ› οΈ Prerequisites

Make sure you have Bun installed on your machine.

# Install Bun (macOS, Linux, and WSL)
curl -fsSL https://bun.sh/install | bash

# Install Bun (Windows)
powershell -c "irm bun.sh/install.ps1 | iex"

πŸš€ Getting Started

1. Clone the repository

git clone https://github.com/N0Vee/react-elysia-starter.git
cd react-elysia-starter

2. Install dependencies

# Install client dependencies
cd client
bun install

# Install server dependencies
cd ../server
bun install

3. Run the development servers

Terminal 1 - Frontend (Vite Dev Server):

cd client
bun dev

The frontend will be available at http://localhost:5173

Terminal 2 - Backend (Elysia Server):

cd server
bun dev

The backend will be available at http://localhost:3001

πŸ“ Available Scripts

Client

Command Description
bun dev Start development server with HMR
bun build Build for production
bun preview Preview production build
bun lint Run ESLint

Server

Command Description
bun dev Start Elysia server with hot reload
bun index.ts Run server without hot reload

🌐 API Endpoints

The backend server provides the following endpoints:

  • GET / - Welcome message

    "Hello from Elysia + Bun!"
  • GET /api/hello - API test endpoint

    {
      "message": "Hello API"
    }

🎨 Tech Stack

Frontend

Backend

  • Elysia - Web framework
  • Bun - JavaScript runtime

Development

πŸ”§ Configuration

Vite Configuration

The Vite config includes:

  • React plugin with Babel React Compiler
  • Tailwind CSS plugin
  • Fast Refresh for instant HMR

Tailwind CSS

Tailwind CSS v4 is configured with the new @import "tailwindcss" syntax in index.css.

CORS

CORS is enabled on the Elysia server for cross-origin requests from the frontend.

Docker

Production Deployment

# Build and run with Docker Compose
docker-compose up -d --build

# Access the application
# Frontend: http://localhost:3000
# Backend: http://localhost:3001

# View logs
docker-compose logs -f

# Stop services
docker-compose down

Individual Services

# Build and run server only
cd server
docker build -t elysia-server .
docker run -p 3001:3001 elysia-server

# Build and run client only
cd client
docker build -t react-client .
docker run -p 3000:80 react-client

οΏ½πŸ“š Learn More

🀝 Contributing

Contributions are welcome! Feel free to open issues or submit pull requests.

πŸ“„ License

MIT

πŸŽ‰ Happy Coding!

Built with ❀️ using React, Vite, Elysia, and Bun

react-elysia-starter

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors