106 lines
2.2 KiB
Markdown
106 lines
2.2 KiB
Markdown
# SolPay - Node.js TypeScript Application
|
|
|
|
A modern Node.js application built with TypeScript, featuring Express.js for the web server and comprehensive testing setup.
|
|
|
|
## Features
|
|
|
|
- 🚀 **TypeScript** - Full TypeScript support with strict type checking
|
|
- 🧪 **Testing** - Jest testing framework with TypeScript support
|
|
- 🔧 **Development** - Hot reload with ts-node for development
|
|
- 📦 **Build System** - TypeScript compiler with source maps
|
|
- 🎯 **Modern ES2020** - Latest JavaScript features
|
|
|
|
## Prerequisites
|
|
|
|
- Node.js (v16 or higher)
|
|
- npm or yarn
|
|
|
|
## Installation
|
|
|
|
1. Clone the repository:
|
|
```bash
|
|
git clone <repository-url>
|
|
cd solpay
|
|
```
|
|
|
|
2. Install dependencies:
|
|
```bash
|
|
npm install
|
|
```
|
|
|
|
## Available Scripts
|
|
|
|
- **`npm run dev`** - Start development server with hot reload
|
|
- **`npm run build`** - Build the TypeScript code to JavaScript
|
|
- **`npm start`** - Start the production server (requires build first)
|
|
- **`npm run watch`** - Watch for changes and rebuild automatically
|
|
- **`npm test`** - Run tests
|
|
- **`npm run clean`** - Clean build output
|
|
|
|
## Development
|
|
|
|
To start developing:
|
|
|
|
```bash
|
|
npm run dev
|
|
```
|
|
|
|
This will start the server using ts-node, which automatically compiles TypeScript on the fly.
|
|
|
|
## Building for Production
|
|
|
|
```bash
|
|
npm run build
|
|
npm start
|
|
```
|
|
|
|
## Project Structure
|
|
|
|
```
|
|
solpay/
|
|
├── src/ # TypeScript source code
|
|
├── dist/ # Compiled JavaScript (generated)
|
|
├── tests/ # Test files
|
|
├── package.json # Dependencies and scripts
|
|
├── tsconfig.json # TypeScript configuration
|
|
├── jest.config.js # Jest testing configuration
|
|
└── README.md # This file
|
|
```
|
|
|
|
## Testing
|
|
|
|
Run tests with:
|
|
|
|
```bash
|
|
npm test
|
|
```
|
|
|
|
Run tests with coverage:
|
|
|
|
```bash
|
|
npm test -- --coverage
|
|
```
|
|
|
|
## TypeScript Configuration
|
|
|
|
The project uses strict TypeScript settings for better code quality:
|
|
|
|
- Strict mode enabled
|
|
- No implicit any types
|
|
- Source maps for debugging
|
|
- Declaration files generation
|
|
- ES2020 target
|
|
|
|
## Contributing
|
|
|
|
1. Fork the repository
|
|
2. Create a feature branch
|
|
3. Make your changes
|
|
4. Add tests for new functionality
|
|
5. Ensure all tests pass
|
|
6. Submit a pull request
|
|
|
|
## License
|
|
|
|
MIT License - see LICENSE file for details
|