Find the perfect open source project to contribute
Opensox AI
Learn more »
Introduction ·
Tech Stack ·
Contributing ·
DiscordOpensox AI is a platform designed to help developers quickly discover open-source projects based on their specific criteria so that you can start contributing in seconds, not in days.
We love our contributors! Here’s how you can contribute:
Opensox AI's stack consists of the following elements:
Opensox needs TypeScript and Node.js >= 18 installations.
Create environment files for both the backend and the frontend before running the apps.
apps/api/.env)Copy the example environment file and update it with your values:
cd apps/api
cp .env.example .envThen edit apps/api/.env and fill in the required values:
# Required
DATABASE_URL="postgresql://USER:PASSWORD@localhost:5432/opensox?schema=public"
JWT_SECRET="replace-with-a-strong-random-secret"
# Optional (good defaults shown)
PORT=8080
CORS_ORIGINS=http://localhost:3000
NODE_ENV=development
# Optional but needed for GitHub queries to work
# Generate a classic token with "public_repo" access at https://github.com/settings/tokens
GITHUB_PERSONAL_ACCESS_TOKEN=ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxNotes:
openssl rand -base64 32 or node -e "console.log(require('crypto').randomBytes(32).toString('hex'))".http://localhost:3000 for local web app.apps/web/.env.local)Create a file at apps/web/.env.local with:
# Required
NEXT_PUBLIC_API_URL="http://localhost:8080"
GOOGLE_CLIENT_ID="your-google-oauth-client-id"
GOOGLE_CLIENT_SECRET="your-google-oauth-client-secret"
NEXTAUTH_SECRET="replace-with-a-strong-random-secret"
# Recommended for production (optional for local dev)
NEXTAUTH_URL="http://localhost:3000"
# Optional analytics (PostHog)
# If you don't use PostHog, you can omit these
# NEXT_PUBLIC_POSTHOG_KEY="phc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
# NEXT_PUBLIC_POSTHOG_HOST="https://us.i.posthog.com" # or https://app.posthog.comNotes:
${NEXT_PUBLIC_API_URL}/api/... for auth and data.http://localhost:3000/api/auth/callback/google).JWT_SECRET. It’s used by NextAuth; it can be different from the backend secret.After creating these files, restart your dev servers so changes take effect.
Run these steps once your DATABASE_URL is set:
cd apps/api
# Generate Prisma client (optional if already generated)
npx prisma generate
# Apply migrations locally
npx prisma migrate dev --name initSeed initial data so features relying on it work correctly:
Option A (recommended): use Prisma Studio to insert the initial row
npx prisma studioThen open the QueryCount model and create a row with:
id: 1total_queries: 0Option B: insert directly via SQL (replace the connection string as needed)
psql "postgresql://USER:PASSWORD@localhost:5432/opensox" \
-c "INSERT INTO \"QueryCount\" (id, total_queries) VALUES (1, 0) ON CONFLICT (id) DO NOTHING;"git clone https://github.com/[your-github-username]/opensox.gitcd into opensox/apps/web and install dependenciespnpm installNow run the dev server:
pnpm run devCongrats! Your frontend is running on localhost:3000.
cd into opensox/apps/api and install dependenciesnpm installNow run the server:
pnpm run devVoila! Your API server is running on localhost:4000.
Now you can access your app at http://localhost:3000.
Alternatively, you can run the API server using Docker. A Dockerfile is provided in the root directory.
Make sure you have your .env file set up in apps/api/.env. You can copy from .env.example (see Backend environment variables section above)
From the root directory, build the Docker image:
docker build -t opensox-api .docker run -p 4000:4000 \
--env-file apps/api/.env \
opensox-apiOr if you prefer to pass environment variables individually:
docker run -p 4000:4000 \
-e DATABASE_URL="postgresql://USER:[email protected]:5432/opensox?schema=public" \
-e JWT_SECRET="your-secret" \
-e PORT=4000 \
opensox-apiNote: When using Docker, if your database is running on your host machine (not in a container), use host.docker.internal instead of localhost in your DATABASE_URL.
Your API server will be available at http://localhost:4000.
For a complete setup with PostgreSQL, you can create a docker-compose.yml file:
version: '3.8'
services:
postgres:
image: postgres:15
environment:
POSTGRES_USER: opensox
POSTGRES_PASSWORD: opensox
POSTGRES_DB: opensox
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
api:
build: .
ports:
- "4000:4000"
environment:
DATABASE_URL: postgresql://opensox:opensox@postgres:5432/opensox?schema=public
JWT_SECRET: your-secret-key
PORT: 4000
NODE_ENV: production
depends_on:
- postgres
volumes:
postgres_data:Then run:
docker-compose up -dNo open issues yet, or sync has not completed.