Onde ir is a comprehensive food advisory platform designed to help users discover and share experiences about various food establishments, similar to TripAdvisor but with a focus on specific categories such as restaurants (more categories will be added in the future).
This Next.js fullstack project leverages modern web technologies and libraries to create a robust and user-friendly application.
Project Framework: The project is built using Next.js, a powerful framework that enables server-side rendering and static site generation, providing an optimized performance and improved SEO.
- User signup and signin
- Forgot password flow (email-based recovery)
- Change password functionality
- Welcome email upon successful registration
- Admin Dashboard to approve/decline posts and manage pending submissions
- Explore places with infinite scroll and diverse filtering options
- Place rating system (1 to 5 stars)
- Comment system with nested replies and likes
- Next.js with server actions for efficient data handling
- Node postgres (pg) for database connections and queries
- Shadcn for UI components
- Vitest for unit and integration testing
- Zod for input validation
- IBGE API for selecting states and cities (improving UX in the post creation form)
- AWS Services (S3, Lambda, CloudFront) for photo uploads
- Resend for email notifications
- Work in progress
you must have docker
installed
- Copy ".env" file and create a ".env.local"
cp .env .env.local
- With docker running on your machine, following commands:
it will compose the docker file
pnpm services:up
run pending migrations
pnpm migrate:up
run development server
pnpm dev
- Open you browser in http://localhost:3000
Migrations are used to create or modify the database schema in a controlled and versioned manner.
To create a new migration, run:
pnpm migrate:create {migration-name}
This will generate a new file inside the infra/migrations directory.
After creation, add the SQL scripts for:
-
Up Migration → Defines the changes that should be applied to the database.
-
Down Migration → Defines how to revert the changes made in the Up Migration.
To apply all pending migrations to the local database, run:
pnpm migrate:up
This will execute all migrations that have not been applied yet.
If you need to undo the latest migration, run:
pnpm migrate:down
To revert a specific number of migrations, use:
pnpm migrate:down {N}
Where {N} represents the number of migrations you want to revert, starting from the most recent.
Migrations are stored in the following directory:
infra/
├── migrations/
│ ├── 001_initial_schema.sql
│ ├── 002_categories_places.sql
│ ├── 003_reviews_ratings.sql
│ ├── ...
Each migration file contains the necessary SQL commands to incrementally modify the database.
⚠ Warning: Always review your migrations before running them in production environments to prevent data loss.