This is a Next.js project bootstrapped with create-next-app
.
-
Make a copy of the
.env.example
file and rename it to.env.local
. Then setup your environment variables by filling the listed variables. For assist how to get the diferrent values head to Envirnoment Variables section. -
Make sure your are using the correct version of Node.js listed in the
.nvmrc
file. If you are using NVM, you can switch to that version by running:
nvm use
- In order to install the correct package manager. In this case
yarn
. Run the following commands:
corepack enable
corepack install
- Install your packages using yarn
yarn install
- To run the project with Docker run the following command. Note that the packages may need some time to install:
docker compose up
-
If it's your first time running the project you'll have to go through the following steps:
- Generate prisma client:
docker exec -it booking-app yarn prisma:generate
- Synchronize your prisma schema with the db schema
docker exec -it booking-app yarn prisma:db:push
- (Optional) Seed your database with users:
docker exec -it booking-app yarn prisma:db:seed
- You'll need to restart the services using
docker compose down
and thendocker compose up
.
-
Make sure to update your type definitions by running:
yarn sanity:types
Open http://localhost:3000 with your browser to see the result. Head to http://localhost:3000/studio to create your first event.
You can start editing the page by modifying app/page.tsx
. The page auto-updates as you edit the file.
This project uses next/font
to automatically optimize and load Inter, a custom Google Font.
Head to Sanity and login to your account. If you don't have one - create it.
- Create a new project.
- When asked
*How do you want to set up your project?
* select From scratch with CLI. - After creating the project you should see the project dashboard.
- On top you can see the PROJECT ID. Copy it and replace it in your
.env.local
file where you seeSET_YOUR_SANITY_PROJECT_ID_HERE
. - Make sure to add
http://localhost:3000
as a CORS origin to your Sanity project.
Head to Pusher and login to your account. If you don't have one - create it.
- Create a new project.
- After you create the project head to App Key section and copy the values.
- Replace them in your
.env.local
file as follows:
app_id
toSET_YOUR_PUSHER_APP_ID_HERE
key
toSET_YOUR_PUSHER_APP_KEY_HERE
secret
toSET_YOUR_PUSHER_APP_SECRET_HERE
- To generate NextAuth secret run the following command in your command prompt:
openssl rand -base64 32
- Replace the returned value in your
.env.local
file where you seeSET_YOUR_NEXTAUTH_SECRET_HERE
- The password doesn't need to be changed unless you want to. To change the password update the value of
POSTGRES_PASSWORD
in your.env.local.
file. - If the password is not change the default database value will be:
postgresql://postgres:example@db:5432/dev-db
- Place this value in your
.env.local
file where you seeSET_YOUR_DATABASE_URL_HERE
if any changes are needed the structure is the following:
postgresql://[user[:password]@][netloc][:port][/dbname][?param1=value1&...]
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.