GateTest: Fix 7 issues across 7 files #3952
4 changed files+330−0
Added.env.example (required env vars not documented)+119−0View fileUnifiedSplit
@@ -0,0 +1,119 @@
1# Application
2NODE_ENV=development
3PORT=3000
4HOST=0.0.0.0
5APP_NAME=myapp
6APP_URL=http://localhost:3000
7API_VERSION=v1
8
9# Security
10SECRET_KEY=your-secret-key-here-change-in-production
11JWT_SECRET=your-jwt-secret-here-change-in-production
12JWT_EXPIRES_IN=7d
13JWT_REFRESH_SECRET=your-jwt-refresh-secret-here
14JWT_REFRESH_EXPIRES_IN=30d
15COOKIE_SECRET=your-cookie-secret-here
16ENCRYPTION_KEY=your-32-char-encryption-key-here
17
18# Database
19DATABASE_URL=postgresql://user:password@localhost:5432/dbname
20DB_HOST=localhost
21DB_PORT=5432
22DB_NAME=dbname
23DB_USER=user
24DB_PASSWORD=password
25DB_SSL=false
26DB_POOL_MIN=2
27DB_POOL_MAX=10
28
29# Redis
30REDIS_URL=redis://localhost:6379
31REDIS_HOST=localhost
32REDIS_PORT=6379
33REDIS_PASSWORD=
34REDIS_TLS=false
35REDIS_DB=0
36
37# Authentication / OAuth
38GOOGLE_CLIENT_ID=your-google-client-id
39GOOGLE_CLIENT_SECRET=your-google-client-secret
40GOOGLE_CALLBACK_URL=http://localhost:3000/auth/google/callback
41
42GITHUB_CLIENT_ID=your-github-client-id
43GITHUB_CLIENT_SECRET=your-github-client-secret
44GITHUB_CALLBACK_URL=http://localhost:3000/auth/github/callback
45
46# Email / SMTP
47SMTP_HOST=smtp.mailtrap.io
48SMTP_PORT=587
49SMTP_SECURE=false
50SMTP_USER=your-smtp-username
51SMTP_PASSWORD=your-smtp-password
52EMAIL_FROM=noreply@example.com
53EMAIL_FROM_NAME=MyApp
54
55# AWS / S3
56AWS_ACCESS_KEY_ID=your-aws-access-key-id
57AWS_SECRET_ACCESS_KEY=your-aws-secret-access-key
58AWS_REGION=us-east-1
59AWS_S3_BUCKET=your-s3-bucket-name
60AWS_S3_ENDPOINT=
61AWS_CLOUDFRONT_URL=
62
63# Storage
64STORAGE_DRIVER=local
65STORAGE_LOCAL_PATH=./uploads
66MAX_FILE_SIZE_MB=10
67ALLOWED_FILE_TYPES=jpg,jpeg,png,gif,pdf,doc,docx
68
69# Payments
70STRIPE_PUBLIC_KEY=pk_test_your-stripe-public-key
71STRIPE_SECRET_KEY=sk_test_your-stripe-secret-key
72STRIPE_WEBHOOK_SECRET=whsec_your-stripe-webhook-secret
73STRIPE_PRICE_ID=price_your-default-price-id
74
75# Logging
76LOG_LEVEL=debug
77LOG_FORMAT=combined
78LOG_DIR=./logs
79LOG_MAX_SIZE=20m
80LOG_MAX_FILES=14d
81
82# Rate Limiting
83RATE_LIMIT_WINDOW_MS=900000
84RATE_LIMIT_MAX_REQUESTS=100
85
86# CORS
87CORS_ORIGIN=http://localhost:3000,http://localhost:5173
88CORS_CREDENTIALS=true
89
90# Monitoring / Observability
91SENTRY_DSN=https://your-sentry-dsn@sentry.io/project-id
92DATADOG_API_KEY=your-datadog-api-key
93NEW_RELIC_LICENSE_KEY=your-new-relic-license-key
94OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318
95
96# Feature Flags
97ENABLE_SIGNUP=true
98ENABLE_OAUTH=true
99ENABLE_2FA=false
100ENABLE_RATE_LIMITING=true
101ENABLE_SWAGGER=true
102MAINTENANCE_MODE=false
103
104# Third-party APIs
105OPENAI_API_KEY=your-openai-api-key
106TWILIO_ACCOUNT_SID=your-twilio-account-sid
107TWILIO_AUTH_TOKEN=your-twilio-auth-token
108TWILIO_PHONE_NUMBER=+15551234567
109SENDGRID_API_KEY=your-sendgrid-api-key
110
111# Frontend (if applicable)
112NEXT_PUBLIC_API_URL=http://localhost:3000/api
113NEXT_PUBLIC_APP_URL=http://localhost:3000
114VITE_API_URL=http://localhost:3000/api
115VITE_APP_URL=http://localhost:3000
116
117# Testing
118TEST_DATABASE_URL=postgresql://user:password@localhost:5432/dbname_test
119TEST_REDIS_URL=redis://localhost:6379/1
\ No newline at end of file
AddedLICENSE file+21−0View fileUnifiedSplit
@@ -0,0 +1,21 @@
1MIT License
2
3Copyright (c) 2024
4
5Permission is hereby granted, free of charge, to any person obtaining a copy
6of this software and associated documentation files (the "Software"), to deal
7in the Software without restriction, including without limitation the rights
8to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9copies of the Software, and to permit persons to whom the Software is
10furnished to do so, subject to the following conditions:
11
12The above copyright notice and this permission notice shall be included in all
13copies or substantial portions of the Software.
14
15THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21SOFTWARE.
\ No newline at end of file
AddedREADME.md at root+168−0View fileUnifiedSplit
@@ -0,0 +1,168 @@
1# Project
2
3A modern full-stack application repository.
4
5
6
7## Table of Contents
8
9- [Overview](#overview)
10- [Features](#features)
11- [Prerequisites](#prerequisites)
12- [Installation](#installation)
13- [Configuration](#configuration)
14- [Usage](#usage)
15- [Scripts](#scripts)
16- [Project Structure](#project-structure)
17- [Contributing](#contributing)
18- [License](#license)
19
20
21
22## Overview
23
24This repository contains the source code for a full-stack application. It is designed to be modular, maintainable, and easy to extend. The project follows modern development practices including strict TypeScript, environment-based configuration, and a clean separation of concerns between client and server.
25
26
27
28## Features
29
30- Modern TypeScript setup with strict type checking
31- Environment-based configuration via `.env` files
32- Modular project structure for scalability
33- Ready-to-use development and production scripts
34- Clean code standards enforced via linting and formatting
35
36
37
38## Prerequisites
39
40Make sure you have the following installed before getting started:
41
42- [Node.js](https://nodejs.org/) v18 or higher
43- [npm](https://www.npmjs.com/) v9 or higher (or [yarn](https://yarnpkg.com/) / [pnpm](https://pnpm.io/))
44- [Git](https://git-scm.com/)
45
46
47
48## Installation
49
501. **Clone the repository**
51
52 ```bash
53 git clone https://github.com/your-org/your-repo.git
54 cd your-repo
55 ```
56
572. **Install dependencies**
58
59 ```bash
60 npm install
61 ```
62
633. **Set up environment variables**
64
65 ```bash
66 cp .env.example .env
67 ```
68
69 Edit the `.env` file and fill in the required values (see [Configuration](#configuration)).
70
71
72
73## Configuration
74
75All configuration is handled through environment variables. Copy `.env.example` to `.env` and update the values accordingly:
76
77| Variable | Description | Required |
78|------------------|--------------------------------------|----------|
79| `NODE_ENV` | Application environment | Yes |
80| `PORT` | Port the server listens on | Yes |
81| `DATABASE_URL` | Connection string for the database | Yes |
82| `JWT_SECRET` | Secret key used for signing JWTs | Yes |
83| `API_BASE_URL` | Base URL for the API | No |
84
85Refer to `.env.example` for a full list of supported variables.
86
87
88
89## Usage
90
91### Development
92
93Start the application in development mode with hot reloading:
94
95```bash
96npm run dev
97```
98
99### Production
100
101Build and start the application for production:
102
103```bash
104npm run build
105npm start
106```
107
108### Running Tests
109
110```bash
111npm test
112```
113
114
115
116## Scripts
117
118| Script | Description |
119|-----------------|--------------------------------------------------|
120| `npm run dev` | Start development server with hot reload |
121| `npm run build` | Compile TypeScript and bundle for production |
122| `npm start` | Start the compiled production application |
123| `npm test` | Run all tests |
124| `npm run lint` | Lint source files using ESLint |
125| `npm run format`| Format source files using Prettier |
126
127
128
129## Project Structure
130
131```
132.
133├── src/
134│ ├── config/ # App configuration and environment parsing
135│ ├── controllers/ # Route controllers / request handlers
136│ ├── middleware/ # Express (or framework) middleware
137│ ├── models/ # Database models / schemas
138│ ├── routes/ # Route definitions
139│ ├── services/ # Business logic layer
140│ ├── utils/ # Utility/helper functions
141│ └── index.ts # Application entry point
142├── tests/ # Test files
143├── .env.example # Example environment variables
144├── .gitignore # Git ignore rules
145├── tsconfig.json # TypeScript configuration
146├── package.json # Project metadata and scripts
147└── README.md # Project documentation
148```
149
150
151
152## Contributing
153
154Contributions are welcome! Please follow these steps:
155
1561. Fork the repository
1572. Create a new branch: `git checkout -b feature/your-feature-name`
1583. Make your changes and commit them: `git commit -m "feat: add your feature"`
1594. Push to your branch: `git push origin feature/your-feature-name`
1605. Open a Pull Request against the `main` branch
161
162Please ensure your code passes linting and tests before submitting a PR.
163
164
165
166## License
167
168This project is licensed under the [MIT License](LICENSE).
\ No newline at end of file
Addedrobots.txt (or app/robots.ts route)+22−0View fileUnifiedSplit
@@ -0,0 +1,22 @@
1User-agent: *
2Allow: /
3
4User-agent: GPTBot
5Disallow: /
6
7User-agent: ChatGPT-User
8Disallow: /
9
10User-agent: CCBot
11Disallow: /
12
13User-agent: anthropic-ai
14Disallow: /
15
16User-agent: Claude-Web
17Disallow: /
18
19User-agent: Google-Extended
20Disallow: /
21
22Sitemap: https://www.example.com/sitemap.xml
\ No newline at end of file
023
c comment · e edit title · m merge · a approve · r request changes · ? shortcuts