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

https://github.com/patrickgdl/goto

Attempt to communicate with the GoTo Connect APIs
https://github.com/patrickgdl/goto

express nodejs typescript

Last synced: 3 months ago
JSON representation

Attempt to communicate with the GoTo Connect APIs

Awesome Lists containing this project

README

          

# ๐Ÿš€ Express with TypeScript

## ๐Ÿ’ก Motivation and Intentions

Developed to streamline backend development, a solution for:

- โœจ Reducing setup time for new projects.
- ๐Ÿ“Š Ensuring code consistency and quality.
- โšก Facilitating rapid development with cutting-edge tools.
- ๐Ÿ›ก๏ธ Encouraging best practices in security, testing, and performance.

## ๐Ÿš€ Features

- ๐Ÿ“ Modular Structure: Organized by feature for easy navigation and scalability.
- ๐Ÿ’จ Faster Execution with tsx: Rapid TypeScript execution with esbuild, complemented by tsc for type checking.
- ๐ŸŒ Stable Node Environment: Latest LTS Node version in .nvmrc.
- ๐Ÿ”ง Simplified Environment Variables with Envalid: Centralized and easy-to-manage configuration.
- ๐Ÿ”— Path Aliases: Cleaner code with shortcut imports.
- ๐Ÿ”„ Dependabot Integration: Automatic updates for secure and up-to-date dependencies.
- ๐Ÿ”’ Security: Helmet for HTTP header security and CORS setup.
- ๐Ÿ“Š Logging: Efficient logging with pino-http.
- ๐Ÿงช Comprehensive Testing: Robust setup with Vitest and Supertest.
- ๐Ÿ”‘ Code Quality Assurance: Husky and lint-staged for consistent quality.
- โœ… Unified Code Style: ESLint and Prettier for a consistent coding standard.
- ๐Ÿ“ƒ API Response Standardization: ServiceResponse class for consistent API responses.
- ๐Ÿณ Docker Support: Ready for containerization and deployment.
- ๐Ÿ“ Input Validation with Zod: Strongly typed request validation using Zod.
- ๐Ÿงฉ API Spec Generation: Automated OpenAPI specification generation from Zod schemas to ensure up-to-date and accurate API documentation.

## ๐Ÿ› ๏ธ Getting Started

### Step 1: ๐Ÿš€ Initial Setup

- Clone the repository: `git clone https://github.com/patrickgdl/goto`
- Navigate: `cd goto`
- Install dependencies: `npm ci`

### Step 2: โš™๏ธ Environment Configuration

- Create `.env`: Copy `.env.template` to `.env`
- Update `.env`: Fill in necessary environment variables

### Step 3: ๐Ÿƒโ€โ™‚๏ธ Running the Project

- Development Mode: `npm run dev`
- Building: `npm run build`
- Production Mode: Set `.env` to `NODE_ENV="production"` then `npm run build && npm run start`

## ๐Ÿ“ Project Structure

```
.
โ”œโ”€โ”€ api
โ”‚ โ”œโ”€โ”€ healthCheck
โ”‚ โ”‚ โ””โ”€โ”€ healthCheckRouter.ts
โ”‚ โ””โ”€โ”€ goto
โ”‚ โ”œโ”€โ”€ goto-router.ts
โ”œโ”€โ”€ common
โ”‚ โ”œโ”€โ”€ __tests__
โ”‚ โ”‚ โ”œโ”€โ”€ errorHandler.test.ts
โ”‚ โ”‚ โ””โ”€โ”€ requestLogger.test.ts
โ”‚ โ”œโ”€โ”€ middleware
โ”‚ โ”‚ โ”œโ”€โ”€ errorHandler.ts
โ”‚ โ”‚ โ””โ”€โ”€ requestLogger.ts
โ”‚ โ”œโ”€โ”€ models
โ”‚ โ”‚ โ””โ”€โ”€ serviceResponse.ts
โ”‚ โ””โ”€โ”€ utils
โ”‚ โ”œโ”€โ”€ commonValidation.ts
โ”‚ โ”œโ”€โ”€ envConfig.ts
โ”‚ โ””โ”€โ”€ httpHandlers.ts
โ”œโ”€โ”€ index.ts
โ””โ”€โ”€ server.ts

```