A web application that registers a university student and displays it in a /students route-page, along with the other students registered This page was built to practice full-stack development with nodejs using packages like
- Expressjs
- Swig templating engine
- SQLite3 And many more, see package.json to see the list of packages used
The page has two servers
- A static server that serves the files contained into the client folder to the client.
- A rest API server that serves the data needed to search and display students, it also registers a student into the database.
Run the servers via the folowing commands
For the rest API server
npm run dev
For the static file server
npm run static
I used sqlite3 since i only needed to store 1 table in the database, so this implies 1 .db file, i did not needed anything complex
I named the table students and it looks like this
id | name | last_name | e_mail | age | gender | school | uni | prf_pic |
---|---|---|---|---|---|---|---|---|
1 | John | Doe | [email protected] | 28 | M | School | MIT | prf_pic.jpeg |
You can initialize the database by running the following command
node init-db.js
Note: if you have already initialized the database and run the previous command, the table students will be deleted.
I used swig since i was practicing flask to do this same page.
I watched this videos and got inspired to do full-stack development
Youtube - Build a Full Stack Twitter Clone with Coding Garden
Youtube - Express.js Tutorial: Build RESTful APIs with Node and Express | Mosh