An open API service indexing awesome lists of open source software.

https://github.com/tamoziit/express-mongo-vite-ts-starter_package

A zero-config starter npm package to scaffold a Full-Stack monorepo with node, express & JWT-Auth REST API Backend & integrated Vite & React frontend template, written in TS.
https://github.com/tamoziit/express-mongo-vite-ts-starter_package

bcryptjs cli expressjs jwt-authentication nodejs npm-link npm-package npm-publish npx reactjs tailwindcss typescript vite

Last synced: about 2 months ago
JSON representation

A zero-config starter npm package to scaffold a Full-Stack monorepo with node, express & JWT-Auth REST API Backend & integrated Vite & React frontend template, written in TS.

Awesome Lists containing this project

README

          

# Express, Mongo, Vite, TS Fullstack Starter Project

### *A zero-config starter npm package to scaffold a fullstack monorepo with:*

- โš™๏ธ **Backend**: Node.js + Express.js + MongoDB + TypeScript + JWT-Auth
- โš›๏ธ **Frontend**: React.js + Vite + TypeScript

---

## ๐Ÿš€ Usage

### Create in a new folder

```bash
npx express-mongo-vite-ts-starter my-app
```

Creates:

```
current directory/
โ”œโ”€โ”€my-app/
โ”œโ”€โ”€ backend/
โ””โ”€โ”€ frontend/
```

### Create in current directory

```bash
npx express-mongo-vite-ts-starter
```

Creates:

```
current directory/
โ”œโ”€โ”€ backend/
โ””โ”€โ”€ frontend/
```

---

## ๐Ÿ“ Project Structure

```
my-app/
โ”œโ”€โ”€ backend/ # Express.js + MongoDB + TypeScript API for basic user authorization
โ”‚ โ””โ”€โ”€ ...
โ”œโ”€โ”€ frontend/ # Vite + React + TypeScript Template App
โ”‚ โ””โ”€โ”€ ...
โ”œโ”€โ”€ README.md # README.md with steps to setup .env & prerequite details
```

---

## โš™ Prerequisites

**You will require the following, installed in your system, for the project to function properly:**
1. **Node.js** (use v20.0.0 or higher for better compatibility)
2. **Redis**: In-memory DB (v5.0.0.0 or higher)

---

## ๐Ÿ›  Setup Instructions

### 1. Install dependencies

```bash
cd backend
npm install
cd ../frontend
npm install
```

### 2. Configure Environment Variables

Create `.env` files in both `backend/` and `frontend/`:

#### Example backend `.env`

```
PORT=5000
MONGO_URI=mongodb://localhost:27017/your-db
JWT_SECRET=your-secret-key
NODE_ENV=development

ADMIN_PASSWORD=your-admin-password
```

#### Example frontend `.env`

```
VITE_API_BASE_URL=http://localhost:5000/api
```

---

## ๐Ÿงช Development

Under `backend/` execute:

```bash
npm run dev # Start backend
```

Under `frontend/` execute:

```bash
npm run dev # Start frontend
```

---

## ๐Ÿ“ค Publish Your App

Once you're ready to go live, build the frontend and deploy the backend. Tailor build steps to your hosting solution.

---

## ๐Ÿ™Œ Credits

Created by [Tamojit Das](https://github.com/Tamoziit)

---

## ๐Ÿ“„ License

This CLI tool scaffolds projects without including the original repository's license.

---

*Let me know for potential issues & fixes for this project. Your feedback is extremely appreciable...*

*~ Tamojit Das*