Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/mkloz/online-store-backend

Nestjs backend for online store(citywheels) https://api.mkloz.com/store/api/docs
https://github.com/mkloz/online-store-backend

backend docker e-commerce jest mysql nestjs prisma typescript

Last synced: 11 days ago
JSON representation

Nestjs backend for online store(citywheels) https://api.mkloz.com/store/api/docs

Awesome Lists containing this project

README

        






Citywheels



vehicle online shop backend


Developed with the software and tools listed below.

JavaScript
Prettier
Jest
ESLint
MySQL
TypeScript
Prisma
Docker
GitHub%20Actions

GitHub top language
GitHub code size in bytes
GitHub commit activity
GitHub license




Citywheels Frontend
Citywheels Api


## ๐Ÿ“’ Table of Contents

- [๐Ÿ“’ Table of Contents](#-table-of-contents)
- [๐Ÿ“ Overview](#-overview)
- [โš™๏ธ Features](#๏ธ-features)
- [๐Ÿ“‚ Project Structure](#-project-structure)
- [๐Ÿฌ Database Structure](#-database-structure)
- [๐Ÿš€ Getting Started](#-getting-started)
- [โœ”๏ธ Prerequisites](#๏ธ-prerequisites)
- [๐Ÿ“ฆ Native installation](#-native-installation)
- [๐ŸŽฎ Starting server](#-starting-server)
- [๐Ÿงช Running Tests](#-running-tests)
- [๐Ÿค Contributing](#-contributing)
- [๐Ÿ“„ License](#-license)

---

## ๐Ÿ“ Overview

Welcome to the backend documentation for Citywheels, the online store that allows you to shop for various vehicles. This documentation provides an overview of the key features, technologies used, and how to get started with the project.

---

## โš™๏ธ Features

- Product listings: View a list of available products with details such as title, price, description, and images.
- Search functionality: Search for products based on keywords or specific criteria.
- User authentication: Allow users to create accounts, log in, and manage their profiles.
- Shopping cart: Add products to a cart, update quantities, and remove items.
- Order management: Allow users to view their past orders, track packages, and manage returns.
- Admin dashboard: Provide an administrative roles for managing products, users, orders, and other site settings.
- Checkout process: Provide a seamless checkout experience with multiple payment options(comming soon).

---

## ๐Ÿฌ Database Structure


Citywheels Database Structure

---

## ๐Ÿš€ Getting Started

### โœ”๏ธ Prerequisites

Before you begin, ensure that you have the following prerequisites installed:

- For native running:
> - `โ„น๏ธ node:18`
> - `โ„น๏ธ npm 9+`
- For docker running

> - `โ„น๏ธ docker`
> - `โ„น๏ธ docker compose(optional if you know how use docker)`

---

### ๐Ÿ“ฆ Native installation

1. Clone the online-store repository:

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

2. Change to the project directory:

```sh
cd online-store-backend
```

3. Install the dependencies:

```sh
npm install
```

---

### ๐ŸŽฎ Starting server

After installation you can start store server. You will find swagger documentation on GET /api/docs route, hoever only if env != production

Set up .env variables

```bash

cp .env.example .env

```

Execute migrations for database

```bash
npm run migrate
```

Than if you installed project localy

```bash
npm run start
```

OR

Using docker compose

Start database(if you already have one skip this step) and server

```bash
sudo docker compose -f docker-compose-dev.yaml up mysql store
```

---

### ๐Ÿงช Running Tests

Set up test eviroments(in .env file). Be carefull couse it will clean all data, so DO NOT USE PRODUCTION ENV

```sh
npm run test
```

---

## ๐Ÿค Contributing

Contributions are always welcome! Please follow these steps:

1. Fork the project repository. This creates a copy of the project on your account that you can modify without affecting the original project.
2. Clone the forked repository to your local machine using a Git client like Git or GitHub Desktop.
3. Create a new branch with a descriptive name (e.g., `new-feature-branch` or `bugfix-issue-123`).

```sh
git checkout -b new-feature-branch
```

4. Make changes to the project's codebase.
5. Commit your changes to your local branch with a clear commit message that explains the changes you've made.

```sh
git commit -m 'Implemented new feature.'
```

6. Push your changes to your forked repository on GitHub using the following command

```sh
git push origin new-feature-branch
```

7. Create a new pull request to the original project repository. In the pull request, describe the changes you've made and why they're necessary.
The project maintainers will review your changes and provide feedback or merge them into the main branch.

---

## ๐Ÿ“„ License

The "online-store" project is licensed under the [MIT License](LICENSE). Feel free to use, modify, and distribute the code as needed.

---