npm install
# or
yarn install
# or
pnpm install
# or
bun install
First, run the development server:
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
Create a new project on Google Cloud Provider.
Then Credentials >> Create Credentials >> OAuth client ID >> Set Application type to web application
Now add two Authorized redirect URIs
For development:
http://localhost:3000/api/auth/callback/google
For production:
https://yourproductionsite.app/api/auth/callback/google
Finally from OAuth 2.0 Client IDs
copy your Client ID and Client secret and add them to your hidden .env file.
Note: Your .env file should my ignored by git.
I used xata.io set up my database.
For xata.io sign in then Add Database >> Make sure Enable direct access to Postgres is checked >> then Create
Finally from the Settings grab the postgres endpoint and add an API Key postgresql://ws1234:[email protected]:5432/Games:main?sslmode=require
openssl rand -hex 16
openssl rand -base64 33
openssl rand -base64 32
NEXT_PUBLIC_CRUD_API_KEY=<your_crud_api_key>
GOOGLE_CLIENT_ID=<your_google_client_id>
GOOGLE_CLIENT_SECRET=<your_google_client_secret>
DATABASE_URL=<your_database_url>
AUTH_SECRET=<your_auth_secret>
NEXTAUTH_SECRET=<your_nextauth_secret>
To push your database with latest Schema run:
npx prisma db push
These rules guide our frontend development to ensure simplicity, readability, and maintainability.
- Maximize Tailwind CSS: Use Tailwind CSS for all styling tasks as much as possible.
- Fallback to CSS: Only use standard CSS if something cannot be achieved with Tailwind.
- Avoid Overcomplication: Do not overcomplicate the codebase with so-called best practices. Prioritize simplicity.
- Prettier: Use Prettier Vscode extention for formatting everything.
- use "prettier-plugin-tailwindcss" vscode plugin for formatting tailwind utility classes.
- Consistent Style: Aim for a consistent coding style across the project. Consistent, slightly imperfect code is better than perfect but inconsistent patterns.