{"id":29016412,"url":"https://github.com/shubhojit-mitra-dev/basic-pern-project","last_synced_at":"2026-04-11T18:02:31.809Z","repository":{"id":300781239,"uuid":"1007149355","full_name":"shubhojit-mitra-dev/basic-pern-project","owner":"shubhojit-mitra-dev","description":"This is the structure of a basic PERN stack application with NextJs frontend and backend setup with express, typescript and Jest for unit and supertest for integration testing","archived":false,"fork":false,"pushed_at":"2025-06-23T15:05:33.000Z","size":165,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-23T15:47:14.454Z","etag":null,"topics":["docker","jest","nextjs","nodejs","pern-stack","postgresql"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shubhojit-mitra-dev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-23T14:35:30.000Z","updated_at":"2025-06-23T15:05:37.000Z","dependencies_parsed_at":"2025-06-23T15:57:22.415Z","dependency_job_id":null,"html_url":"https://github.com/shubhojit-mitra-dev/basic-pern-project","commit_stats":null,"previous_names":["shubhojit-mitra-dev/basic-pern-project"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/shubhojit-mitra-dev/basic-pern-project","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shubhojit-mitra-dev%2Fbasic-pern-project","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shubhojit-mitra-dev%2Fbasic-pern-project/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shubhojit-mitra-dev%2Fbasic-pern-project/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shubhojit-mitra-dev%2Fbasic-pern-project/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shubhojit-mitra-dev","download_url":"https://codeload.github.com/shubhojit-mitra-dev/basic-pern-project/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shubhojit-mitra-dev%2Fbasic-pern-project/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261960448,"owners_count":23236575,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","jest","nextjs","nodejs","pern-stack","postgresql"],"created_at":"2025-06-25T22:08:15.541Z","updated_at":"2026-04-11T18:02:31.755Z","avatar_url":"https://github.com/shubhojit-mitra-dev.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PERN Stack Project Boilerplate\n\nThis repository contains a full-stack web application boilerplate using the PERN stack (PostgreSQL, Express, React, Node.js) with TypeScript. It provides a well-structured foundation for building modern web applications with a clear separation between frontend and backend services.\n\n## Table of Contents\n\n- [Overview](#overview)\n- [Technologies](#technologies)\n- [Project Structure](#project-structure)\n- [Getting Started](#getting-started)\n  - [Prerequisites](#prerequisites)\n  - [Node Version](#node-version)\n  - [Setting Up the Database](#setting-up-the-database)\n  - [Installation](#installation)\n  - [Environment Variables](#environment-variables)\n  - [Database Setup](#database-setup)\n  - [Running the Application](#running-the-application)\n- [Development Workflow](#development-workflow)\n- [Frontend](#frontend)\n- [Backend](#backend)\n- [Testing](#testing)\n- [Deployment](#deployment)\n- [Contributing](#contributing)\n- [License](#license)\n\n## Overview\n\nThis project provides a modern, scalable, and type-safe template for building web applications using the PERN stack. It includes:\n\n- A Next.js frontend with TypeScript, Tailwind CSS, and React Query\n- An Express backend with TypeScript, Prisma ORM, and PostgreSQL\n- Docker setup for development database\n- Comprehensive testing setup\n- Linting and code formatting configurations\n\n## Technologies\n\n### Frontend\n\n- **Next.js**: React framework with server-side rendering capabilities\n- **TypeScript**: Type-safe JavaScript\n- **Tailwind CSS**: Utility-first CSS framework\n- **React Query (@tanstack/react-query)**: Data fetching and state management library\n- **Axios**: HTTP client for API requests\n\n### Backend\n\n- **Node.js**: JavaScript runtime\n- **Express**: Web framework for Node.js\n- **TypeScript**: Type-safe JavaScript\n- **Prisma**: Modern ORM for database access\n- **PostgreSQL**: Relational database\n- **Zod**: Schema validation library\n- **JWT**: Authentication using JSON Web Tokens\n- **bcrypt**: Password hashing\n- **Morgan**: HTTP request logger\n- **Helmet**: Security middleware\n\n### Development Tools\n\n- **ESLint**: Code linting\n- **Prettier**: Code formatting\n- **Jest**: Testing framework\n- **Supertest**: HTTP testing\n- **Docker \u0026 Docker Compose**: Containerization\n- **nodemon**: Development server with hot reload\n- **concurrently**: Run multiple commands concurrently\n\n## Quick Start Guide\n\nThis project uses Yarn as the package manager. Make sure you have Yarn installed before proceeding.\n\n### 1. Set Up Node.js Version\n\nWe use a specific Node.js version for consistency (defined in the `.nvmrc` file):\n\n```bash\n# Install nvm if you haven't already\ncurl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash\n\n# Use the Node.js version specified in .nvmrc\nnvm use\n```\n\n### 2. Install All Dependencies\n\nWe provide a convenience script to install dependencies for the root project, frontend, and backend:\n\n```bash\n# Install all dependencies at once\nyarn install-all\n```\n\n### 3. Start the Development Database\nBefore running the application, start the PostgreSQL database using Docker:\n\n```bash\n# Start the database container\ndocker-compose up -d db\n\n# Verify the container is running\ndocker ps\n```\n\n### 4. After your database container is up and running\nYour postgresql database will be available to connect, add the following to your .env file inside of the backend dir\n```bash\n# you must be in the root dir to run this command directly to add the necessary environment variable\ncd backend \u0026\u0026 touch .env \u0026\u0026 echo 'DATABASE_URL=\"postgresql://postgresuser:postgrespassword@localhost:5432/db_postgres?schema=public\"' \u003e\u003e .env\n```\n\n### 5. Generate prisma client and create DB Migrations\nRun the following commands for prisma and postgres setup\n\n```bash\n# Generate prisma client by first going into the backend directory\ncd backend \u0026\u0026 yarn db:generate\n\n# Create database migration by running the following command\nyarn db:migration\n\n# You can also see your database in prisma studio\nyarn db:studio\n```\n\nGo back to the root directory after generating and migrating\n```bash\ncd ..\n```\n\n### 6. Run the Application\nYou have several options to run the application:\n\n```bash\n# Run both frontend and backend concurrently\nyarn dev\n\n# Or run them separately\nyarn frontend  # Starts only the Next.js frontend\nyarn backend   # Starts only the Express backend\n```\n\nThe frontend will be available at http://localhost:3000 and the backend at http://localhost:5000.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshubhojit-mitra-dev%2Fbasic-pern-project","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshubhojit-mitra-dev%2Fbasic-pern-project","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshubhojit-mitra-dev%2Fbasic-pern-project/lists"}