Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mxsaad/ecommerce-backend
REST and GraphQL APIs for a 5NF MySQL ecommerce database.
https://github.com/mxsaad/ecommerce-backend
ecommerce express graphql mysql nodejs rest-api
Last synced: 15 days ago
JSON representation
REST and GraphQL APIs for a 5NF MySQL ecommerce database.
- Host: GitHub
- URL: https://github.com/mxsaad/ecommerce-backend
- Owner: mxsaad
- License: mit
- Created: 2023-12-25T19:00:55.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-10-19T10:38:41.000Z (2 months ago)
- Last Synced: 2024-11-09T03:53:06.439Z (about 2 months ago)
- Topics: ecommerce, express, graphql, mysql, nodejs, rest-api
- Language: JavaScript
- Homepage: https://ecommerce.mxsaad.com/
- Size: 190 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Ecommerce Platform Backend
## Overview
This project serves as the backend system for an ecommerce platform. It features a 5NF normalized MySQL database, REST APIs, and a GraphQL API. The APIs provide read-only access, while other operations require a JSON Web Token (JWT) for authentication.
## Tech Stack
- Node.js (v20)
- Express.js
- MySQL
- GraphQL
- JavaScript, HTML, CSS## How to Run Locally
To run the project locally, follow these steps:
1. **Clone the Repository:**
```bash
git clone https://github.com/mxsaad/ecommerce-backend.git
cd ecommerce-backend
```2. **Install Dependencies:**
```bash
npm install
```3. **Set Up PlanetScale Database:**
- Create a PlanetScale account and set up a database.
- Execute the SQL script `sql/ecommerce.sql` in your PlanetScale database to initialize the schema and data.4. **Configure Environment Variables:**
- Create a `.env` file in the root of the project based on the provided `.env.example`.
- Fill in the necessary details such as database connection credentials and JWT secret.5. **Run the Project:**
```bash
npm run dev
```6. **Access the APIs:**
- The REST APIs can be accessed at `http://localhost:3000/api/{endpoint}`.
- The GraphQL API can be accessed at `http://localhost:3000/graphql`.