Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev #22

Open
wants to merge 28 commits into
base: main
Choose a base branch
from
Open

Dev #22

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
f91c353
creating folder structure
Vimodya Feb 21, 2024
085a114
creating folder strucrure and layout
Vimodya Feb 23, 2024
40afbf2
create navBar
Vimodya Feb 24, 2024
449b22a
Merge pull request #1 from Vimodya/navBar
Vimodya Feb 24, 2024
769dc24
create home and about page
Vimodya Feb 24, 2024
96789a4
Merge pull request #2 from Vimodya/homePage
Vimodya Feb 24, 2024
f0667de
feat: create pages
Vimodya May 27, 2024
efe59e7
feat: create contact page
Vimodya May 27, 2024
00bdaed
feat: create blog component
Vimodya May 27, 2024
2795f69
Merge pull request #3 from Vimodya/contactPage
Vimodya May 27, 2024
0d115ef
feat: crate blog page
Vimodya May 27, 2024
6012242
Merge pull request #4 from Vimodya/singleBlogpage
Vimodya May 27, 2024
eb8ba2b
feat: create database connection
Vimodya May 29, 2024
4eb3974
Merge pull request #5 from Vimodya/databaseConnect
Vimodya May 29, 2024
2bf7e72
fix: correct some styles of pages
Vimodya May 30, 2024
525bb13
feat: add create blog form
Vimodya May 30, 2024
e2bcc95
Merge pull request #7 from Vimodya/blogform
Vimodya May 30, 2024
8269f98
Merge pull request #8 from Vimodya/blogsposting
Vimodya May 31, 2024
677b901
feat: create post request
Vimodya May 31, 2024
bedf02e
feat: create get and post requests
Vimodya Jun 10, 2024
08325e2
Merge pull request #9 from Vimodya/blogsposting
Vimodya Jun 11, 2024
21f230f
feat: develop the divide section blogs by category
Vimodya Jun 11, 2024
dbdb1ec
Merge branch 'blogsposting' into dev
Vimodya Jun 11, 2024
688a60c
Merge branch 'dev' of https://github.com/Vimodya/project-Blog-App int…
Vimodya Jun 11, 2024
f8e061a
fix: fix some problems
Vimodya Jun 11, 2024
b776085
Merge pull request #10 from Vimodya/bugFixing
Vimodya Jun 11, 2024
87a88f9
feat: create responsive app
Vimodya Jun 12, 2024
f06c129
Merge pull request #11 from Vimodya/responsiveapp
Vimodya Jun 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions jsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"compilerOptions": {
"jsx": "react",
"paths": {
"@/*": ["./src/*"]
}
Expand Down
12 changes: 12 additions & 0 deletions lib/mongodb.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import mongoose from "mongoose";

const connectMongoDB = () => {
try {
mongoose.connect(process.env.MONGODB_URL);
console.log("connect to MongoDB");
} catch (error) {
console.log(`DB error is 💥 ${error}`);
}
};

export default connectMongoDB;
32 changes: 32 additions & 0 deletions models/blogModel.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
const mongoose = require("mongoose");

const blogSchema = new mongoose.Schema({
authorName: {
type: String,
required: [true, "Please enter the author's name"],
},
publishDate: {
type: Date,
required: [true, "Please enter the publish date"],
},
blogCategory: {
type: String,
required: [true, "Please enter the blog category"],
},
blogTitle: {
type: String,
required: [true, "Please enter the blog title"],
},
blogContent: {
type: String,
required: [true, "Please enter the blog content"],
},
blogImage: {
type: String,
required: [true, "Please enter the blog image"],
},
});

const Blog = mongoose.models.Blog || mongoose.model("Blog", blogSchema);

module.exports = Blog;
21 changes: 21 additions & 0 deletions models/user.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import mongoose, { Schema, model, models } from "mongoose";

const userSchema = new Schema({
name: {
type: String,
required: true,
},
email: {
type: String,
required: true,
unique: true,
},
password: {
type: String,
required: true,
},
});

const User = models.User || model("User", userSchema);

export default User;
10 changes: 8 additions & 2 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
/** @type {import('next').NextConfig} */
const nextConfig = {}
const nextConfig = {};

module.exports = nextConfig
// next.config.js
module.exports = {
reactStrictMode: true,
images: {
domains: ["res.cloudinary.com"],
},
};
Loading