/be-assessment-2

Assessment 2 for the Backend Course

Primary LanguageHTMLMIT LicenseMIT

PWRLIFTING

An application where a list of lifters is displayed. You can interact with the list and find out more about the people in the list, but you can also add, edit and delete lifters.

Check out the demo right here.

Screenshot of Website

Assessment 2

This is the second - and last - assessment for the backend course in which we need to present our final project.

This assessment focusses on all main goals of this course: Build web apps with Node and store data in a database.

Database

One of the requirements for this assessment is to use a database. We have the choice between noSQL and SQL databases. In the past I've worked with mySQL and I use it for my hobby project. I've also used mongoDB for a project once. However, I'm planning to change the setup of my hobby project from PHP & mySQL to Node & PostgreSQL because of new feature additions. Thus, the choice for PostgreSQL was an easy one.

Views

There are several views I utilized.

Deployment

I'm using Heroku to deploy my server in combination with the Heroku PostgreSQL instance.

This repo is connected to Heroku, so all changes are deployed instantly.

Installation

  1. Database setup

Follow my guide

  1. Clone the project
$ git clone https://github.com/Mimaaa/be-assessment-2.git
  1. Switch Branch

In order to use the local database you need to switch to the local-db branch.

$ git checkout local-db
  1. Install dependencies
$ npm install
  1. Start the server
$ npm start
  1. Visit website

Go to localhost:1902 to visit the website.

Scripts

To start the server:

$ npm start

To watch file changes through nodemon:

$ npm run watch

To check your code on linting errors:

$ npm run lint

To-do

Currently, there are still some things left to do. I've started with the log-in and sign-up flows, but it's not there yet. There is a commit with the working code right here.

  • Login
  • Signup
  • Add competitions table with join to lifter table

What did I learn?

I learned a lot of new things besides the things I already knew.

Things like...

Status Codes & Error Handling

I got a better understanding on how important error handling actually is. It makes sense though. If you are visiting a website and something happens, but you don't get any feedback on what exactly happened then you get a bad user experience.

EJS

When using Node I always reverted to Handlebars, but EJS is pretty awesome because you can still use JS in the templates.

PostgreSQL

I've never used PostgreSQL but I'm familiar with the SQL syntax; it doesn't differ that much from mySQL. However, I needed to find out how to make new databases, tables, filling the tables and which data types to use, because there is a small difference between the mySQL and PostgreSQL data types.

Node Concepts

A better understanding of Nodes' core concepts. Of course we have access to amazing packages, but it's also important to know what Node has to offer at its core. By following the LearnYouNode tutorial I've had the opportunity to learn those concepts.

JS

In general I can say that my JavaScript/programming knowledge has increased. Stuff like a callback was an abstract term, but because of the frequent use in JS land and during this course, I got a better understanding of how to write JavaScript.

Did I enjoy it?

Yes, I definitely did. When I start working on a project I forget time and go into tunnel vision mode where I keep coding and trying new things till my mind is exhausted. It's fun.

Resources

I used some videos in this playlist to learn how to use PostgreSQL in combination with Node and I also referenced the code we used during the course.

Acknowledgments

A big thanks to my teacher Titus Wormer for creating this course and setting the bar higher than before. It was definitely challenging, but worth every minute.

Contributing

If you would like to contribute, you are welcome to do so.

License

MIT © Mirza