This repo implements a fullstack application that uses Node on the backend, and React on the frontend
Check out the deployed version here!
javascript-fullstack.vercel.app
It's a simple API that returns plans and saves purchased plans in the DB
- Node
- TypeScript
- Sequelize
- PostgreSQL
- AWS (ECR, App Runner, RDS)
- Docker
- Jest + Supertest
- Github Actions
npm install
npm run dev:docker
npm run test:docker
Simple client written in react. Contains three pages Login, Plans, and a Dashboard where you can check the plans you've purchased.
- React
- TypeScript
- Vite
- Chakra UI
- Vercel
npm install
npm run dev
This document outlines the available REST API endpoints for our service, including methods for authentication, retrieving plans, and handling purchases.
Authenticates a user and returns a token.
- Body
{
"email": "[email protected]",
"password": "yourpassword"
}
- Success (200 OK)
{
"token": "jwt.token.here"
}
- Error (401 Unauthorized)
{
"message": "Invalid email or password"
}
Retrieves a list of available plans. Requires authentication.
- Headers
Authorization: Bearer <token>
- Success (200 OK)
[
{
"id": 1,
"name": "Basic Plan",
"steps": [
{
"name": "Step 1",
"order": 1
},
{
"name": "Step 2",
"order": 2
}
]
}
]
Creates a purchase for a plan. Requires authentication.
- Body
{
"planId": 1
}
- Headers
Authorization: Bearer <token>
- Success (200 OK)
{
"id": 1,
"name": "Basic Plan",
"userId": 123,
"steps": [
{
"name": "Step 1",
"order": 1
},
{
"name": "Step 2",
"order": 2
}
]
}
- Error (404 Not Found)
{
"message": "Plan not found"
}
or
{
"message": "User not found"
}
Retrieves a list of purchases made by the authenticated user.
- Headers
Authorization: Bearer <token>
- Success (200 OK)
[
{
"id": 1,
"name": "Basic Plan",
"userId": 123,
"steps": [
{
"name": "Step 1",
"order": 1
},
{
"name": "Step 2",
"order": 2
}
]
}
]
All endpoints, except for /login
, require a valid JWT token to be included in the Authorization
header as a Bearer token.