TinyApp is a full stack web application built with Node and Express that allows users to shorten long URLs à la Bit.ly. Save some bytes!
- Shorten links (users only) - shortened links look like
/u/4klWTG
- User restrictions - users can register from the
/register
page, log in from the/login
page, and log out by clicking theLogout
button- Only users can create new links
- Only the creator of a link can edit or delete it
- Anyone can use shortened links
- Encrypted cookies and passwords - user ID is encrypted and stored in cookies using cookie-session, while passwords are encrypted and stored in the server memory using bcrypt
- As of the most current version of TinyApp, all URLs and user information are stored in JavaScript objects instead of a database. This means that every time the server is restarted, all stored information is cleared
- In a potential future update, a database or just a JSON file may be used to store information
- There is hardcoded sample user and URL information in
express_server.js
for demonstration. Note thatencrypt(string)
is a function that hashes strings
let urlDatabase = {
"b2xVn2": ["http://www.lighthouselabs.ca", "[email protected]"],
"9sm5xK": ["http://www.google.com", "[email protected]"]
};
let usrDatabase = {
"[email protected]": {
email: "[email protected]",
password: encrypt("123")
},
"[email protected]": {
email: "[email protected]",
password: encrypt("234")
}
};
- Install all dependencies by running
npm install
in command line - Start the development web server by running
node express_server.js
in command line
Thank you for checking out my project. You may or may not have noticed that the commit for this addition to the README.md file is about 5-6 years newer than everything else. You see, that's because I need to test if I have my SSH keys set up correctly.
I set up 2FA for GitHub, and I [REDACTED] it up and got locked out of my account, so the only form of verification I have left is my SSH keys. I also switched to a new computer, and had not yet set up SSH keys on it. So I've copied over the keys manually from the old to the new computer, and am now testing to check if it works.
I'll be filing a request to recover my GitHub account -- there's an option to upload your most recently used SSH authentication info along with verifying your email address in order to reset the 2FA. But first, testing to see if the SSH keys even work.
Moral of the story, don't accidentally delete your 2FA stuff and lock yourself out of your accounts. It's kind of a hassle :)