Next.js with Typescript, Firebase database and Next auth.
Main goal -> build fullstack app.
Features ->
- Auth/login.
- Send message without login.
- Create a post with login.
import { hash, compare } from 'bcryptjs';
import { User } from '../pages/api/auth/signup';
export const hashPassword = async (password: string) => {
const hashedPassword = await hash(password, 12);
return hashedPassword;
};
export const signUpHelper = async (user: User) => {
await fetch('/api/auth/signup', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(user),
});
};
export const verifyPassword = async (password: string, hashedPassword: string) => {
const isValid = await compare(password, hashedPassword);
return isValid;
};
git clone https://github.com/cold-world/nextjs-blog.git
cd <project-dir>
npm install
npm run dev