This project is a web application for managing events, integrating features like user authentication, database management, Google Calendar for scheduling, and Stripe for payment processing.
- Next.js: React framework for server-side rendering and static site generation.
- Auth.js: Authentication library for managing user sessions.
- Prisma: ORM (Object-Relational Mapping) tool for database access.
- PostgreSQL: Relational database for storing application data.
- Google Calendar API: For event scheduling and calendar management.
- Stripe API: For handling payments.
- Node.js (version 14.x or above)
- PostgreSQL
- Google Cloud account (for Google Calendar API)
- Stripe account (for payment processing)
-
Clone the repository:
git clone https://github.com/KcalbJ/events-app.git cd events-project
-
Install dependencies:
npm install
-
Set up environment variables:
Create a
.env
file in the root of your project and add the following environment variables:POSTGRES_URL POSTGRES_PRISMA_URL POSTGRES_URL_NO_SSL POSTGRES_URL_NON_POOLING POSTGRES_USER POSTGRES_HOST POSTGRES_PASSWORD POSTGRES_DATABASE AUTH_SECRET AUTH_GOOGLE_ID AUTH_GOOGLE_SECRET AUTH_RESEND_KEY NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY STRIPE_SECRET_KEY STRIPE_WEBHOOK_SECRET NEXT_PUBLIC_SERVER_URL
-
Set up the PostgreSQL database:
Make sure PostgreSQL is running on your local machine. You can use a tool like pgAdmin to connect to the provided database URL.
-
Run Prisma migrations:
npx prisma migrate dev --name init
-
Seed the database (optional):
npx prisma db seed
-
Generate Prisma client:
npx prisma generate
-
Start the development server:
npm run dev
-
Access the application:
Open your browser and go to
http://localhost:3000
.
To use Google Calendar API, you need to set up OAuth 2.0 credentials in the Google Cloud Console.
- Go to the Google Cloud Console.
- Create a new project or select an existing project.
- Navigate to the OAuth consent screen and configure it.
- Go to Credentials and create OAuth 2.0 Client IDs.
- Set the authorized redirect URIs to
http://localhost:3000/api/auth/callback/google
. - Copy the Client ID and Client Secret to your
.env
file.
To use Stripe for payment processing:
- Sign in to your Stripe account and get your API keys from the Stripe Dashboard.
- Add the API keys to your
.env
file.
-
Build the project:
npm run build
-
Start the production server:
npm start
-
Lint the code:
npm run lint
-
Format the code:
npm run format
To learn more about Next.js, take a look at the following resources:
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.
You can check out the Next.js GitHub repository - your feedback and contributions are welcome!
The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.
Check out our Next.js deployment documentation for more details.