Fullstack OAuth starter using Passport.js, Node.js, TypeScript, PostgreSQL, Prisma, and Next.js
MIT License
This is an open-source full-stack OAuth authentication system that's perfect for your next web application. Whether you're building a small project or a large-scale system, this repository provides a solid foundation to build upon.
The system is highly customizable and easy to use. Simply fork the repository and adjust the code to meet your specific requirements.
If you found this helpful, please consider starring the repo! ⭐
The "start" folder contains the user interface, while the "finished" folder includes all components of the project. The system is built using the following technologies:
Codebase | Description | Technologies |
---|---|---|
api | Node.js REST API | Node.js, Express, TypeScript, PostgreSQL, Prisma, Passport.js |
web | Next.js Frontend | Node.js, TypeScript, Next.js, Axios |
api
folder and run npm install
to install the necessary dependencies.Client ID
and Client Secret
..env
file in the api
folder (copying the existing template in .env.example
) with the following environment variables:
API_PORT
: the port number for the API server (prefilled)CLIENT_URL
: the URL for the client-side of the application (prefilled)DATABASE_URL
: the URL to your PostgreSQL databaseSESSION_SECRET
: a secret key for Express session handlingGITHUB_CLIENT_ID
: the client ID for GitHub OAuth authenticationGITHUB_CLIENT_SECRET
: the secret key for GitHub OAuth authenticationGITHUB_CALLBACK_URL
: the callback URL for GitHub OAuth authentication (prefilled)GOOGLE_CLIENT_ID
: the client ID for Google OAuth authenticationGOOGLE_CLIENT_SECRET
: the secret key for Google OAuth authenticationGOOGLE_CALLBACK_URL
: the callback URL for Google OAuth authentication (prefilled)npm run dev
to start the Node.js API.web
folder and run npm install
to install the necessary dependencies..env
file with the contents of .env.example
. If you have the API running on the same port, it should work; otherwise, update it.npm run dev
to start the Next.js application.http://localhost:3000
in your web browser to see the running application.