A modern, lightweight tumbleloggin/microblogging platform built with Next.js, TypeScript, and SQLite. Share your thoughts with the world through a simple, elegant interface.
- Simple Posting: Create and share posts with a clean, minimal interface
- User Authentication: Secure login system with admin access
- Admin Dashboard: Manage posts, view statistics, and customize site settings
- Dark/Light Theme: Toggle between themes for comfortable reading
- Real-time Updates: Posts appear instantly without page refresh
- Responsive Design: Works seamlessly on desktop and mobile devices
- SQLite Database: Lightweight, file-based database for easy deployment
- TypeScript: Full type safety for better development experience
- Framework: Next.js 15.4.4
- Language: TypeScript
- Database: SQLite (better-sqlite3)
- Styling: Tailwind CSS
- Authentication: bcrypt for password hashing
- State Management: React Context API
- Deployment: Ready for Vercel, Netlify, or any Node.js hosting
Before you begin, ensure you have the following installed:
- Node.js (version 18 or higher)
- npm or yarn package manager
git clone <repository-url>
cd microblognpm install
# or
yarn installThe database will be automatically created when you first run the application. However, you can seed it with initial data:
# Seed admin user and default settings
npm run seed-adminnpm run dev
# or
yarn devOpen http://localhost:3000 in your browser to see the application.
After running the seed script, you can log in with:
- Username:
admin - Password:
admin123
microblog/
βββ src/
β βββ app/ # Next.js app directory
β β βββ admin/ # Admin dashboard pages
β β βββ api/ # API routes
β β βββ login/ # Login page
β β βββ posts/ # Posts page
β β βββ globals.css # Global styles
β β βββ layout.tsx # Root layout
β β βββ page.tsx # Home page
β βββ components/ # Reusable components
β βββ context/ # React context providers
β βββ lib/ # Utility functions and database
βββ scripts/ # Database seeding scripts
βββ microblog.db # SQLite database file
βββ package.json
- Simple token-based authentication using localStorage
- Secure password hashing with bcrypt
- Protected admin routes
- posts: Stores blog posts with id, content, and timestamp
- users: Stores user credentials (username, hashed password)
- settings: Stores site configuration (site name, tagline, privacy settings)
- View site statistics (post count, user count)
- Manage and delete posts
- Customize site settings (name, tagline, privacy)
- User profile management
- Push your code to GitHub
- Connect your repository to Vercel
- Deploy with default settings
The application can be deployed to any platform that supports Node.js:
# Build the application
npm run build
# Start the production server
npm startThe Server.js file is the one that should be called in your Node.js setup on CPanel environments.
Create a .env.local file in the root directory for local development:
# Database path (optional, defaults to microblog.db)
DATABASE_PATH=./microblog.dbYou can customize the site through the admin dashboard or by modifying the database directly:
- Site Name: The name displayed in the header
- Site Tagline: A brief description of your blog
- Posts Public: Whether posts are visible to non-authenticated users
GET /api/posts- Retrieve postsPOST /api/posts- Create a new postDELETE /api/posts/[id]- Delete a postGET /api/stats- Get site statisticsGET /api/settings- Get site settingsPOST /api/settings- Update site settingsPOST /api/auth- Authenticate user
The application supports dark and light themes. You can customize the theme colors by modifying the CSS variables in src/app/globals.css.
The application uses Tailwind CSS for styling. You can customize the design by modifying the Tailwind configuration or adding custom CSS.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
If you encounter any issues or have questions:
- Check the Issues page
- Create a new issue with a detailed description
- Include steps to reproduce the problem
- Built with Next.js
- Styled with Tailwind CSS
- Database powered by better-sqlite3
Happy blogging! π
