A Next.js application with PostgreSQL and Redis.
git clone <repository-url>
cd ask_easy
pnpm installNote:
pnpm installwill automatically runprisma generatevia the postinstall script to generate the Prisma client.
# For Docker Compose
cp .env.example .env
# For native development (pnpm dev) - edit to use localhost
cp .env.example .env.local
# Then change @postgres to @localhost and @redis to @localhost in .env.local| File | Used by | Host values |
|---|---|---|
.env |
Docker Compose | @postgres, @redis (service names) |
.env.local |
pnpm dev |
@localhost |
Option A: Full stack (app + database + redis)
docker-compose up # FOR ALL 3Access the app at http://localhost:3000
Option B: Services only (for native development)
docker-compose up postgres redisThen run the development server:
pnpm devGenerate Prisma client and push schema:
pnpm db:setup| Script | Description |
|---|---|
pnpm dev |
Start development server |
pnpm build |
Build for production |
pnpm start |
Start production server |
pnpm typecheck |
Run TypeScript type checking |
pnpm lint |
Run ESLint |
pnpm lint:fix |
Fix ESLint issues |
pnpm format |
Format code with Prettier |
pnpm test |
Run tests with Vitest |
pnpm db:generate |
Generate Prisma client |
pnpm db:push |
Push schema to database |
pnpm db:migrate |
Run database migrations |
pnpm db:setup |
Generate client + push schema (for initial setup) |
pnpm db:studio |
Open Prisma Studio |
# Start all services
docker-compose up
# Start in detached mode
docker-compose up -d
# Stop all services
docker-compose down
# Stop and remove volumes (reset database)
docker-compose down -v
# Rebuild the app image
docker-compose build appPlease only use names from the assigned board, make a new ticket if needed.
git checkout main
git pull
git checkout -b NAME_NUMRun the development server WHILE you write code:
pnpm devOnce you think everything is all good test in the prod env locally by using
docker-compose upThis will start the app, PostgreSQL, and Redis containers. Access the app at http://localhost:3000.
Commit as you go, you MUST use CONVENTIONAL COMMITS (see bottom for conventional commit cheat sheet):
git add -A
git commit -m "feat: add "
git pushOnce a task (branch) is completed send a PR to main. Do so through github DO NOT MERGE TO MAIN LOCALLY THEN PUSH. If you need help with this just shoot me (Jaden) a text.
A conventional commit message follows the following criteria,
- Is of the form (optional scope):
- Uses present tense, ex. add (good) but added (bad)
- Describes one change not many if needed break into multiple commits each with one idea captured
The following are examples of amazing conventional commit messages:
feat: add JWT-based authentication
fix: handle null user response from database
docs: update setup instructions for local development
refactor: extract validation logic into helper
test: add unit tests for login endpoint
chore: bump next.js from 14.0.2 to 14.1.0
perf: reduce API response time by memoizing queries
ci: add lint and test workflowPlease do not make up your own (unless you asked the team first sometimes this is needed but rarely) use one of the in the above examples.