Skip to content

A TypeScript Flavoured Express + React + Prisma + PostgreSQL FullStack App to Create and Store Your Favourite Albums.

Notifications You must be signed in to change notification settings

KRRISH96/my-favourite-albums

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

😻 My Favourite Albums

Build Status

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.

🛠 API


Base URL - https://my-favourite-albums.herokuapp.com/

GET /api

Root Endpoint - returns albums JSON

Request

curl --location --request GET 'https://my-favourite-albums.herokuapp.com/api'

Response

[
  {id: 1, title: "Title of Album", ...},
  ...,
  ....
]

GET /api/artists

Returns artists JSON

Request

curl --location --request GET 'https://my-favourite-albums.herokuapp.com/api/artists'

Response

[
  {id: 1, name: "Artist Name", ...},
  ...,
  ....
]

POST /api/new_album

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" }



✨ Frontend

🏠 Home Page


  • Displays All Albums in a Tabular Format



📋 New Album Page


  • Form to Create New Album



🗂 Directories


  • server /
  • frontend /client



💻 Development Setup


  1. Fork and clone the repo
  2. Install Dependencies

# Server

yarn install

# Client

cd client && yarn install

  1. Add Postgres URL to .env

DATABASE_URL="postgresql:https://username:password@localhost:5432/mydb?schema=public"

  1. Run Migrations - npx prisma migrate dev
  2. Seed DB - npx prisma db seed --preview-feature
  3. Run yarn start:app on root to start server and client concurrently.

🙏 Thank You

About

A TypeScript Flavoured Express + React + Prisma + PostgreSQL FullStack App to Create and Store Your Favourite Albums.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published