Skip to content

Commit

Permalink
add register logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Johndev85 committed Nov 20, 2023
1 parent ea995f9 commit 3ec6bdf
Show file tree
Hide file tree
Showing 12 changed files with 264 additions and 25 deletions.
9 changes: 8 additions & 1 deletion next.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
/** @type {import('next').NextConfig} */
const nextConfig = {}

const path = require("path")

const nextConfig = {
sassOptions: {
includePaths: [path.join(__dirname, "styles")],
},
}

module.exports = nextConfig
148 changes: 140 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
},
"devDependencies": {
"eslint": "8",
"eslint-config-next": "14.0.3"
"eslint-config-next": "14.0.3",
"sass": "^1.69.5"
}
}
10 changes: 5 additions & 5 deletions src/app/api/auth/signup/route.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { connectDB } from "@/libs/mongodb"
import User from "@/models/user"
import { connectDB } from "@/utils/dbConnect"
import User from "@/models/User"
import { NextResponse } from "next/server"
import bcrypt from "bcryptjs"
import mongoose from "mongoose"
Expand All @@ -8,7 +8,7 @@ export async function POST(request) {
try {
await connectDB()

const { fullname, email, password } = await request.json()
const { username, email, password } = await request.json()

if (password < 6)
return NextResponse.json(
Expand All @@ -31,7 +31,7 @@ export async function POST(request) {
const hashedPassword = await bcrypt.hash(password, 12)

const user = new User({
fullname,
username,
email,
password: hashedPassword,
})
Expand All @@ -41,7 +41,7 @@ export async function POST(request) {

return NextResponse.json(
{
fullname,
username,
email,
createdAt: savedUser.createdAt,
updatedAt: savedUser.updatedAt,
Expand Down
9 changes: 9 additions & 0 deletions src/app/dashboard/profile/page.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const Profile = () => {
return (
<div>
<h1>Profile</h1>
</div>
)
}

export default Profile
13 changes: 13 additions & 0 deletions src/app/globals.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}

body,
html {
height: 100%;
width: 100%;
background: #111111;
color: #ffffff;
}
10 changes: 5 additions & 5 deletions src/app/layout.jsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { Inter } from 'next/font/google'
import './globals.css'
import { Inter } from "next/font/google"
import "./globals.scss"

const inter = Inter({ subsets: ['latin'] })
const inter = Inter({ subsets: ["latin"] })

export const metadata = {
title: 'Create Next App',
description: 'Generated by create next app',
title: "Create Next App",
description: "Generated by create next app",
}

export default function RootLayout({ children }) {
Expand Down
2 changes: 1 addition & 1 deletion src/app/page.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Image from "next/image"
import styles from "./page.module.css"
import styles from "./page.module.scss"

export default function Home() {
return <h1>Homapage</h1>
Expand Down
Empty file removed src/app/page.module.css
Empty file.
File renamed without changes.
Loading

0 comments on commit 3ec6bdf

Please sign in to comment.