linkpen

Development Guide

This guide covers everything you need to know about developing with LinkPen.

Project Structure

linkpen/
├── logs/                   # This folder is automatically generated and contains various debug logs
├── public/
│   ├── css/                # Stylesheets
│   ├── img/                # Images and assets
│   ├── templates/          # Templates
│   ├── js/                 # JavaScript
│   └── docs/               # Documentation
├── routes/                 # This folder contains various API routes
├── utils/                  # This folder contains various tools
├── views/
│   ├── pages/              # EJS page templates
│   │   ├── admin/          # Admin page templates
│   │   ├── auth/           # Auth page templates
│   │   └── dashboard/      # Dashboard page templates
│   └── partials/           # Reusable EJS components
├── server.js               # Main application file
├── config.js               # Auth catch-all
├── global-variables.json   # Global Variables
└── database.sqlite         # SQLite Database (auto-generated)

Local Development

  1. If you haven’t already, install dependencies:
    # Install development dependencies
    npm install
    
  2. Modify the global-variables.json:
Summary


{
  "rootDomain": "http://your-domain.com",
  "hostPort": "5500",
  "siteTitle": "LinkPen",
  "discordInvite": "https://discord.gg/your-invite-link",
  "database_key": "your_database_secret_key",
  "isPublic": false
}
  1. Start development server with auto-reload:
    npm run dev
    

Creating Templates

Templates are stored in public/templates/. To create a new template:

  1. Create a new directory for your template:
    mkdir public/templates/my-template
    

    or right-click and “create new folder”

  2. Required files:
    my-template/
    ├── template.ejs    # Template markup
    └── style.css       # Template styles
    

Additionally, you will need to modify the config file at public/templates/config.json


{
    "default": {
        "name": "Catppuccin Frappé (Default)",
        "author": "Linkpen Dev team",
        "description": "😸 Soothing pastel theme for the high-spirited!"
    },
    "your_theme": {
        "name": "yourTheme",
        "author": "You :)",
        "description": "Wow, a description."
    }
}

*replace your_theme with your theme’s folder name and fill in the details according to your theme.

**For a more in-depth guide, navigate to Templates

Contributing

  1. Fork the repository
  2. Create a feature branch
    git checkout -b feature/my-new-feature
    
  3. Commit your changes
    git commit -am 'Add some feature'
    
  4. Push to the branch
    git push origin feature/my-new-feature
    
  5. Create a Pull Request

Code Style Guidelines

See our GitHub Issues for more details.

Next Steps