This is the api of Quacker a Twitter inspired social media that I'm making for my final project.
Clone the repository:
git clone https://github.com/Dominguezd01/QuackerAPI.git
Go to the directory
cd QuackerAPI
bun install
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
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
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