Blog.co is a modern blogging platform that allows users to create, read, update, and delete blog posts. Built with Next.js and Supabase, this application provides a seamless user experience for both authors and readers.
- User Authentication: Secure sign-up and login functionality using Supabase.
- CRUD Operations: Create, read, update, and delete blog posts.
- Responsive Design: Mobile-friendly layout using Tailwind CSS.
- Dynamic Routing: Each blog post has its own unique URL.
- User Profiles: Users can manage their profiles and view their posts.
- View Count: Track the number of views for each blog post.
- Frontend:
- Next.js
- React
- Tailwind CSS
- Backend:
- Supabase (PostgreSQL, Authentication)
- Prisma (ORM)
- Deployment:
- Vercel
Please use the default credentails: (email: admin@gmail.com, password: admin) to log in.
To get a local copy of this project up and running, follow these steps:
-
Clone the repository:
git clone https://github.com/yourusername/blog-co.git
-
Navigate to the project directory:
cd blog-co -
Install dependencies:
npm install
-
Set up environment variables:
-
Create a
.envfile in the root of the project and add your database connection details:DATABASE_URL=your_database_url DIRECT_URL=your_direct_url -
Create a
.env.localfile in the root of the project and add your Supabase credentials:NEXT_PUBLIC_SUPABASE_URL=your_supabase_url NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key
-
-
Run the development server:
npm run dev
-
Open your browser: Navigate to
http://localhost:3000to view the application.
- Sign Up / Login: Users can create an account or log in to access their profiles.
- Create a Post: Authenticated users can create new blog posts.
- Edit / Delete Posts: Users can edit or delete their existing posts.
- View Posts: All users can view published posts.
The email template for the "Confirm Signup" email in Supabase is as follows:
<h2>Confirm your signup</h2>
<p>Follow this link to confirm your user:</p>
<p>
<a href="{{ .SiteURL }}/auth/confirm?token_hash={{ .TokenHash }}&type=email&next={{ .RedirectTo }}">Confirm your email</a>
</p>The email template for the "Reset Password" email in Supabase is as follows:
<h2>Reset Password</h2>
<p>Follow this link to reset the password for your user:</p>
<p>
<a href="{{ .SiteURL }}/auth/confirm?token_hash={{ .TokenHash }}&type=recovery&next=/reset-password">Reset Password</a>
</p>Contributions are welcome! If you have suggestions for improvements or features, feel free to open an issue or submit a pull request.
- Fork the repository.
- Create your feature branch:
git checkout -b feature/YourFeature
- Commit your changes:
git commit -m 'Add some feature' - Push to the branch:
git push origin feature/YourFeature
- Open a pull request.
This project is licensed under the MIT License - see the LICENSE file for details.
Feel free to customize this README further to match your personal style or to include additional information about your project!