A TypeScript Flavoured Express + React + Prisma + PostgreSQL FullStack App to Create and Store Your Favourite Albums.
Used to be deployed on Heroku. But, I am on free tier and to accomodate other projects I took this down as this is only a sample app.
Base URL - https://my-favourite-albums.herokuapp.com/
Root Endpoint - returns albums JSON
Request
curl --location --request GET 'https://my-favourite-albums.herokuapp.com/api'
Response
[
{id: 1, title: "Title of Album", ...},
...,
....
]
Returns artists JSON
Request
curl --location --request GET 'https://my-favourite-albums.herokuapp.com/api/artists'
Response
[
{id: 1, name: "Artist Name", ...},
...,
....
]
Create a New Album
Request
curl --location --request POST 'https://my-favourite-albums.herokuapp.com/api' \
--header 'Content-Type: application/json' \
--data-raw '{
"title": "New Album Title",
"artistId": 100
}'
Response
# On Status 200
{ id: 112, title: "New Album Title", ... }
# On Status 400
{ error: "Error Message" }
- Displays All Albums in a Tabular Format
- Form to Create New Album
- server
/
- frontend
/client
- Fork and clone the repo
- Install Dependencies
# Server
yarn install
# Client
cd client && yarn install
- Add Postgres URL to
.env
DATABASE_URL="postgresql:https://username:password@localhost:5432/mydb?schema=public"
- Run Migrations -
npx prisma migrate dev
- Seed DB -
npx prisma db seed --preview-feature
- Run
yarn start:app
on root to start server and client concurrently.