This project is currently under active and heavy development. It is NOT ready for general use and may contain bugs, incomplete features, or breaking changes. Use at your own risk.
This is the backend API for InkSpire, a modern web-based text editor. It provides all the necessary services for the InkSpire Frontend to function.
- RESTful API: Provides a complete set of endpoints for file and directory management.
- JWT Authentication: Secures the API using JSON Web Tokens for stateless authentication.
- PHP 8.2 or later
- Composer
- Symfony CLI
-
Clone the repository:
git clone <repository-url> cd inkspire-api
-
Install dependencies:
composer install
-
Set up environment variables: Create a
.envfile and configure your database connection and other variables. You will need to generate the JWT keys.php bin/console lexik:jwt:generate-keypair
This will generate
config/jwt/private.pemandconfig/jwt/public.pemand update your.envfile. -
Run database migrations:
php bin/console doctrine:database:create --env=dev php bin/console doctrine:database:create --env=test php bin/console doctrine:migrations:migrate --env=dev php bin/console doctrine:migrations:migrate --env=test php bin/console doctrine:fixtures:load
-
Create file storage folder:
mkdir var/files
-
Start the server:
symfony server:start
The API will be running at http://127.0.0.1:8000.
A Postman collection or OpenAPI/Swagger documentation will be available soon. Here are the main endpoints:
POST /auth: Authenticate and receive a JWT.
GET /api/tree: Get the full file and directory structure for the user.POST /api/file: Create a new file.GET /api/file/{id}: Get details for a specific file.PUT /api/file/{id}: Update a file's details (e.g., name, parent directory).DELETE /api/file/{id}: Delete a file.POST /api/dir: Create a new directory.GET /api/dir/{id}: Get details for a specific directory and its contents.PUT /api/dir/{id}: Update a directory's details (e.g., name, summary).DELETE /api/dir/{id}: Delete a directory.
POST /api/ollama/generate: Get a completion for the provided text using the provided model.
This project uses AI-assisted development for rapid implementation, with human oversight and validation. Automated tests are in place to ensure API correctness and reliability.
Run the test suite:
php bin/phpunitThis project is released under the MIT License. It is provided as is, without warranty, but every effort is made to ensure code reliability and responsible use of AI-generated components.
InkSpire is based on a code developped by:
© 2025 InkSpire. Built with care, code, and a bit of inkSpiration.
