Skip to content

nwyrwas/Full-Stack-Development

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🌍 Travlr - Full-Stack Travel Management Platform

A modern, full-stack web application for discovering, managing, and sharing travel trips. Built with cutting-edge technologies, Travlr combines a powerful Node.js/Express backend with an Angular-based admin dashboard.


✨ Features

  • Trip Management: Create, edit, and delete travel trips with detailed information
  • Admin Dashboard: Angular-powered administrative interface for managing trips
  • User Authentication: Secure JWT-based authentication system with Passport.js
  • Database Integration: MongoDB with Mongoose for robust data persistence
  • Responsive Design: Mobile-friendly interface that works on all devices
  • RESTful API: Well-structured API endpoints for trip and user operations
  • Server-Side Rendering: Express.js with Handlebars templating for dynamic content

πŸ—οΈ Project Structure

travlr/
β”œβ”€β”€ app_server/           # Express server with server-side rendering
β”‚   β”œβ”€β”€ controllers/      # Request handlers
β”‚   β”œβ”€β”€ routes/          # Route definitions
β”‚   └── views/           # Handlebars templates
β”œβ”€β”€ app_api/             # RESTful API server
β”‚   β”œβ”€β”€ controllers/     # API request handlers
β”‚   β”œβ”€β”€ routes/          # API endpoints
β”‚   └── database/        # MongoDB models and connection
β”œβ”€β”€ app_admin/           # Angular admin dashboard
β”‚   └── src/
β”‚       β”œβ”€β”€ app/         # Angular components and services
β”‚       └── assets/      # Static assets
β”œβ”€β”€ bin/                 # Entry point
└── data/                # Sample data

πŸ› οΈ Tech Stack

Backend:

  • Node.js & Express.js
  • MongoDB & Mongoose
  • JWT & Passport.js for authentication
  • Morgan for logging

Frontend (Admin):

  • Angular
  • TypeScript
  • Angular CLI

Architecture:

  • RESTful API design
  • MVC pattern
  • Server-side rendering with Handlebars

πŸ“‹ Prerequisites

  • Node.js (v14 or higher)
  • npm or yarn
  • MongoDB instance (local or cloud)
  • Angular CLI (for development)

πŸš€ Getting Started

1. Clone the Repository

git clone https://github.com/nwyrwas/Full-Stack-Development.git
cd Full-Stack-Development/"Module 7 Project"

2. Install Dependencies

npm install

3. Environment Setup

Create a .env file in the root directory:

NODE_ENV=development
MONGODB_URI=mongodb://localhost:27017/travlr
JWT_SECRET=your_jwt_secret_key
PORT=3000

4. Start the Server

npm start

The application will be available at http://localhost:3000

5. Admin Dashboard (Optional)

cd app_admin
npm install
ng serve

Admin dashboard will be available at http://localhost:4200


πŸ“š API Endpoints

Authentication

  • POST /api/auth/login - User login
  • POST /api/auth/register - User registration

Trips

  • GET /api/trips - Get all trips
  • GET /api/trips/:id - Get trip by ID
  • POST /api/trips - Create new trip (requires auth)
  • PUT /api/trips/:id - Update trip (requires auth)
  • DELETE /api/trips/:id - Delete trip (requires auth)

πŸ” Authentication

Travlr uses JWT (JSON Web Tokens) for secure authentication:

  1. Users log in with credentials
  2. Server returns JWT token
  3. Token is included in Authorization header for protected routes
  4. Token is validated on each request

πŸ’Ύ Database Schema

Users Collection:

  • Username
  • Email
  • Password (hashed)
  • Created date

Trips Collection:

  • Title
  • Description
  • Destination
  • Start/End dates
  • Images
  • Cost
  • Created by (User reference)

πŸ§ͺ Testing

Run the test suite:

npm test

πŸ“ Development

Available Scripts

npm start          # Start the server
npm run dev        # Start with nodemon (auto-reload)
ng serve          # Start Angular dev server
ng build          # Build Angular project

Code Style

The project follows standard JavaScript conventions with ESLint configuration.


πŸ› Troubleshooting

MongoDB Connection Issues:

  • Ensure MongoDB is running: mongod
  • Check MONGODB_URI in .env file

Port Already in Use:

lsof -i :3000  # Check what's using port 3000
kill -9 <PID>  # Kill the process

Angular Build Issues:

cd app_admin
npm cache clean --force
npm install
ng build

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

πŸ“„ License

This project is part of the CS-465 Full-Stack Development course.


πŸ‘€ Author

Nick Wyrwas


πŸ“ž Support

For support, email or open an issue on the GitHub repository.


Happy Traveling! πŸŒ΄βœˆοΈπŸ—ΊοΈ

About

Full-stack travel management platform with Node.js/Express backend, Angular admin dashboard, and JWT authentication

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors