Let's build an instagram-like api clone!
npm i
will install your express server, sequelize, and pg deps, as well as your dev deps includingnodemon
from there, run the following cmd in your terminal to create your db:
$ createdb instagram-clone
node db/seed.js
will seed your database, andnpm run start
will launch your express server! to test, try the following curl command:
$ curl http://localhost:5500/api/users -H'Content-Type:application/json' -d'{"username":"newUser","password":"@#$#aslashfienf"}'
curl is a cli client that lets you perform network requests just like postman, insomnia, andaxios / fetch
from the browser! (and other clients, there are tons of options ... :D)
if you see the following response you're good to go! check out your db withpsql instagram-clone
and run a select all statementselect * from users;
to verify your new user!

There are Tag and Post entities in our schema. How could you hook these up in RESTful routes to allow users to associate tags with posts, or fetch all the posts by a certain user, or evenfollow other users -- the sky's the limit y'all, there are a ton of cool magic methods you can leverage to make those instance-level associations happen!