npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

linqapp-backend

v1.0.0

Published

LinqApp Backend - AI Data Collection and Storage Platform

Readme

LinqApp Backend

Backend API server for LinqApp - AI Data Collection and Storage Platform.

Project Structure

backend/
├── src/
│   ├── config/
│   │   └── supabase.js          # Supabase client configuration
│   ├── routes/
│   │   ├── auth.js              # Authentication routes
│   │   ├── workspaces.js        # Workspace management routes
│   │   ├── data.js              # Data management routes
│   │   └── external-apps.js     # External app integration routes
│   └── index.js                 # Main Express server
├── package.json
├── .gitignore
└── README.md

Setup Instructions

Prerequisites

  • Node.js (v18 or higher)
  • npm or yarn
  • Supabase account

1. Install Dependencies

cd backend
npm install

2. Supabase Project Setup

You need to create a new Supabase project on their website. Follow these steps:

A. Create Supabase Project

  1. Go to supabase.com
  2. Sign in or create an account
  3. Click "New Project"
  4. Choose your organization
  5. Enter project details:
    • Name: linqapp
    • Database Password: Choose a strong password (save this!)
    • Region: Choose closest to your location
  6. Click "Create new project"
  7. Wait for the project to be created (takes 2-3 minutes)

B. Get Project Configuration

Once your project is ready:

  1. Go to SettingsAPI
  2. Copy the following values:
    • Project URL (looks like: https://xxxxx.supabase.co)
    • Anon public key (starts with eyJhbGc...)
    • Service role key (starts with eyJhbGc...)

C. Configure Google OAuth

  1. Go to AuthenticationProviders
  2. Find "Google" and click the toggle to enable it
  3. Add your Google OAuth credentials:
    • You'll need to create a Google OAuth app at console.developers.google.com
    • Add the callback URL: https://your-project-ref.supabase.co/auth/v1/callback

3. Environment Configuration

  1. Create a .env file in the backend directory:
# Copy the example file
cp .env.example .env
  1. Fill in your .env file with the values from Supabase:
# Supabase Configuration
SUPABASE_URL=https://your-project-ref.supabase.co
SUPABASE_ANON_KEY=your_anon_key_here
SUPABASE_SERVICE_ROLE_KEY=your_service_role_key_here

# Database Configuration
DATABASE_URL=your_database_url_from_supabase

# Authentication Configuration
JWT_SECRET=your_random_jwt_secret_here
GOOGLE_CLIENT_ID=your_google_oauth_client_id
GOOGLE_CLIENT_SECRET=your_google_oauth_client_secret
GOOGLE_OAUTH_REDIRECT_URL=https://bdoprzphzdkfljanmzzc.supabase.co/auth/v1/callback

# OpenAI Configuration (for Phase 1G)
OPENAI_API_KEY=your_openai_api_key

# Application Configuration
NODE_ENV=development
PORT=3000
API_BASE_URL=http://localhost:3000

# Encryption Configuration
MASTER_ENCRYPTION_KEY=your_random_32_char_key_here

# File Upload Configuration
MAX_FILE_SIZE=10485760
ALLOWED_FILE_TYPES=image/jpeg,image/png,image/gif,audio/mpeg,audio/wav,audio/ogg

# CORS Configuration
ALLOWED_ORIGINS=http://localhost:3000,http://localhost:5173

# Logging Configuration
LOG_LEVEL=info

4. Start the Development Server

npm run dev

The server will start on http://localhost:3000

5. Test the Setup

Visit http://localhost:3000/health - you should see:

{
  "status": "OK",
  "message": "LinqApp Backend is running",
  "timestamp": "2024-01-XX...",
  "environment": "development"
}

6. Test Route Endpoints

All route placeholders should be working:

  • GET /api/auth/test → "Auth routes working"
  • GET /api/workspaces/test → "Workspace routes working"
  • GET /api/data/test → "Data routes working"
  • GET /api/external-apps/test → "External apps routes working"

Next Steps

This completes Subphase 1A: Infrastructure Setup.

Next we'll implement:

  • Subphase 1B: Authentication System with Google OAuth
  • Subphase 1C: Database Schema Design
  • Subphase 1D: Encryption System
  • And so on...

Available Scripts

  • npm run dev - Start development server with nodemon
  • npm start - Start production server
  • npm run db:start - Start local Supabase (when using local development)
  • npm run db:stop - Stop local Supabase
  • npm run db:status - Check Supabase status
  • npm run db:reset - Reset database
  • npm run db:generate-types - Generate TypeScript types from database

Environment Variables Needed

Make sure you have all these environment variables set up:

  • SUPABASE_URL - From Supabase dashboard
  • SUPABASE_ANON_KEY - From Supabase dashboard
  • SUPABASE_SERVICE_ROLE_KEY - From Supabase dashboard
  • GOOGLE_CLIENT_ID - From Google OAuth setup
  • GOOGLE_CLIENT_SECRET - From Google OAuth setup
  • OPENAI_API_KEY - For AI processing (Phase 1G)
  • ⚠️ JWT_SECRET - Generate a random string
  • ⚠️ MASTER_ENCRYPTION_KEY - Generate a random 32-character string

Troubleshooting

Common Issues

  1. "Missing Supabase environment variables"

    • Check that your .env file exists and has the correct Supabase values
  2. CORS errors

    • Make sure ALLOWED_ORIGINS includes your frontend URL
  3. Connection refused

    • Verify your Supabase project URL is correct
    • Check if Supabase project is active

Getting Help

If you encounter issues:

  1. Check the console logs for detailed error messages
  2. Verify all environment variables are set correctly
  3. Test the Supabase connection directly in their dashboard