Skip to content

Dominguezd01/QuackerAPI

Repository files navigation

Quacker API

This is the api of Quacker a Twitter inspired social media that I'm making for my final project.

Cloning

Clone the repository:

git clone https://github.com/Dominguezd01/QuackerAPI.git

Go to the directory

cd QuackerAPI

Install dependencies

bun install

Dont forget to add your .env configurations, otherwise the project will fail at start

Just create a .env file in the root of the project and modify the values shown to match your needs

DATABASE_URL=postgresql://USER:PASSWORD@HOST:PORT/DATABASE
GMAIL_ACC= example@gmail.com
GMAIL_TOKEN="your third party app token"
TOKEN_SECRET="Secret to create JWT"
LOGIN_QUACKER="http://localhost:5173/users/auth/login"
PORT=3333 #or whatever you want
WSPORT=3334 #Port for webshockets

Now you have to run the migration needed to create the tables in the database:

bunx prisma migrate dev

This will create the tables in your database and also the prisma_migrations table

Run the project in development

To run the project you can either use two of this commands:

If you dont want the server to restart with every change run this command:

bun index.ts

Otherwise:

bun run dev

Building

Run the following command to compile to JavaScript all the project, create the prisma client and start the API: THIS WILL ONLY WORK IN LINUX FOR COMPATIBILITY PURPOSE

bun run build

If you already have the API compiled, you can use this command in the directory of the file:

bun server.js

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published