MicroBlog is a simple Flask-based web application that allows users to create and view short blog entries. It uses MongoDB for data storage and provides a clean, minimalistic interface for users to interact with their microblog entries.
- Create new blog entries
- View all entries with formatted dates
- MongoDB integration for data persistence
- Environment variable support for secure configuration
- Responsive design with custom CSS
Before you begin, ensure you have met the following requirements:
- Python 3.6+
- pip (Python package manager)
- MongoDB instance (local or cloud-based)
-
Clone the repository:
git clone https://github.com/Sachinsharmak/Micro-Blog.git cd Micro-Blog
-
Install the required dependencies:
pip install flask pip install pymongo[srv] pip install -r requirements.txt
-
Set up your environment variables: Create a
.env
file in the root directory and add your MongoDB URI:MONGO_URI=your_mongodb_uri_here
To run the application:
- Ensure your MongoDB instance is running.
- From the project root directory, run:
python app.py
- Open a web browser and navigate to
http://localhost:5000
app.py
: Main application file containing Flask routes and MongoDB connectiontemplates/home.html
: Main template for the applicationstatic/css/styles.css
: Custom styles for the application.env
: Environment variables file (not tracked in git)
The frontend of MicroBlog is built with HTML and CSS:
- HTML: The
home.html
template in thetemplates/
directory structures the content of the web page. - CSS: The
styles.css
file in thestatic/css/
directory provides custom styling for a responsive and user-friendly interface. It includes:- A color scheme defined with CSS variables
- Responsive layout using flexbox
- Custom styles for the header, form inputs, and blog entries
- Media queries for different screen sizes
Contributions to MicroBlog are welcome. Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.