Track the countries you’ve visited with Travel Trail, a full-stack web application built with Node.js, Express, EJS, and Prisma, backed by a PostgreSQL database.
- Backend: Node.js, Express
- Templating: EJS
- Styling: CSS
- Database: PostgreSQL
- ORM: Prisma
- Environment Management: dotenv
- Middleware: body-parser, express.static
- Add your visited countries and track your travels.
- View all countries that you visited with an awesome UI.
- Dynamic rendering of country data using EJS templates.
- Fully connected backend using Prisma ORM for database operations.
- Responsive, clean UI with modern styling.
- Seed script to populate all countries.
- Node.js (v14 or higher recommended)
- npm (comes with Node.js)
- PostgreSQL installed locally
- Modern web browser (Chrome, Firefox, Edge, etc.)
Important: Make sure your PostgreSQL database is running. Create a database named
traveltrail_dbbefore proceeding. Also, The application requires Prisma to be set up and the database seeded.
- Clone the repository
git clone https://github.com/MustafaHabibX/travel-trail.git- Navigate to the project folder
cd travel-trail- Install dependencies
npm install- Create the PostgreSQL database
createdb traveltrail_dbOr in psql shell:
CREATE DATABASE traveltrail_db;- Configure environment variables
- Create a
.envfile in the project root:
cp .env.example .env- Update
.envwith your database URL:
DATABASE_URL="postgresql://USERNAME:PASSWORD@localhost:5432/traveltrail_db"
PORT=3000
- Initialize Prisma and the database
npx prisma migrate dev --name init
npx prisma generate- Seed the database with countries
node prisma/seed.js- Start the development server
npm run dev- Open your browser at
http://localhost:3000
travel-trail/
│
├─ prisma/ # Database schema and seed scripts
├─ public/ # Static assets (CSS, JS, images, favicon)
│ ├─ styles/
│ ├─ images/
│ └─ favicon.ico
├─ views/ # EJS templates # Express route files
├─ index.js # Main server entry
├─ package.json
├─ .env.example # Example environment variables
├─ .env # Your local environment variables (ignored by git)
└─ README.md
- Open the app in your browser at
http://localhost:3000. - In the input box, type the country you want to add and click the 'Add' button.
- You will see the Country you added is now highlighted.
- All updates are saved in the PostgreSQL database via Prisma.
- Hands-on experience with Node.js and Express backend development.
- Learned to use EJS templates for dynamic frontend rendering.
- Implemented PostgreSQL database integration using Prisma ORM.
- Created seed scripts to populate the database automatically.
- Built responsive frontend UI with CSS.
- Developed full-stack workflow skills, from database setup to server and frontend integration.
- Ensure both the database and server are running for the app to function properly.
- Clear browser cache if changes to favicon or assets do not immediately appear.
- The seed script can be re-run at any time to reset the country data.
.envfile is ignored by git; use.env.exampleas a template for your local environment variables.
