Skip to content

Latest commit

 

History

History
103 lines (89 loc) · 6.36 KB

README.md

File metadata and controls

103 lines (89 loc) · 6.36 KB

TinyApp

🔗 TinyApp

TinyApp is a full stack web application built with Node and Express that allows users to shorten long URLs (à la bit.ly).

made-with-Node made-with-express made-with-bcrypt made-with-cookie-session made-with-ejs made-with-chai made-with-mocha made-with-morgan made-with-nodemon made-with-bootstrap

Table of Content

🌟 Features

Register, login, and logout users.

reg, login, logout

View, create, edit, and delete short URLs.

short-urls

User passwords and sessions are encrypted.

session

🚀 Getting Started

  1. Fork the repository.
  2. Install all dependencies using the npm install command.
  3. Run the server using the npm start command.
  4. Visit http://127.0.0.1:8080 or localhost:8080 in your browser (port defaults to 8080).
  5. Now you can register and start creating short URLs.

⚫ Endpoints

Http method path Description
GET / Gets index page and redirects to login page, unless logged in then to urls page
GET /users Gets urls page if user is logged in, else redirects to login page
GET /users/login Gets login page, unless logged in then redirects to urls page
GET /users/logout Gets login page and sets session to null
GET /users/register Gets registration page, unless logged in then redirects to urls page
POST /users/login Verifies user credentials and if succesful starts a session
POST /users/register Creates a new user, starts a session, and redirects to urls page
GET /urls Gets urls index page and all the urls for the authorized user
GET /urls/new Gets urls new page for the authorized user
GET /urls/:id Gets urls show page for a specific url for the authorized user
GET /u/:id Edits a card for a specific topic for the authorized user
POST /urls Create a new short URL and redirect to the urls show page
POST /urls/:id Edits a short URL for the authorized user
POST /urls/:id/delete Delete a short URL for the authorized user

🧱 Main Structure

├─── db                 # hardcoded database to hold user and url data
├─── helpers            # helper functions
├─── routes             # app routes
├─── test               # helper functions tests
├─── views              # EJS templates
│  ├── partials         # EJS template partials
├─── .gitignore
├─── README.md
├─── package-lock.json
├─── package.json
└─── server.js          # the server: the main driver of the app includes all the routes and server configs

📦 Tech Stack (Dependencies)

🔨 Dependencies

🧰 Development Dependencies

⚠️ Disclaimer