DesignHub is a platform where users share and tweak React component code snippets—from buttons to modals—making UI design knowledge accessible to everyone. This repository contains the backend server powering DesignHub, built with Node.js, Express, and TypeScript, with Prisma managing a MySQL database.
Table of Contents
The DesignHub backend is responsible for handling all server-side operations, including:
- User management and authentication.
- CRUD operations for UI component snippets.
- Serving data via a RESTful API.
By leveraging Express and TypeScript, the backend provides a robust and type-safe environment, while Prisma simplifies database interactions with MySQL.
- Node.js – JavaScript runtime.
- Express.js – Web framework for building APIs.
- TypeScript – Superset of JavaScript for type safety.
- Prisma – ORM for MySQL database management.
- MySQL – Relational database.
Ensure you have the following installed:
-
Clone the repository:
git clone https://github.com/jlokitha/DesignHub-Backend.git cd DesignHub-Backend -
Install dependencies:
npm install
-
Generate Prisma Client:
npx prisma generate
Create a .env file in the project root and configure the following variables:
# MySQL connection string
DATABASE_URL="mysql://USER:PASSWORD@HOST:PORT/DATABASE_NAME"
BASE_URL="http://localhost:3000"
# Secret keys
SECRET_KEY=[Secret key for JWT]
REFRESH_TOKEN=[Refresh token secret key]To start the development server with live reload, run:
npm startDetailed API endpoint documentation is available via our Postman collection.
Access it here.
Access the frontend repository on GitHub here.
This project is licensed under the MIT License. See the LICENSE file for details.
© 2025 Janindu Lokitha