Prerequisites
Before you begin, ensure you have the following installed on your system:- Node.js (v18 or higher recommended)
- npm (comes with Node.js)
- PostgreSQL (v14 or higher)
- Git (for cloning the repository)
Installation
Install dependencies
Install all required npm packages:This will install:
- Express.js for the API server
- Prisma ORM for database management
- Supabase client for authentication
- Additional dependencies (cors, dotenv, jsonwebtoken)
postinstall script will automatically run prisma generate to create the Prisma Client.Set up environment variables
Create a Then edit
.env file in the root directory by copying the example file:.env with your actual configuration values. See Environment Variables for detailed information.Set up the database
Run Prisma migrations to create the database schema:Optionally, seed the database with initial data:See Database Setup for more details.
Verify Installation
Once the server is running, you can verify the installation by checking the API endpoints:Development Scripts
The following npm scripts are available:npm run dev- Start the development server with hot-reloading (uses nodemon)npm start- Start the production servernpm run postinstall- Generate Prisma Client (runs automatically after npm install)