SharpDotNUT ServerLite is a lightweight key-value storage server built with Bun and Elysia.js, providing simple API interfaces for managing key-value data across multiple projects.
- 🗂️ Multi-Project Support: Create multiple independent project spaces
- 🔐 Authentication: Secure access control based on authentication tokens
- 💾 Key-Value Storage: Simple key-value data operations
- 🚀 High Performance: Leverages Bun's performance advantages and in-memory caching mechanisms
- Bun runtime
# Clone and navigate to project directory
cd your-project-directory/packages/app/dist
# or
cd path-to-binary-file
# Set environment variables
echo "DATABASE=your_database_path.db" > .env
# Start the service
bun run serverlite.ts
# or
./serverliteYou can use the --port=[port] to specify a custom port for the service
The service runs by default at http://localhost:[port]
GET /api/list
Returns a list of all current project names
POST /api/project/:project?auth=:auth
:project: Project name:auth: Authentication token
DELETE /api/project/:project?auth=:auth
:project: Project name to delete:auth: Authentication token
GET /:project/:key?auth=:auth
:project: Project name:key: Key name:auth: Authentication token
POST /:project/:key?auth=:auth&value=:value
:project: Project name:key: Key name:auth: Authentication token:value: JSON formatted value
DELETE /:project/:key?auth=:auth
:project: Project name:key: Key name to delete:auth: Authentication token
- Table Name Validation: Uses regular expressions to validate project name format (
^[a-zA-Z_][a-zA-Z0-9_]*$) - Password Hashing: All authentication tokens are stored after being hashed
- Access Control: Each operation requires proper authentication token verification
__projects__table: Stores project information (ID, name, authentication hash)- Dynamic project tables: Each project corresponds to an independent table storing key-value pairs
DATABASE: SQLite database file path
- Project names can only contain letters, numbers, and underscores, and must start with a letter or underscore
- All authentication tokens are hashed to ensure security
- Data for each project is stored in independent tables to achieve data isolation