On a long boring weekend a few months back, I decided to work on a mini-project, a website to share python snippets. This is not something new. Similar products are already there.
This blog post is not about code. This article is just to share the news that I am going to share the source code of a complete project, which is hosted on Digital Ocean. Apart from this news, I will share a little more about the product, its features, hosting, etc.
I will try to keep the article as succinct as possible.
Product: https://pythonsnippets.dev/
Hosted on: DigitalOcean
Tools and Technologies Used:
Programming Language: Python 3.9
Framework: Django 3.2
Database: MySQL 5.7
Web serving and process management: Gunicorn, NGINX, Supervisord
Frontend: HTML, Bootstrap, Font-Awesome. (I tried to use the color scheme similar to Python Logo)
Features:
- Home page lists the recently added and most upvoted snippets. This list displays only the top 10 snippets.
- A non-logged-in user can view and share the python snippets
- A logged-in user can create/add the snippet, can upvote or downvote the snippet
- Archive page lists all the snippets in the system.
- User can copy the content of the snippet, can download the snippet as a python source code file or as a png image (I love this feature - great for sharing on social media).
- Users can share the snippet on Facebook, Twitter, LinkedIn, or WhatsApp. No third-party library is used for this. Sharer URLs of the respective website are used.
- User can navigate to next, previous, or to a random snippet from the current snippet page. This is good for keeping the user engaged.
- The most important feature is - login with Github. This feature allows the users to authenticate themselves but without the pre-registration step on this step. I used Github OAuth (hoping that any visiting user of this website will have a Github Account)
- Once a user is logged in, the user can either add a new snippet or can upvote or downvote a previously upvoted snippet.
The product is not perfect and needs a few enhancements.
I am really happy that I am going to open-source this project ( Just being slightly dramatic here :D ). In laymen's words, I am changing the status of the git repository from private to public. That's it.
You are free to copy/clone the code. Change the code and deploy it. You may claim full ownership of the changed code. You may build any product over it and can monetize it.
This is not a revolutionary product. I am just happy to share it completely, in its original form, along with a link to hosted website. This is the first git repository I am sharing publicly out of many many mini-projects I have worked on in the past 6 years.
I am looking forward to constructive feedback, questions, queries, concerns, and/or suggestions.
Github Repository: https://github.com/anuragrana/pysnip
A customary screenshot, just to make the article look good, is below.
Feel free to connect with me. https://pythoncircle.com/contact/