55 lines
1.4 KiB
Markdown
55 lines
1.4 KiB
Markdown
# EventQR (NestJS + React)
|
|
|
|
A unified EventQR project with a NestJS backend and React frontend.
|
|
|
|
## Prerequisites
|
|
|
|
- Node.js
|
|
- PostgreSQL Database
|
|
|
|
## Setup
|
|
|
|
1. **Configure Database:**
|
|
Update `.env` with your PostgreSQL connection string.
|
|
```env
|
|
DATABASE_URL="postgresql://user:password@localhost:5432/eventqr"
|
|
JWT_SECRET="your-secret"
|
|
PASSWORD="your-login-password"
|
|
```
|
|
|
|
2. **Install Dependencies:**
|
|
```bash
|
|
npm install
|
|
```
|
|
|
|
3. **Setup Database:**
|
|
```bash
|
|
npx prisma migrate dev --name init
|
|
```
|
|
|
|
4. **Build Frontend:**
|
|
```bash
|
|
npm run build:client
|
|
```
|
|
|
|
5. **Start Server:**
|
|
```bash
|
|
npm run start:dev
|
|
```
|
|
|
|
The application will be available at `http://localhost:3000`.
|
|
API endpoints are at `http://localhost:3000/api`.
|
|
|
|
## Features
|
|
|
|
- **Auth:** JWT-based authentication with a simple password check (configured in `.env`).
|
|
- **Events:** Create and list events.
|
|
- **Tickets:** Generate tickets (Types: "Klassenbester", "1er Schüler", "Partyborner"). Scan and validate tickets.
|
|
- **Frontend:** React app served statically by NestJS.
|
|
|
|
## Development
|
|
|
|
- Backend: `src/`
|
|
- Frontend: `client/`
|
|
|
|
To work on the frontend, you can run `cd client && npm run dev` for hot-reloading, but you need to ensure it can proxy to the backend (configured in `vite.config.ts` to proxy `/api` to `http://localhost:3000`). |