Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/mariussde/ecommerce-api

Nest js api with supabase db for a Next js frontend
https://github.com/mariussde/ecommerce-api

nestjs nodejs supabase

Last synced: 10 days ago
JSON representation

Nest js api with supabase db for a Next js frontend

Awesome Lists containing this project

README

        


Nest Logo

[circleci-image]: https://img.shields.io/circleci/build/github/nestjs/nest/master?token=abc123def456
[circleci-url]: https://circleci.com/gh/nestjs/nest

A progressive Node.js framework for building efficient and scalable server-side applications.



NPM Version
Package License
NPM Downloads
CircleCI
Coverage
Discord
Backers on Open Collective
Sponsors on Open Collective
Donate us
Support us
Follow us on Twitter

## Description

[Nest](https://github.com/nestjs/nest) framework TypeScript starter repository with Supabase integration for an e-commerce API.\
\
Please keep in mind the api is hosted in a free tier plan so after 15 minutes of inactivity it'll shutdown and **wake up time is around 50 seconds**.

## Project Setup

1. Install dependencies:
```bash
$ npm install
```

2. Set up Supabase:
- Create a new project at [Supabase](https://supabase.com)
- Go to Project Settings > API
- Copy the Project URL and anon/public API key
- Create a `.env` file in the root directory with:
```
SUPABASE_URL=your-project-url
SUPABASE_KEY=your-anon-key
```

3. Initialize the database:
- Go to Supabase SQL Editor
- Copy the contents of `init.sql` from the project root
- Run the SQL commands to create and populate the database tables

## API Documentation

The project includes a Postman collection (`api-calls.json`) with example requests for all endpoints. Import this file into Postman to test the API.

## Running the Project

```bash
# development
$ npm run start

# watch mode
$ npm run start:dev

# production mode
$ npm run start:prod
```

## Test

```bash
# unit tests
$ npm run test

# e2e tests
$ npm run test:e2e

# test coverage
$ npm run test:cov
```

## License

Nest is [MIT licensed](https://github.com/nestjs/nest/blob/master/LICENSE).