Skip to content

My version of hastebin built with Next.js, TypeScript, Tailwind, Ace, and MongoDB.

License

Notifications You must be signed in to change notification settings

atomisadev/atombin

Repository files navigation

📓 atombin

A lightweight self-hostable pastebin for storing code in your preferred langage

Technologies

  • Next.js
  • Tailwind
  • Ace Editor
  • Next Themes
  • MongoDB (mongoose)

Building

Note: Docker compatibility is currently in progress

  1. Clone the repository
git clone git@github.com:atomisadev/atombin.git
  1. cd into the repository
cd atombin
  1. Install dependencies
npm install
  1. Create a new file called .env.local
touch .env.local
  1. Populate the .env.local file with environment variables like so
MONGODB_URI=<your mongodb uri>
  1. Run the development server
npm run dev

Optional: in case of hosting on servers

You can use a tool like pm2 to manage running the website. Or, you can host your own instance of this project on Vercel/Heroku.

Self-hosted API

The API that is the backbone of this project is accessible by the developers.

Supported endpoints:

Endpoint: /api/files

Method: GET

Function: This endpoint will return the slugs (id) of all the available atombin documents

Endpoint: /api/files

Method: POST

Function: This endpoint will allow you to create new documents to atombin

Body:

  • content - The actual content of the code

Endpoint: /api/files/{id}

Method: GET

Function: Get the content of any existing post using its id

Please note that these endpoints were not made with developer experience in mind. So, it isn't optimized for the best and easiest developer experience as this is something I hacked together in like an hour as a challenge.

About

My version of hastebin built with Next.js, TypeScript, Tailwind, Ace, and MongoDB.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published