Skip to content

HigherLevelDev/local-tool-library

Repository files navigation

Local Tool Library

A community-driven platform for sharing and borrowing tools, built with NestJS, React, TypeScript, and SQLite/PostgreSQL. The Local Tool Library enables neighbors to share their tools, reducing the need for individual tool purchases and fostering community connections.

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. Start the server:
./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:

  • ./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

Demo project created in an hour or two using the HLDK

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors