Skip to content

The Odin Project. Dynamic group chat application, built with Node.js / Express.

License

Notifications You must be signed in to change notification settings

HPatto/members_only

Repository files navigation

Contributors Forks Stargazers Issues MIT License

Stream of Consciousness

The Odin Project


Table of Contents
  1. About The Project
  2. Usage
  3. Roadmap
  4. Contributing
  5. License
  6. Contact
  7. Acknowledgments

About The Project

Messaging web service, offering tiers of permissions and persistent data.

Learnings

An interesting project to connect back-end and front-end, with multiple database schemas and general data persistence. I enjoy the abstractions that improve the developer experience, and have found time invested to pay serious dividends.

Deploying to Vercel was difficult. This project doesn't match their use-case, so some alterations to project structure were necessary. Best to follow a more complete framework.

The next project should include RESTful API construction, and separation of the backend and frontend.

Frontend

I tried several different HTML rendering options, and settled on Handlebars. I was looking for the ability to pass in database content and have re-useable templates. Writing feels more natural with HTML-style syntax.

CSS / Sass with key variable definition has been enjoyable to use. I found earlier projects to get cluttered quickly, and now employ "style guide" parameters that allow rapid change.

Backend

I spent some time understanding middleware, which seems both a ubiquitous and slightly amorphous classification. Understanding that middleware can be attached to the application, the route, or a specific HTTP method was important in structuring the backend in a modular way.

In general, I preferred separate classification of middleware functions which would then be imported as necessary. Definitions within the route seem messy, although no doubt it comes with practice.

The user authentication and encryption was interesting and one of my main motivations for the project. Instructive to see how information is divided between cookies, req / res bodies, and dB sessions.

Database

MongoDB was intuitive, although a basic app such as this does not push it's limits. Using the Mongoose ODM was likewise straightforward.

(back to top)

Goals

  • Understand and implement user authentication with a functional backend.

  • Dynamic and nested HTML generation with Handlebars

  • CSS compilation with SASS

  • Backend design with Express (MVC architecture)

  • Database CRUD operations with MongoDB

  • User authentication (server-side) with Passport.js

  • Basic CI / CD with Nodemon

(back to top)

Built With

  • HTML / Handlebars
  • CSS / Sass
  • JavaScript
  • Node.js / Express
  • MongoDB

(back to top)

Usage

The service is deployed on Vercel, and accessible here.
There are several permission levels available:

  1. Visitor
  • Visitors can see messages. Visitors cannot see author information, nor send messages.
  1. User
  • Upon making an account, a user can see and send messages. Users cannot see author information.
  1. Member
  • Upon guessing the membership code, a member can see all submitted messages and send their own.
  1. Admin
  • An admin has all the powers of a member, and can delete messages. Available upon request.

(back to top)

Roadmap

  • Database schemas
  • User story
  • Expected environment variables
  • Define functionality / permission levels
  • Implement front-end
    • Handlebar template with header / footer
    • Handlebar template with dynamic content allowed
    • Handlebar templates with nested, dynamic content allowed
    • Client-side error handling
  • Implement back-end
    • Define necessary imports for global app.js (Passport, Mongoose, bcryptjs etc.)
    • Define top-level routing (landing, sign-up, log-in etc.)
    • Define outline of HTTP methods available on each route
    • Define logic for each method within a route
      • Server-side error-handling
      • Server-side middleware
  • Create dummy users for each permission level
  • Allow scrolling to fetch more messages on-demand
  • Allow manual account deletion

(back to top)

Contributing

Contributions are more than welcome!

  1. Fork the Project
  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

(back to top)

License

Distributed under the MIT License. See LICENSE for more information.

(back to top)

Contact

Contact avenues can be found in my GitHub profile.

(back to top)

Acknowledgments

  • The Odin Project

(back to top)

About

The Odin Project. Dynamic group chat application, built with Node.js / Express.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published