Skip to main content

Getting started

Pagemark API is a Flask-based REST API for managing bookmarks, featuring tagging, collections, and full-text search.

Prerequisites

  • Python 3.8+
  • pip (Python package manager)

Install

  1. Clone the repository and navigate to the project root.
  2. Create and activate a virtual environment:
    python -m venv venv
    # On macOS/Linux:
    source venv/bin/activate
    # On Windows:
    venv\Scripts\activate
  3. Install dependencies:
    pip install -r requirements.txt

Hello world

To start the development server, run the provided entry point:

python run.py

The API will be available at http://localhost:5000.

Verify

You can verify the service is running by requesting the bookmarks list (which will be empty initially):

curl http://localhost:5000/api/bookmarks

Expected Response:

{
"bookmarks": [],
"total": 0
}

Next steps

Troubleshooting

Port 5000 already in use

If you see an error that the port is already in use, you can change the port in run.py or set the FLASK_RUN_PORT environment variable.

Missing SECRET_KEY

While the application defaults to change-me in development, ensure you provide a secure SECRET_KEY via environment variables if switching to ProductionConfig.

Dependencies fail to install

Ensure you are using an up-to-date version of pip:

pip install --upgrade pip