simongomez95 / syky-app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SETUP

This app can be run either in docker or directly with node.

To run the app with node, you need to have node v20.11.0 installed and a postgres instance running. First, modify the .env file to match your postgres instance configuration. Then you can run the following commands in the project directory:

npm install -g @nestjs/cli
npm install
npm start

To run the app with docker, you need to have docker and docker-compose installed. Then you can run the following command in the project directory:

docker-compose up

This will start the app and a postgres instance with docker.

The app will be accessible at http://localhost:3000.

ENDPOINTS

  • GET /events?categoryId={categoryId}&planetId={planetId} Returns a list of all events, optionally filtered by category id and planet id.
  • GET /events/:id Returns a single event by id.
  • POST /events Creates a new event. Request:
{
    "name": "Event name",
    "description": "Event description",
    "date": "2021-12-31T23:59:59.999Z",
    "categoryId": "category id",
    "planetId": "planet id",
    "coordinatesLat": "latitude of galactic coordinates",
    "coordinatesLon": "longitude of galactic coordinates"
}
  • PUT /events/:id Updates an event by id. Request:
{
    "name": "Event name",
    "description": "Event description",
    "date": "2021-12-31T23:59:59.999Z",
    "categoryId": "category id",
    "planetId": "planet id",
    "coordinatesLat": "latitude of galactic coordinates",
    "coordinatesLon": "longitude of galactic coordinates"
}
  • DELETE /events/:id Deletes an event by id.
  • GET /categories Returns a list of all categories.
  • GET /planets Returns a list of all planets.

Architecture

The backend app is built with NestJS, connected to a Postgres database.

The frontend app is built with React and NextJS.

Live deployment is done with Vercel for the frontend at https://syky-app-frontend.vercel.app/ and Heroku for the backend at https://syky-app-af5e9d2426db.herokuapp.com/. The live database is deployed in a Postgres instance in Vercel.

About


Languages

Language:TypeScript 92.7%Language:JavaScript 4.2%Language:Dockerfile 2.7%Language:Procfile 0.4%