The Odin Project
Table of Contents
Messaging web service, offering tiers of permissions and persistent data.
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.
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.
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.
MongoDB was intuitive, although a basic app such as this does not push it's limits. Using the Mongoose ODM was likewise straightforward.
-
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
- HTML / Handlebars
- CSS / Sass
- JavaScript
- Node.js / Express
- MongoDB
The service is deployed on Vercel, and accessible here.
There are several permission levels available:
- Visitor
- Visitors can see messages. Visitors cannot see author information, nor send messages.
- User
- Upon making an account, a user can see and send messages. Users cannot see author information.
- Member
- Upon guessing the membership code, a member can see all submitted messages and send their own.
- Admin
- An admin has all the powers of a member, and can delete messages. Available upon request.
- 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
Contributions are more than welcome!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE
for more information.
Contact avenues can be found in my GitHub profile.
- The Odin Project