npm install -g pnpm
pnpm install
pnpm prepare
- On linux only:
chmod ug+x .husky/*
- Copy .env.example to .env and fill the values
- For the Email part, replace
noreply@example.com
with your email, and replace password with your app password which can be generated from yourManage Google Account > Security > 2 Factor Authentication > App Passwords
- Database
- For the Email part, replace
pnpm dev:next
to run the next.js serverpnpm dev:wss
to run the websocket serverpnpm dev
to run both at oncenpx prisma db seed
to seed the database
Ways to create prostgres database to work on
- Using docker
- Install Docker Engine (Desktop/CLI only)
- Fill the postgresql values in .env file
POSTGRES_PASSWORD="some-password"
POSTGRES_USER="admin"
POSTGRES_DB="evento"
- Run docker compose:
sudo docker compose up -d
ordocker-compose up -d
- Update DATABASE_URL:
postgresql://username:password@host:port/db_name
, so for above env file it will bepostgresql://admin:some-password@localhost:5432/evento
- Run
pnpm db:push
to sync prisma schema to database
- Clone this repo using ssh or https
- Create a new branch from
main
:git checkout -b new-branch
, this creates anew-branch
and also switches the branch frommain
tonew-branch
- Make changes then Commit
git commit -m prefix:Something
and push the branchgit push
(pushing for first time?:git push -u origin new-branch
) - Make a PR from
your-branch
tomain
- If there is no issue, merge it
- If there is issue solve it by discussing with your peer or if you know the impact of changes, do it yourself
// Before starting again 3.
- Save and Commit all the changes in your current branch
- Pull main branch
git pull origin main
- Merge recent changes from main to
your-branch
:git merge main
- Repeat 2
- next.js app directory
- next-auth: for authentication
- trpc: to make apis and consume them using react-query
- prisma: to work with database
- shadcn/ui and tailwindCSS: styling
- zustand: manage global state
- husky setup with lint-staged: Manage lint conventions
- build: When making changes related to build system or tools.
- chore: General maintenance or tasks that aren’t user-facing.
- ci: Changes to Continuous Integration (CI) configuration or scripts.
- docs: Updates or additions to documentation.
- feat: New feature additions or enhancements.
- fix: For bug fixes or resolving issues.
- perf: Changes aimed at improving performance.
- refactor: Code changes that don’t affect external behavior but enhance code structure.
- revert: Reverting previous commits.
- style: Changes in code style or formatting (not affecting functionality).
- test: Adding or modifying tests.
Examples
- build:
build: Update webpack configuration
- chore:
chore: Clean up unused files
- ci:
ci: Configure GitHub Actions for deployment
- docs:
docs: Update installation guide
- feat:
feat: Add user authentication feature
- fix:
fix: Resolve issue with user login
- perf:
perf: Improve caching mechanism
- refactor:
refactor: Simplify error handling
- revert:
revert: Revert changes in user profile component
- style:
style: Format code according to style guide
- test:
test: Add unit tests for API endpoints