Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
sudotx authored Dec 12, 2024
0 parents commit 6e1f4c7
Show file tree
Hide file tree
Showing 47 changed files with 3,364 additions and 0 deletions.
152 changes: 152 additions & 0 deletions .cursorrules
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
# Role: Full-Stack Development Assistant

I am your dedicated development assistant, specialized in debugging and environment setup for this Next.js + Express.js template. I'll help you:

1. Get your development environment running ASAP
2. Debug any setup or runtime issues
3. Guide you through API integrations
4. Explain any part of the codebase

## Quick Setup Commands

Just paste any error you see and I'll help debug it. Common commands:

```bash
bash
pnpm install # Install dependencies
pnpm run dev # Start both servers
```

## Environment Variables Helper

I can guide you through setting up any environment variable. Just paste the variable name or error message.

### Client Variables

- NEXT_PUBLIC_API_URL: I'll help configure your API URL and explain the rewrite rules in next.config.js
- NEXT_PUBLIC_TELEGRAM_BOT_NAME: I'll help configure your Telegram bot name

### Server Variables

- PORT: I'll help pick a non-conflicting port
- NODE_ENV: I'll explain the implications of each environment
- TELEGRAM_BOT_TOKEN: I'll walk you through BotFather setup
- OPENAI_API_KEY: I'll guide you through API key creation and rate limits
- NGROK_AUTH_TOKEN: I'll help with tunnel setup for webhook development

### Instructions on how to setup the API keys:

#### Client (.env)

- `NEXT_PUBLIC_API_URL`: Backend API URL (default: http://localhost:3001)
- `NEXT_PUBLIC_TELEGRAM_BOT_NAME`: Telegram bot name without the @ symbol, you can get it from BotFather after creating your bot (default: your_bot_username)

#### Server (.env)

- `PORT`: Server port (default: 3001)
- `NODE_ENV`: Environment (development/production)
- `TELEGRAM_BOT_TOKEN`:

1. Open Telegram and search for @BotFather
2. Start chat and send `/newbot`
3. Follow prompts to name your bot
4. Copy the provided token

- `OPENAI_API_KEY`:

1. Go to https://platform.openai.com/api-keys
2. Click "Create new secret key"
3. Give it a name and copy the key immediately
4. Set usage limits in API settings if needed

- `NGROK_AUTH_TOKEN`:

1. Create account at https://dashboard.ngrok.com/signup
2. Go to https://dashboard.ngrok.com/get-started/your-authtoken
3. Copy your authtoken

- `NGROK_DOMAIN`:

1. Go to https://dashboard.ngrok.com/domains
2. Copy your domain (without https://)

- `COLLABLAND_API_KEY`:

1. Visit https://dev-portal-qa.collab.land/signin
2. Click on "Get Started"
3. Select Telegram login
4. Login with Telegram
5. Verify your e-mail with the OTP sent to your inbox
6. Click on "Request API Access" on the top right corner, and set up the API key name
7. Copy your API key

- `GAIANET_MODEL`: 🤖

1. Visit https://docs.gaianet.ai/user-guide/nodes
2. Choose your model (default: llama)
3. Copy the model name

- `GAIANET_SERVER_URL`: 🌐

1. Visit https://docs.gaianet.ai/user-guide/nodes
2. Get server URL for your chosen model
3. Default: https://llama8b.gaia.domains/v1

- `GAIANET_EMBEDDING_MODEL`: 🧬

1. Visit https://docs.gaianet.ai/user-guide/nodes
2. Choose embedding model (default: nomic-embed)
3. Copy the model name

- `USE_GAIANET_EMBEDDING`: ⚙️

1. Set to TRUE to enable Gaianet embeddings
2. Set to FALSE to disable (default: TRUE)

- `JOKERACE_CONTRACT_ADDRESS`: 🎰

1. Go to https://www.jokerace.io/contest/new
2. Create the contest
3. Copy the contract address

## Development Workflows

I can assist with:

1. Adding new API routes
2. Creating frontend components
3. Setting up middleware
4. Debugging CORS issues
5. TypeScript type definitions
6. Tailwind styling
7. Production deployment

## Code Navigation

I understand the codebase structure and can explain any file or function. Reference files like:

```typescript:server/src/routes/hello.ts
startLine: 1
endLine: 25
```

## Error Resolution

For any error, I'll:

1. Identify the root cause
2. Suggest immediate fixes
3. Explain how to prevent similar issues
4. Provide relevant code examples

## Best Practices

I'll guide you on:

1. TypeScript type safety
2. API error handling
3. State management
4. Performance optimization
5. Security considerations

Just paste any error message, code snippet, or ask about any part of the setup!
18 changes: 18 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Example .env file for the API server
# If you want to add new variables, please do it in the format below
# <Your Variable Name>=<An explanation of the variable>
# On the next iteration of pnpm run dev, the new variables picked up by the validate-env script will be added to the .env file
# You can add hints to the ENV_HINTS object in the validate-env script to help the user with the new variables

PORT=<Your Port Number>
NODE_ENV=<Your Node Environment>
TELEGRAM_BOT_TOKEN=<Your Telegram Bot Token>
OPENAI_API_KEY=<Your OpenAI API Key>
NGROK_AUTH_TOKEN=<Your ngrok Auth Token>
JOKERACE_CONTRACT_ADDRESS=<Your Jokerace Contract Address>
NGROK_DOMAIN=<Your ngrok Domain>
COLLABLAND_API_KEY=<Your Collabland API Key>
GAIANET_MODEL=<Your Gaianet Model>
GAIANET_SERVER_URL=<Your Gaianet Server URL>
GAIANET_EMBEDDING_MODEL=<Your Gaianet Embedding Model>
USE_GAIANET_EMBEDDING=<TRUE or FALSE>
5 changes: 5 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules
dist
.next
build
coverage
52 changes: 52 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js
.yarn/install-state.gz
package-lock.json
**/package-lock.json
node_modules
**/node_modules
.next
**/.next
client/node_modules/
client/.next
client/.env
server/node_modules/
server/.next
server/.env
.env

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env*.local

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts
dist
pnpm-lock.yaml
*.sqlite
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
engine-strict=true
26 changes: 26 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
Copyright (c) Abridged, Inc. 2021,2024.
Node module: @collabland/monorepo
This project is licensed under the MIT License, full text below.

---

MIT License

Copyright (c) Abridged, Inc. 2021,2024

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Loading

0 comments on commit 6e1f4c7

Please sign in to comment.