https://github.com/dragodui/auto-god-backend
Server part of auto-god forum
https://github.com/dragodui/auto-god-backend
cors express-validation expressjs mongodb mongoose redis typescript
Last synced: 3 months ago
JSON representation
Server part of auto-god forum
- Host: GitHub
- URL: https://github.com/dragodui/auto-god-backend
- Owner: Dragodui
- Created: 2024-12-03T23:25:27.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-06-09T19:56:47.000Z (about 1 year ago)
- Last Synced: 2025-06-09T20:34:36.436Z (about 1 year ago)
- Topics: cors, express-validation, expressjs, mongodb, mongoose, redis, typescript
- Language: TypeScript
- Homepage:
- Size: 2.81 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# AutoGOD back-end
A forum for enthusiasts of German automobiles
## π¦ Installation
```bash
# 1. Ensure Node.js is installed
# Download and install Node.js from https://nodejs.org if itβs not already installed.
# 2. Clone the repository
git clone https://github.com/Dragodui/auto-god-backend.git
cd auto-god-backend
# 3. Install dependencies
# Using Yarn
yarn
# Or, using npm
npm install
```
## βοΈ Environment Setup
Create a `.env` file in the root directory and add the following parameters:
```env
PORT=8000
SESSION_SECRET='your SESSION_SECRET'
JWT_TOKEN_SECRET='your JWT_TOKEN_SECRET'
REDIS_URL='redis://localhost:6379'
CLIENT_HOST='http://localhost:5173'
NODE_ENV='development'
LOG_LEVEL='info'
```
### Explanation of Environment Variables
| Variable Name | Description |
|--------------------|-------------|
| `PORT` | The port on which the server runs. Default: `8000`. |
| `SESSION_SECRET` | A secret key used for session management. Change it to a strong, random value in production. |
| `JWT_TOKEN_SECRET`| The secret key for signing JWT tokens. Ensure it is kept secure and unique. |
| `REDIS_URL` | The URL of the Redis instance used for caching and session storage. Default: `redis://localhost:6379`. |
| `CLIENT_HOST` | The URL of the frontend client. Default: `http://localhost:5173`. |
| `NODE_ENV` | The environment mode (`development`, `production`, etc.). Default: `development`. |
| `LOG_LEVEL` | The logging level (`debug`, `info`, `warn`, `error`). Default: `info`. |
### Usage
1. Copy the `.env` template and create a new `.env` file:
```sh
cp .env.example .env
```
2. Update the values as needed for your environment.
## π Run the Project
```bash
# Start the development server
# Using Yarn
yarn dev
# Or, using npm
npm run dev
```