A modern, searchable and filterable database of countries around the world.
- Browse all countries
- Search countries and filter by region
- Sort countries alphabetically
- View detailed info for each country, including bordering countries
- Favourite countries (requires sign-in)
- User authentication (email/password & Google)
- Responsive, mobile-friendly design
git clone https://github.com/markslorach/countries-db.git
cd countries-db
pnpm installBefore running the project, create a .env file in the root directory and add the following keys -
Note: You must supply your own values for each key below.
DATABASE_URL=your_postgresql_connection_string
GOOGLE_CLIENT_ID=your_google_client_id
GOOGLE_CLIENT_SECRET=your_google_client_secret
NEXT_PUBLIC_BETTER_AUTH_URL=your_better_auth_url
TEST_USER_EMAIL=your_test_user_email # for test/demo accountsDATABASE_URL: PostgreSQL connection string for PrismaGOOGLE_CLIENT_IDandGOOGLE_CLIENT_SECRET: for Google authenticationNEXT_PUBLIC_BETTER_AUTH_URL: Better Auth service URLTEST_USER_EMAIL: for test/demo user logic
pnpm devpnpm buildpnpm start- Next.js 15 (React 19)
- TypeScript
- Tailwind CSS
- shadcn/ui
- Zod
- Better Auth
- Prisma (PostgreSQL)
Inspired by the Frontend Mentor REST Countries API challenge - this project has been expanded with extra features and improvements.
