Plann.er - Back-End is a Node.js application developed to serve as the backend for the plann.er travel planner application.
The project structure is as follows:
src: directory containing application source files
documentation: directory containing API documentation files (Insomnia and Swagger).
erros: directory containing exported ClientError class.
lib: directory containing Prisma, Mail, and Day.js configurations.
routes: directory containing application route files.
| error-handler.ts: handler to check if the error is client-side or server-side.
| env.ts: environment validation with Zod.
server.js: file that initializes the application.
.env.example: example file for environment variables.
prisma: directory containing schema and migrations.
git clone https://github.com/Vitinho163/Plann.er_Back-End.git
npm install
.env.example
file to .env
and fill in the information:DATABASE_URL="file:./dev.db"
API_BASE_URL="http://localhost:3333"
WEB_BASE_URL="http://localhost:3000"
PORT=3333
npm run dev
This API was hosted directly on Render.
The deployment can be accessed at the address:
https://plann-er-back-end.onrender.com
Note: As it is hosted on a free service, the application 'hibernates' after 15 minutes of inactivity. If you are trying to access the site and the BackEnd does not respond, just wait, as it will be 'initializing' the services.
The documentation for all routes is available at:
http://localhost:{port}/reference
Make sure to replace {port}
with the port defined in the .env
file. If not defined, try accessing it with the default port 3333.
Note: This application was developed using Node.js version v20.15. In case of issues, try updating Node.js to the latest version.
Plann.er - Back-End uma aplicao Node.js desenvolvida para se comunicar com o aplicativo de planejamento de viagens Plann.er.
A estrutura do projeto a seguinte:
src: diretrio contendo os arquivos de origem da aplicao
documentation: diretrio contendo arquivos de documentao da API (Insomnia e Swagger).
errors: diretrio contendo a classe ClientError exportada.
lib: diretrio contendo configuraes do Prisma, Mail e Day.js.
routes: diretrio contendo arquivos de rotas da aplicao.
error-handler.ts: handler para verificar se o erro do lado do cliente ou do servidor.
env.ts: verificao das variaveis de ambiente com Zod.
server.js: arquivo que inicializa a aplicao.
prisma: diretrio contendo schemas e migrations.
| .env.example: arquivo de exemplo para variveis de ambiente.
git clone https://github.com/Vitinho163/Plann.er_Back-End.git
npm install
.env.example
para .env
e preencha as informaes:DATABASE_URL="file:./dev.db"
API_BASE_URL="http://localhost:3333"
WEB_BASE_URL="http://localhost:3000"
PORT=3333
npm run dev
Esta API foi hospedada diretamente no Render.
O deployment pode ser acessado no seguinte endereo:
https://plann-er-back-end.onrender.com
Nota: Como est hospedado em um servio gratuito, a aplicao 'hiberna' aps 15 minutos de inatividade. Se voc estiver tentando acessar o site e o BackEnd no responder, basta aguardar, pois ele estar 'inicializando' os servios.
A documentao de todas as rotas est disponvel em:
https://plann-er-back-end.onrender.com/reference
ou caso esteja hospedado em seu desktop:
http://localhost:{port}/reference
Certifique-se de substituir {port}
pela porta definida no arquivo .env
. Se no estiver definido, tente acessar com a porta padro 3333.
Nota: Esta aplicao foi desenvolvida usando a verso Node.js v20.15. Em caso de problemas, tente atualizar o Node.js para a verso mais recente.