Skip to content

About

Template project for new apps (NestJS backend, React frontend)

Resources

Stars

0 stars

Watchers

3 watching

Forks

Repository files navigation

Full Stack Starter Project

A modern, full stack application starter template built with NestJS, React, TypeScript, and SQLite/PostgreSQL.

Tech Stack

Backend

  • Framework: NestJS (Node.js + TypeScript)
  • Authentication: JWT with Passport.js
  • Database:
    • Development: SQLite
    • Production: PostgreSQL
  • ORM: Knex.js
  • API Documentation: Swagger/OpenAPI
  • Testing: Jest + Supertest

Frontend

  • Framework: React (Create React App) with TypeScript
  • UI Components: Shadcn UI
  • Styling: Tailwind CSS
  • Build Tool: Craco (Create React App Configuration Override)

Prerequisites

  • Node.js (v16 or higher)
  • pnpm (preferred package manager)
  • PostgreSQL (for production)

Getting Started

  1. Clone the repository:
git clone <repository-url>
cd fullstack-starter
  1. For Development (Recommended): Open 2 terminals and run:

    Terminal 1 - Backend with database:

    ./buildAndDev.sh

    Terminal 2 - Frontend with hot reload:

    ./frontendDev.sh

    This approach provides:

    • Backend hot reload (automatically restarts when you change backend code)
    • Frontend hot reload (instantly reflects frontend changes)
    • PostgreSQL database running in Docker
    • Separate terminal outputs for easier debugging
  2. For Production: Start the full application:

    ./start.sh

The application will be available at:

Development

Backend Development

  • All new features should be organized in modules under backend/src/modules/
  • Follow the existing module structure:
    modules/feature-name/
    ├── controllers/
    ├── services/
    ├── dto/
    ├── entities/
    └── feature-name.module.ts
    
  • Use TypeScript DTOs for request/response validation
  • Add Swagger documentation for all new endpoints
  • Write e2e tests for new features

Frontend Development

  • Components should be placed in frontend/src/components/
  • Use Tailwind CSS for styling
  • Follow the existing component structure and styling patterns
  • Utilize Shadcn UI components when possible

Database Migrations

  • Migrations are automatically run on application startup
  • Create new migrations in backend/src/migrations/
  • Use timestamp-prefixed names: YYYYMMDDHHMMSS_description.ts
  • Ensure migrations are compatible with both SQLite and PostgreSQL

Testing

Backend Tests

cd backend

# Run e2e tests
pnpm run test:e2e

# Run test coverage
pnpm run test:cov

Frontend Tests

cd frontend
pnpm run test

Scripts

The project includes several utility scripts in the root directory:

  • ./buildAndDev.sh - Start backend with database and hot reload (for development)
  • ./frontendDev.sh - Start frontend with hot reload (for development)
  • ./start.sh - Start the application
  • ./stop.sh - Stop the application
  • ./restart.sh - Restart the application
  • ./build.sh - Build both frontend and backend
  • ./test.sh - Run all tests
  • ./buildAndRestart.sh - Build and restart the application
  • ./testAndRestart.sh - Run tests and restart if successful

License

This project is licensed under the MIT License.

About

Template project for new apps (NestJS backend, React frontend)

Resources

Stars

0 stars

Watchers

3 watching

Forks

Releases

Packages

Used by

Contributors

Languages