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

https://github.com/mkloz/uevent-backend

Ticket marketplace API. https://api.mkloz.com/uevent/api/docs
https://github.com/mkloz/uevent-backend

docker marketplace nestjs openapi prisma s3 stripe typescript

Last synced: 7 months ago
JSON representation

Ticket marketplace API. https://api.mkloz.com/uevent/api/docs

Awesome Lists containing this project

README

          





UEvent Backend


🌐 Website |
🛠️ API Docs |
💻 Frontend Code



Event Sharing Platform API



license
last-commit
repo-top-language
repo-language-count



Developed with the software and tools below.



ESLint
TypeScript
Prisma
Docker
Node.js
Zod
Prettier
Swagger
OpenAPI
AWS S3
Nest.js
PostgreSQL
Redis
JWT
Stripe



## 🔗 Quick Links

> - [📋 Overview](#-overview)
> - [🚀 Tech Stack](#-tech-stack)
> - [🗄️ Database Schema](#️-database-schema)
> - [💻 Getting Started](#-getting-started)
> - [⚙️ Installation](#️-installation)
> - [🕜 Running UEvent Backend](#-running-uevent-be)
> - [📜 Swagger Documentation](#-swagger-documentation)
> - [🤝 Contributing](#-contributing)
> - [📄 License](#-license)

---

## 📋 Overview

UEvent is a comprehensive event sharing platform API built with Nest.js and TypeScript. It provides robust functionality for managing companies, events, tickets, user interactions, and payments in a scalable and secure manner. The platform enables users to create and manage events, purchase tickets, interact through comments and reactions, and receive notifications about relevant updates.

---

## 🚀 Tech Stack

- **Core**: [TypeScript](https://www.typescriptlang.org/), [Nest.js](https://nestjs.com/)
- **Database**: [PostgreSQL](https://www.postgresql.org/), [Prisma ORM](https://www.prisma.io/)
- **Caching**: [Redis](https://redis.io/)
- **Authentication**: [JWT](https://jwt.io/), [bcryptjs](https://www.npmjs.com/package/bcryptjs), [Google OAuth](https://developers.google.com/identity/protocols/oauth2)
- **Storage**: [AWS S3](https://aws.amazon.com/s3/)
- **Email**: [React-email](https://react.email/), [Nodemailer](https://nodemailer.com/)
- **Validation**: [class-validator](https://github.com/typestack/class-validator), [class-transformer](https://github.com/typestack/class-transformer), [zod](https://zod.dev/)
- **Payments**: [Stripe](https://stripe.com/)
- **Security**: [helmet](https://helmetjs.github.io/)
- **Documentation**: [Swagger](https://swagger.io/)
- **Development**: [ESLint](https://eslint.org/), [Prettier](https://prettier.io/)
- **Containerization**: [Docker](https://www.docker.com/)

---

## 🗄️ Database Schema

The database schema is defined using Prisma and includes the following main entities:

- **Users**: Authentication, profiles, and user settings
- **Companies**: Event organizers with location and verification
- **Events**: Event details, location, pricing, and attendee management
- **Tickets**: Purchased tickets for events
- **Comments**: User comments on events and company news
- **Reactions**: User reactions to comments and news
- **Notifications**: System notifications for users
- **Payments**: Payment records for ticket purchases

---

## 💻 Getting Started

### ⚙️ Installation

1. Clone the UEvent Backend repository:

```sh
git clone https://github.com/mkloz/uevent-backend.git
```

2. Change to the project directory:

```shellscript
cd uevent-backend
```

3. Install the dependencies:

```shellscript
npm install
```

4. Create a `.env` file in the root directory with the following variables:

```plaintext
# App
PORT=3000
NODE_ENV=development
SERVER_URL=http://localhost:3000
CLIENT_URL=http://localhost:5173
THROTTLE_TTL=10
THROTTLE_LIMIT=200

# Database
DB_URL=postgresql://postgres:password@localhost:5432/uevent?schema=public
DB_USER=postgres
DB_PASS=password
DB_NAME=uevent
DB_PORT=5432

# JWT
JWT_ACCESS_TOKEN_SECRET=your_access_token_secret
JWT_ACCESS_TOKEN_TIME=15m
JWT_REFRESH_TOKEN_SECRET=your_refresh_token_secret
JWT_REFRESH_TOKEN_TIME=14d

# Mail
MAIL_PORT=465
MAIL_HOST=smtp.example.com
MAIL_AUTH_USER=user@example.com
MAIL_AUTH_PASS=password
MAIL_FROM_NAME=UEvent
MAIL_FROM_ADDRESS=noreply@uevent.com
MAIL_TOKEN_TIME=20m
MAIL_TOKEN_SECRET=your_mail_token_secret

# Redis
REDIS_PORT=6379
REDIS_HOST=localhost
REDIS_PASS=password
REDIS_USER=default
REDIS_ROOT_PASS=root_password

# AWS S3
AWS_S3_REGION=your_region
AWS_S3_ACCESS_KEY_ID=your_access_key
AWS_S3_SECRET_ACCESS_KEY=your_secret_key
AWS_PUBLIC_BUCKET_NAME=your_bucket_name

# Google Auth
AUTH_GOOGLE_APP_ID=your_google_app_id
AUTH_GOOGLE_APP_SECRET=your_google_app_secret
AUTH_GOOGLE_CALLBACK=your_callback_url

# Stripe
STRIPE_SECRET_KEY=your_stripe_secret_key
STRIPE_WEBHOOK_SECRET=your_stripe_webhook_secret
```

5. Initialize the database:

```shellscript
npx prisma migrate dev
```

### 🕜 Running UEvent Backend

1. Start the required services using Docker:

```shellscript
docker-compose up -d
```

2. Run the application in development mode:

```shellscript
npm run start:dev
```

For production:

```shellscript
npm run build
npm run start:prod
```

---

## 📜 Swagger Documentation

To view the Swagger documentation for the UEvent API, follow these steps:

1. Ensure the UEvent Backend application is running.
2. Open your web browser and navigate to `http://localhost:6969/api/docs`.

This will open the Swagger UI, where you can explore and test the API endpoints interactively.

---

## 🤝 Contributing

Contributions are welcome! Here are several ways you can contribute:

- **Submit Pull Requests**: Review open PRs, and submit your own PRs.
- **Report Issues**: Submit bugs found or log feature requests for UEvent Backend.

Contributing Guidelines

1. **Fork the Repository**: Start by forking the project repository to your GitHub account.
2. **Clone Locally**: Clone the forked repository to your local machine using a Git client.

```shellscript
git clone https://github.com/mkloz/uevent-backend
```

3. **Create a New Branch**: Always work on a new branch, giving it a descriptive name.

```shellscript
git checkout -b new-feature-x
```

4. **Make Your Changes**: Develop and test your changes locally.
5. **Commit Your Changes**: Commit with a clear message describing your updates.

```shellscript
git commit -m 'Implemented new feature x.'
```

6. **Push to GitHub**: Push the changes to your forked repository.

```shellscript
git push origin new-feature-x
```

7. **Submit a Pull Request**: Create a PR against the original project repository. Clearly describe the changes and their motivations.

Once your PR is reviewed and approved, it will be merged into the main branch.

---

## 📄 License

This project is licensed under the MIT License - see the [LICENSE](https://github.com/mkloz/uevent-backend/blob/main/LICENSE) file for details.