Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gautvm/fullstack-oauth-system
Fullstack OAuth starter using Passport.js, Node.js, TypeScript, PostgreSQL, Prisma, and Next.js
https://github.com/gautvm/fullstack-oauth-system
authentication express fullstack nextjs nodejs oauth passportjs postgresql prisma react tailwindcss typescript
Last synced: 2 months ago
JSON representation
Fullstack OAuth starter using Passport.js, Node.js, TypeScript, PostgreSQL, Prisma, and Next.js
- Host: GitHub
- URL: https://github.com/gautvm/fullstack-oauth-system
- Owner: gautvm
- License: mit
- Created: 2022-05-20T02:09:03.000Z (over 2 years ago)
- Default Branch: finished
- Last Pushed: 2023-03-07T07:46:09.000Z (almost 2 years ago)
- Last Synced: 2024-10-17T08:17:18.583Z (3 months ago)
- Topics: authentication, express, fullstack, nextjs, nodejs, oauth, passportjs, postgresql, prisma, react, tailwindcss, typescript
- Language: TypeScript
- Homepage:
- Size: 133 KB
- Stars: 8
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Fullstack OAuth System
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! ⭐
### Project Components
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 |## Setup Instructions
1. Clone the repository to your local machine.
2. Navigate to the `api` folder and run `npm install` to install the necessary dependencies.
3. Create a local PostgreSQL database and copy its database URL.
4. Go to the [GitHub Developer Settings](https://github.com/settings/developers) or the [Google Cloud Console](https://console.cloud.google.com/) (depending on what OAuth systems you want to include) and create the necessary OAuth application. Then, copy the `Client ID` and `Client Secret`.
5. Create an `.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 database
- `SESSION_SECRET`: a secret key for Express session handling
- `GITHUB_CLIENT_ID`: the client ID for GitHub OAuth authentication
- `GITHUB_CLIENT_SECRET`: the secret key for GitHub OAuth authentication
- `GITHUB_CALLBACK_URL`: the callback URL for GitHub OAuth authentication (prefilled)
- `GOOGLE_CLIENT_ID`: the client ID for Google OAuth authentication
- `GOOGLE_CLIENT_SECRET`: the secret key for Google OAuth authentication
- `GOOGLE_CALLBACK_URL`: the callback URL for Google OAuth authentication (prefilled)
6. Run `npm run dev` to start the Node.js API.
7. Navigate to the `web` folder and run `npm install` to install the necessary dependencies.
8. Create a `.env` file with the contents of `.env.example`. If you have the API running on the same port, it should work; otherwise, update it.
9. Run `npm run dev` to start the Next.js application.
10. Visit `http://localhost:3000` in your web browser to see the running application.