Skip to content

Latest commit

 

History

History
77 lines (49 loc) · 1.41 KB

README.md

File metadata and controls

77 lines (49 loc) · 1.41 KB

Make Me Project - Server

Backend service for the DIY Project platform. Provides an API that interacts with OpenAI to fetch DIY project details and suggestions.

🚀 Getting Started

Prerequisites

Installation

  1. Navigate to the server directory:
cd server
  1. Install the dependencies:
npm install
  1. Set up your environment variables:

Copy the .env.example file and create a new .env file with your own settings.

Running the Server

For development:

npm run watch:dev

For production:

npm run start

Database Setup (Prisma)

This project uses Prisma as an ORM to interact with the database. Follow these steps to set up and seed the database:

  1. Ensure you have PostgreSQL installed and running on your system.

  2. Apply database migrations to create the schema:

npx prisma migrate dev --name init

2.1. If there's already a migration file use this to sync:

npx prisma db push
  1. If seed doesn't automatically run, it will seed the database with initial data
npx prisma db seed
# or
npx prisma migrate reset
  1. Deploy in the production
npx prisma migrate dev --create-only
npx prisma migrate deploy

This sets up the database schema and populates it with initial data, allowing your server to interact with the database using Prisma.