A lightweight API server for a Satoshi Nakamoto AI chatbot.
- RESTful API using Express.js
- Firebase authentication integration
- In-memory conversation storage
- Modular prompt template system
- Mock AI response system (ready for model integration)
POST /api/chat- Process user messages and return AI responsesGET /api/conversations/:id- Retrieve conversation historyDELETE /api/conversations/:id- Delete a conversation
- Node.js (v14 or higher)
- npm or yarn
- Firebase project (for authentication)
- Clone the repository
git clone https://github.com/yourusername/satoshi-ai-server.git
cd satoshi-ai-server
- Install dependencies
npm install
- Set up environment variables
Create a
.envfile in the root directory with the following variables:
PORT=3000
FIREBASE_PROJECT_ID=your-firebase-project-id
NODE_ENV=development
- Start the server
npm run dev
curl -X POST http://localhost:3000/api/chat \
-H "Authorization: Bearer YOUR_FIREBASE_TOKEN" \
-H "Content-Type: application/json" \
-d '{"message": "What do you think about Bitcoin?"}'curl -X GET http://localhost:3000/api/conversations/CONVERSATION_ID \
-H "Authorization: Bearer YOUR_FIREBASE_TOKEN"curl -X DELETE http://localhost:3000/api/conversations/CONVERSATION_ID \
-H "Authorization: Bearer YOUR_FIREBASE_TOKEN"src/
├── controllers/ # Request handlers
├── middlewares/ # Express middlewares
├── models/ # Data models
├── routes/ # API routes
├── services/ # Business logic
├── utils/ # Utility functions
└── index.js # Entry point
Edit the SATOSHI_PERSONA constant in src/utils/prompt-template.js to customize how Satoshi responds to queries.
MIT