61 lines
1.2 KiB
Markdown
61 lines
1.2 KiB
Markdown
# SSAP Backend
|
|
|
|
Node.js/Express backend for SSAP application with PostgreSQL database.
|
|
|
|
## Prerequisites
|
|
|
|
- Node.js (v14 or higher)
|
|
- PostgreSQL database
|
|
- npm or yarn
|
|
|
|
## Setup
|
|
|
|
1. Install dependencies:
|
|
```bash
|
|
npm install
|
|
```
|
|
|
|
2. Create a `.env` file based on `.env.example`:
|
|
```bash
|
|
cp .env.example .env
|
|
```
|
|
|
|
3. Update the `.env` file with your database credentials:
|
|
```
|
|
PORT=8080
|
|
DATABASE_URL=postgresql://username:password@localhost:5432/database_name
|
|
```
|
|
|
|
## Running the Application
|
|
|
|
### Development mode (with auto-reload):
|
|
```bash
|
|
npm run dev
|
|
```
|
|
|
|
### Production mode:
|
|
```bash
|
|
npm start
|
|
```
|
|
|
|
The server will start on the port specified in your `.env` file (default: 8080).
|
|
|
|
## Project Structure
|
|
|
|
```
|
|
backend/
|
|
├── src/ # Source code
|
|
├── .env # Environment variables (not committed)
|
|
├── .env.example # Environment variables template
|
|
├── package.json # Project dependencies
|
|
└── README.md # This file
|
|
```
|
|
|
|
## Technologies
|
|
|
|
- **Express.js** - Web framework
|
|
- **PostgreSQL** - Database
|
|
- **dotenv** - Environment variable management
|
|
- **CORS** - Cross-origin resource sharing
|
|
- **express-rate-limit** - API rate limiting
|