Skip to content

sarperavci/ctf-writeups-search

Repository files navigation

🔍 CTF Writeups Search

A fast and efficient search engine for CTF (Capture The Flag) writeups and solutions, powered by Typesense. Search through a curated collection of 25,000+ CTF writeups with instant results and smart filtering.

View it live here: https://ctfsearch.hackmap.win

Features

  • 🚀 Instant search with typo tolerance
  • 🏷️ Smart category filtering
  • 📱 Mobile-friendly interface
  • 🌓 Dark/Light theme support
  • ⚡ Fast and responsive UI

Tech Stack

This search experience is powered by Typesense, an open-source, typo-tolerant search engine. It's designed as a faster alternative to Elasticsearch and an open-source alternative to Algolia.

The frontend is built with:

The search backend runs on Typesense, which can be self-hosted or used via Typesense Cloud.

Project Structure

  • src/ - Frontend components and styles
  • scripts/indexer/ - Python scripts for data indexing
  • scripts/data/ - Sample dataset and transformation scripts

Development

To run this project locally:

  1. Install dependencies:
yarn
  1. Start Typesense server (requires Docker):
yarn run typesenseServer
  1. Set up environment:
cp .env.example .env
  1. Index the data:
yarn run indexer:transformWriteups
yarn run indexer:importToTypesense

Data must be in the scripts/data/writeups.json file. In this format:

{
  "documents": [
    {
      "title": "Writeup Title",
      "url": "https://example.com/writeup",
      "author": "Author Name",
      "mirror_url": "https://example2.com/writeup",
      "date": "2024-01-01",
      "base64_content": "base64_encoded_content"
    }
  ]
}
  1. Start development server:
yarn start

Open http://localhost:3000 to see the app.

Environment Variables

Create a .env file with the following variables:

TYPESENSE_API_KEY=xyz
TYPESENSE_HOST=localhost
TYPESENSE_PORT=8108
TYPESENSE_PROTOCOL=http
TYPESENSE_SEARCH_ONLY_API_KEY=xyz

Deployment

The app is designed to be hosted on AWS S3 with CloudFront as CDN:

yarn build
yarn deploy

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT License - feel free to use this code for your own projects.

References

About

Search engine for CTF writeups with instant results.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published