create-tin
Version:
Scaffold a TypeScript or JavaScript Express boilerplate
116 lines (88 loc) ⢠2.64 kB
Markdown
# Create Tin
[](https://www.npmjs.com/package/create-tin)
[](https://opensource.org/licenses/ISC)
Fast Express.js project scaffold with TypeScript/JavaScript support, JWT authentication, and MongoDB integration.
## Features
- š **Instant setup** - Generate Express projects in seconds
- š§ **TypeScript or JavaScript** - Choose your preferred language
- š **JWT Authentication** - Built-in auth system
- šļø **MongoDB Ready** - Pre-configured database connection
- š **Clean Structure** - Organized project folders
- ā” **Git Integration** - Optional repository initialization
## Quick Start
```bash
npx create-tin my-project
```
## Usage
### Interactive Mode
```bash
npx create-tin my-express-app
```
### Command Line Flags
```bash
# TypeScript with git
npx create-tin my-project --ts --git
# JavaScript without git
npx create-tin my-project --js --skip-git
```
### Available Options
- `--ts` - Use TypeScript
- `--js` - Use JavaScript
- `--git` - Initialize git repository
- `--skip-git` - Skip git initialization
## Project Structure
### TypeScript Project
```
my-project/
āāā src/
ā āāā index.ts
ā āāā config/db.ts
ā āāā controllers/authController.ts
ā āāā middlewares/
ā āāā models/userModel.ts
ā āāā routes/authRoutes.ts
ā āāā types/
āāā package.json
āāā tsconfig.json
āāā .env
āāā README.md
```
### JavaScript Project
```
my-project/
āāā src/
ā āāā index.js
ā āāā config/db.js
ā āāā controllers/authController.js
ā āāā middlewares/
ā āāā models/userModel.js
ā āāā routes/authRoutes.js
āāā package.json
āāā .env
āāā README.md
```
## Environment Variables
Generated `.env` file:
```env
MONGO=mongodb://localhost:27017/myapp
PORT=5000
```
## Getting Started
After scaffolding:
```bash
cd my-project
npm run dev # Start development server
```
## API Endpoints
| Method | Endpoint | Description |
|--------|----------|-------------|
| POST | `/api/auth/register` | User registration |
| POST | `/api/auth/login` | User login |
| GET | `/api/auth/profile` | Get user profile (protected) |
## Dependencies
**Runtime:**
- express, mongoose, jsonwebtoken, bcryptjs, cors, dotenv
**TypeScript projects also include:**
- typescript, @types/*, tsx, rimraf
## License
ISC