https://github.com/sajjad177/sql-assignment-8
A backend API for managing bike servicing operations, supporting CRUD for customers, bikes, and service records.
https://github.com/sajjad177/sql-assignment-8
mysql nodejs postgresql prisma-orm typescript
Last synced: 3 months ago
JSON representation
A backend API for managing bike servicing operations, supporting CRUD for customers, bikes, and service records.
- Host: GitHub
- URL: https://github.com/sajjad177/sql-assignment-8
- Owner: Sajjad177
- Created: 2025-04-19T17:35:41.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-04-20T15:18:20.000Z (about 1 year ago)
- Last Synced: 2025-04-23T00:40:14.873Z (about 1 year ago)
- Topics: mysql, nodejs, postgresql, prisma-orm, typescript
- Language: JavaScript
- Homepage: https://bike-management-delta.vercel.app
- Size: 7.83 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 🚴♂ Bike Servicing Management Backend
## 📝 Overview
This is a backend API for managing bike servicing tasks. You can add and manage customers, bikes, and service records. It also lets you assign services, track their status, and mark them as completed.
## 🌐 Live Backend
**[https://bike-servicing-management-chi.vercel.app](https://bike-management-delta.vercel.app)**
## 🛠️ Tech Stack
- **Node.js & Express.js**: Backend runtime and API framework
- **TypeScript**: Type-safe JavaScript
- **Prisma ORM**: Database management
- **PostgreSQL**: Relational database
## ⚙️ Setup Guide
## How to Clone and Run the Project Locally :
1. **Clone the repository:**
- First, you need to clone and open your terminal and type:
```bash
git clone https://github.com/YOUR-USERNAME/YOUR-REPOSITORY
```
2. **Open files in VS Code:**
- After opening the **server-side** files in VS Code, install npm dependencies both file:
```bash
npm install
```
4. **Environment setup:**
```plaintext
DATABASE_URL="postgresql://:@:/?schema=public"
PORT=5000
NODE_ENV=development
```
5. **Access the server :**
- - Check the `package.json` and check whice command add there.
1. Live reloading for typescript code :
```tarminal
npm run dev
```
2. Open prisma Studio :
```tarminal
"studio": npx prisma studio
```
3. Runs the TypeScript compiler to transpile TypeScript files into JavaScript files :
```tarminal
npm run build
```
6. **Run Migrations :**
```plaintext
npx prisma migrate dev --name init
```
## 🔑 Key Features
- 🧑💼 **Customer Management**: Create, read, update, and delete customer records
- 🏍️ **Bike Management**: Add new bikes and retrieve bike data
- 🔧 **Service Management**: Assign services, update progress, and mark services as complete
- ⏰ **Pending/Overdue Services**: Fetch services that are overdue by 7+ days or still pending
- 🚨 **Error Handling**: Unified and standardized API error responses for easier debugging