https://github.com/falcao-g/desafio-mega
Projeto back-end do processo seletivo 2023 da MEGA Jr.
https://github.com/falcao-g/desafio-mega
express jwt-authentication postgresql
Last synced: 2 months ago
JSON representation
Projeto back-end do processo seletivo 2023 da MEGA Jr.
- Host: GitHub
- URL: https://github.com/falcao-g/desafio-mega
- Owner: falcao-g
- Created: 2023-07-16T18:31:16.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-08-12T16:57:32.000Z (almost 3 years ago)
- Last Synced: 2026-01-13T01:13:47.081Z (6 months ago)
- Topics: express, jwt-authentication, postgresql
- Language: JavaScript
- Homepage:
- Size: 212 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
PS Back-end Mega Jr. 2023
## 📚 Introduction
This repository contains the back-end project for the Mega Jr. Selective Process of 2023.
This project consists of a HTTP API that provides the following functionalities:
- Register a new user
- Login
- Ability to change password, name and upload profile picture
- Get all player items
- See details of one specific item
- Sell an item
- Get all available lootboxes
- Buy and open a lootbox
- Propose a trade with another player
- Accept or decline a trade
- Get all trades
- Cancel a trade
## 🔧 What was used
Authentication
- Bcrypt
- JWT
- httpOnly cookies
Database
- PostgreSQL
- Knex
Tecnologies
- Node.js
- Express
Development
- ESLint
- Prettier
- Husky
- Lint Staged
- Nodemon
- Jest
Image handling
- Multer
Documentation
- Swagger
## 📥 Endpoints documentation
You can find the endpoints, parameters and responses documentation [here](https://petstore.swagger.io/?url=https://raw.githubusercontent.com/falcao-g/processo-mega/main/endpoints.yaml).
## 📝 How to use
### 📦 Prerequisites
- [Node.js](https://nodejs.org/en/download/)
- [PostgreSQL](https://www.postgresql.org/download/)
### 🚀 Running the project
1. Clone this repository
2. Install the dependencies with `npm install`
3. Create a `uploads` folder inside the `src` folder
4. Create a new database in PostgreSQL
5. Remove the `.example` extension from the `.env.example` file
6. Fill the `.env` file with the database information
7. In the `secret` field, you can generate one with `require('crypto').randomBytes(64).toString('hex');"` or use any other string
8. Run the migrations with `knex migrate:latest`
9. Run the project with `npm run dev:start`
10. The server will be running on `http://localhost:8080`! 🎉