Skip to content

thedevarchive/code-snippet-manager

Repository files navigation

About this Project

This is a web application that allows developers to add and manage their code snippets.

Project idea generated by ChatGPT

Made with React

How to Run

In the Command Line or Terminal, enter this project's directory and type

npm install

to install its dependencies, then type

npm start

to run the project.

You can also check out the demo here. Netlify Status

How to Use

Adding a Code Snippet

Go to Add Snippet. Then, name the snippet in the Title field, select the language the snippet uses and then select the appropriate category for the snippet. Finally, enter the snippet in the text area below the aforementioned fields. Once done, click on the Save button. Afterwards, it should say "Saved!" if a new snippet has been added to the list.

Viewing and Managing Code Snippets

Click on View Snippets to see all the saved snippets. Use the filters to sort them by category, language or both. Click on the pencil icon to edit the snippet and its details, click on the copy button to copy the snippet to the clipboard or click on the bin icon to delete the snippet. Unlike the languages, there will be no dialog box asking you to confirm this decision, so make sure you are certain you want to delete a snippet.

Editing Code Snippets

Feel free to make changes to any of the details of the code snippets. Once you are done, click on the floppy disc icon to save it. If you change your mind, click on the cross icon.

Adding a Language

Click on Manage Languages in the application's bar and clicking on the plus sign. Then, type the name of the language and click on the floppy disc icon to save it. You may also click on the cross if you change your mind.

Managing Languages

You can edit or delete languages in the Manage Languages page. Click on the pencil icon to edit the name of the language, or click on the bin icon to delete it.

When editing, click on the floppy disc icon to save changes. Otherwise, click on the cross button to revert changes.

If you delete a language, all snippets using that language will be deleted as well. A confirmation dialog box will appear asking you if you want to confirm deletion, and once you click on Delete, you cannot undo the action.

Saving Code Snippets

You can save snippets by clicking on the Download button in the View Snippets page. You may save it with any name of your choosing, and after clicking on Save on the dialog box, you will get a JSON file containing the saved snippets and languages.

Loading Code Snippets

You can upload the JSON file containing the snippets and the languages by clicking on the Upload button in the View Snippets page. If successful, you will be able to see the file's saved snippets and languages on the website.

Features

  • Ability to save and organise code languages for multiple snippets
  • Ability to filter snippets by category and language
  • Ability to categorise snippets (Frontend, Backend, Database, Algorithms)
  • Support for different language types (programming language, markup language, etc.)
  • Dark mode and light mode (plus different code themes for each mode)
  • Syntax highlighting with Prism.js
  • Local storage support
  • JSON import and export (saves languages and snippets)

How to Report Issues

Email me at [email protected] if you find any bugs in the program or have any issues running it. Any feedback and suggestions is also appreciated.